aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_erp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r--drivers/s390/scsi/zfcp_erp.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index fd068bc1bd0a..160b432c907f 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -141,9 +141,13 @@ static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter,
141 if (!(p_status & ZFCP_STATUS_COMMON_UNBLOCKED)) 141 if (!(p_status & ZFCP_STATUS_COMMON_UNBLOCKED))
142 need = ZFCP_ERP_ACTION_REOPEN_PORT; 142 need = ZFCP_ERP_ACTION_REOPEN_PORT;
143 /* fall through */ 143 /* fall through */
144 case ZFCP_ERP_ACTION_REOPEN_PORT:
145 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: 144 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
146 p_status = atomic_read(&port->status); 145 p_status = atomic_read(&port->status);
146 if (!(p_status & ZFCP_STATUS_COMMON_OPEN))
147 need = ZFCP_ERP_ACTION_REOPEN_PORT;
148 /* fall through */
149 case ZFCP_ERP_ACTION_REOPEN_PORT:
150 p_status = atomic_read(&port->status);
147 if (p_status & ZFCP_STATUS_COMMON_ERP_INUSE) 151 if (p_status & ZFCP_STATUS_COMMON_ERP_INUSE)
148 return 0; 152 return 0;
149 a_status = atomic_read(&adapter->status); 153 a_status = atomic_read(&adapter->status);
@@ -893,8 +897,7 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act)
893 } 897 }
894 if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) { 898 if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) {
895 port->d_id = 0; 899 port->d_id = 0;
896 _zfcp_erp_port_reopen(port, 0, "erpsoc1", NULL); 900 return ZFCP_ERP_FAILED;
897 return ZFCP_ERP_EXIT;
898 } 901 }
899 /* fall through otherwise */ 902 /* fall through otherwise */
900 } 903 }
@@ -1188,19 +1191,14 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
1188 1191
1189 switch (act->action) { 1192 switch (act->action) {
1190 case ZFCP_ERP_ACTION_REOPEN_UNIT: 1193 case ZFCP_ERP_ACTION_REOPEN_UNIT:
1191 if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) {
1192 get_device(&unit->dev);
1193 if (scsi_queue_work(unit->port->adapter->scsi_host,
1194 &unit->scsi_work) <= 0)
1195 put_device(&unit->dev);
1196 }
1197 put_device(&unit->dev); 1194 put_device(&unit->dev);
1198 break; 1195 break;
1199 1196
1200 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
1201 case ZFCP_ERP_ACTION_REOPEN_PORT: 1197 case ZFCP_ERP_ACTION_REOPEN_PORT:
1202 if (result == ZFCP_ERP_SUCCEEDED) 1198 if (result == ZFCP_ERP_SUCCEEDED)
1203 zfcp_scsi_schedule_rport_register(port); 1199 zfcp_scsi_schedule_rport_register(port);
1200 /* fall through */
1201 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
1204 put_device(&port->dev); 1202 put_device(&port->dev);
1205 break; 1203 break;
1206 1204
@@ -1247,6 +1245,11 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
1247 goto unlock; 1245 goto unlock;
1248 } 1246 }
1249 1247
1248 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
1249 retval = ZFCP_ERP_FAILED;
1250 goto check_target;
1251 }
1252
1250 zfcp_erp_action_to_running(erp_action); 1253 zfcp_erp_action_to_running(erp_action);
1251 1254
1252 /* no lock to allow for blocking operations */ 1255 /* no lock to allow for blocking operations */
@@ -1279,6 +1282,7 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
1279 goto unlock; 1282 goto unlock;
1280 } 1283 }
1281 1284
1285check_target:
1282 retval = zfcp_erp_strategy_check_target(erp_action, retval); 1286 retval = zfcp_erp_strategy_check_target(erp_action, retval);
1283 zfcp_erp_action_dequeue(erp_action); 1287 zfcp_erp_action_dequeue(erp_action);
1284 retval = zfcp_erp_strategy_statechange(erp_action, retval); 1288 retval = zfcp_erp_strategy_statechange(erp_action, retval);