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.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index e3dbeda97179..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);
@@ -714,6 +718,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act)
714 if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) 718 if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED)
715 return ZFCP_ERP_FAILED; 719 return ZFCP_ERP_FAILED;
716 720
721 if (mempool_resize(act->adapter->pool.status_read_data,
722 act->adapter->stat_read_buf_num, GFP_KERNEL))
723 return ZFCP_ERP_FAILED;
724
725 if (mempool_resize(act->adapter->pool.status_read_req,
726 act->adapter->stat_read_buf_num, GFP_KERNEL))
727 return ZFCP_ERP_FAILED;
728
717 atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); 729 atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num);
718 if (zfcp_status_read_refill(act->adapter)) 730 if (zfcp_status_read_refill(act->adapter))
719 return ZFCP_ERP_FAILED; 731 return ZFCP_ERP_FAILED;
@@ -885,8 +897,7 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act)
885 } 897 }
886 if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) { 898 if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) {
887 port->d_id = 0; 899 port->d_id = 0;
888 _zfcp_erp_port_reopen(port, 0, "erpsoc1", NULL); 900 return ZFCP_ERP_FAILED;
889 return ZFCP_ERP_EXIT;
890 } 901 }
891 /* fall through otherwise */ 902 /* fall through otherwise */
892 } 903 }
@@ -1180,19 +1191,14 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
1180 1191
1181 switch (act->action) { 1192 switch (act->action) {
1182 case ZFCP_ERP_ACTION_REOPEN_UNIT: 1193 case ZFCP_ERP_ACTION_REOPEN_UNIT:
1183 if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) {
1184 get_device(&unit->dev);
1185 if (scsi_queue_work(unit->port->adapter->scsi_host,
1186 &unit->scsi_work) <= 0)
1187 put_device(&unit->dev);
1188 }
1189 put_device(&unit->dev); 1194 put_device(&unit->dev);
1190 break; 1195 break;
1191 1196
1192 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
1193 case ZFCP_ERP_ACTION_REOPEN_PORT: 1197 case ZFCP_ERP_ACTION_REOPEN_PORT:
1194 if (result == ZFCP_ERP_SUCCEEDED) 1198 if (result == ZFCP_ERP_SUCCEEDED)
1195 zfcp_scsi_schedule_rport_register(port); 1199 zfcp_scsi_schedule_rport_register(port);
1200 /* fall through */
1201 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
1196 put_device(&port->dev); 1202 put_device(&port->dev);
1197 break; 1203 break;
1198 1204
@@ -1239,6 +1245,11 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
1239 goto unlock; 1245 goto unlock;
1240 } 1246 }
1241 1247
1248 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
1249 retval = ZFCP_ERP_FAILED;
1250 goto check_target;
1251 }
1252
1242 zfcp_erp_action_to_running(erp_action); 1253 zfcp_erp_action_to_running(erp_action);
1243 1254
1244 /* no lock to allow for blocking operations */ 1255 /* no lock to allow for blocking operations */
@@ -1271,6 +1282,7 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
1271 goto unlock; 1282 goto unlock;
1272 } 1283 }
1273 1284
1285check_target:
1274 retval = zfcp_erp_strategy_check_target(erp_action, retval); 1286 retval = zfcp_erp_strategy_check_target(erp_action, retval);
1275 zfcp_erp_action_dequeue(erp_action); 1287 zfcp_erp_action_dequeue(erp_action);
1276 retval = zfcp_erp_strategy_statechange(erp_action, retval); 1288 retval = zfcp_erp_strategy_statechange(erp_action, retval);