zfcp_erp.c (42249094f79422fbf5ed4b54eeb48ff096809b8f) zfcp_erp.c (1b33ef23946adee4b7d9d6b16b7285ce61063451)
1/*
2 * zfcp device driver
3 *
4 * Error Recovery Procedures (ERP).
5 *
6 * Copyright IBM Corp. 2002, 2010
7 */
8

--- 807 unchanged lines hidden (view full) ---

816 return ZFCP_ERP_NOMEM;
817 act->step = ZFCP_ERP_STEP_PHYS_PORT_CLOSING;
818 if (retval)
819 return ZFCP_ERP_FAILED;
820
821 return ZFCP_ERP_CONTINUES;
822}
823
1/*
2 * zfcp device driver
3 *
4 * Error Recovery Procedures (ERP).
5 *
6 * Copyright IBM Corp. 2002, 2010
7 */
8

--- 807 unchanged lines hidden (view full) ---

816 return ZFCP_ERP_NOMEM;
817 act->step = ZFCP_ERP_STEP_PHYS_PORT_CLOSING;
818 if (retval)
819 return ZFCP_ERP_FAILED;
820
821 return ZFCP_ERP_CONTINUES;
822}
823
824static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port)
825{
826 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &port->status);
827}
828
829static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
830{
831 struct zfcp_port *port = erp_action->port;
832 int status = atomic_read(&port->status);
833
834 switch (erp_action->step) {
835 case ZFCP_ERP_STEP_UNINITIALIZED:
824static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
825{
826 struct zfcp_port *port = erp_action->port;
827 int status = atomic_read(&port->status);
828
829 switch (erp_action->step) {
830 case ZFCP_ERP_STEP_UNINITIALIZED:
836 zfcp_erp_port_strategy_clearstati(port);
837 if ((status & ZFCP_STATUS_PORT_PHYS_OPEN) &&
838 (status & ZFCP_STATUS_COMMON_OPEN))
839 return zfcp_erp_port_forced_strategy_close(erp_action);
840 else
841 return ZFCP_ERP_FAILED;
842
843 case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
844 if (!(status & ZFCP_STATUS_PORT_PHYS_OPEN))

--- 83 unchanged lines hidden (view full) ---

928 int p_status = atomic_read(&port->status);
929
930 if ((p_status & ZFCP_STATUS_COMMON_NOESC) &&
931 !(p_status & ZFCP_STATUS_COMMON_OPEN))
932 goto close_init_done;
933
934 switch (erp_action->step) {
935 case ZFCP_ERP_STEP_UNINITIALIZED:
831 if ((status & ZFCP_STATUS_PORT_PHYS_OPEN) &&
832 (status & ZFCP_STATUS_COMMON_OPEN))
833 return zfcp_erp_port_forced_strategy_close(erp_action);
834 else
835 return ZFCP_ERP_FAILED;
836
837 case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
838 if (!(status & ZFCP_STATUS_PORT_PHYS_OPEN))

--- 83 unchanged lines hidden (view full) ---

922 int p_status = atomic_read(&port->status);
923
924 if ((p_status & ZFCP_STATUS_COMMON_NOESC) &&
925 !(p_status & ZFCP_STATUS_COMMON_OPEN))
926 goto close_init_done;
927
928 switch (erp_action->step) {
929 case ZFCP_ERP_STEP_UNINITIALIZED:
936 zfcp_erp_port_strategy_clearstati(port);
937 if (p_status & ZFCP_STATUS_COMMON_OPEN)
938 return zfcp_erp_port_strategy_close(erp_action);
939 break;
940
941 case ZFCP_ERP_STEP_PORT_CLOSING:
942 if (p_status & ZFCP_STATUS_COMMON_OPEN)
943 return ZFCP_ERP_FAILED;
944 break;

--- 629 unchanged lines hidden ---
930 if (p_status & ZFCP_STATUS_COMMON_OPEN)
931 return zfcp_erp_port_strategy_close(erp_action);
932 break;
933
934 case ZFCP_ERP_STEP_PORT_CLOSING:
935 if (p_status & ZFCP_STATUS_COMMON_OPEN)
936 return ZFCP_ERP_FAILED;
937 break;

--- 629 unchanged lines hidden ---