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.c95
1 files changed, 37 insertions, 58 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index c065cb836c97..57cb628a05aa 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -31,8 +31,6 @@
31 31
32#define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP 32#define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP
33 33
34#define ZFCP_ERP_REVISION "$Revision: 1.86 $"
35
36#include "zfcp_ext.h" 34#include "zfcp_ext.h"
37 35
38static int zfcp_erp_adisc(struct zfcp_port *); 36static int zfcp_erp_adisc(struct zfcp_port *);
@@ -2248,15 +2246,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action)
2248{ 2246{
2249 int retval; 2247 int retval;
2250 2248
2251 if ((atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,
2252 &erp_action->adapter->status)) &&
2253 (erp_action->adapter->adapter_features &
2254 FSF_FEATURE_HBAAPI_MANAGEMENT)) {
2255 zfcp_erp_adapter_strategy_open_fsf_xport(erp_action);
2256 atomic_set(&erp_action->adapter->erp_counter, 0);
2257 return ZFCP_ERP_FAILED;
2258 }
2259
2260 retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action); 2249 retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action);
2261 if (retval == ZFCP_ERP_FAILED) 2250 if (retval == ZFCP_ERP_FAILED)
2262 return ZFCP_ERP_FAILED; 2251 return ZFCP_ERP_FAILED;
@@ -2268,13 +2257,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action)
2268 return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action); 2257 return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action);
2269} 2258}
2270 2259
2271/*
2272 * function:
2273 *
2274 * purpose:
2275 *
2276 * returns:
2277 */
2278static int 2260static int
2279zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) 2261zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
2280{ 2262{
@@ -2352,48 +2334,40 @@ static int
2352zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) 2334zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action)
2353{ 2335{
2354 int ret; 2336 int ret;
2355 int retries; 2337 struct zfcp_adapter *adapter;
2356 int sleep;
2357 struct zfcp_adapter *adapter = erp_action->adapter;
2358 2338
2339 adapter = erp_action->adapter;
2359 atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); 2340 atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
2360 2341
2361 retries = 0; 2342 write_lock(&adapter->erp_lock);
2362 do { 2343 zfcp_erp_action_to_running(erp_action);
2363 write_lock(&adapter->erp_lock); 2344 write_unlock(&adapter->erp_lock);
2364 zfcp_erp_action_to_running(erp_action);
2365 write_unlock(&adapter->erp_lock);
2366 zfcp_erp_timeout_init(erp_action);
2367 ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);
2368 if (ret == -EOPNOTSUPP) {
2369 debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp");
2370 return ZFCP_ERP_SUCCEEDED;
2371 } else if (ret) {
2372 debug_text_event(adapter->erp_dbf, 3, "a_xport_failed");
2373 return ZFCP_ERP_FAILED;
2374 }
2375 debug_text_event(adapter->erp_dbf, 6, "a_xport_ok");
2376 2345
2377 down(&adapter->erp_ready_sem); 2346 zfcp_erp_timeout_init(erp_action);
2378 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { 2347 ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);
2379 ZFCP_LOG_INFO("error: exchange of port data " 2348 if (ret == -EOPNOTSUPP) {
2380 "for adapter %s timed out\n", 2349 debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp");
2381 zfcp_get_busid_by_adapter(adapter)); 2350 return ZFCP_ERP_SUCCEEDED;
2382 break; 2351 } else if (ret) {
2383 } 2352 debug_text_event(adapter->erp_dbf, 3, "a_xport_failed");
2384 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, 2353 return ZFCP_ERP_FAILED;
2385 &adapter->status)) 2354 }
2386 break; 2355 debug_text_event(adapter->erp_dbf, 6, "a_xport_ok");
2387 2356
2388 if (retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES) { 2357 ret = ZFCP_ERP_SUCCEEDED;
2389 sleep = ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP; 2358 down(&adapter->erp_ready_sem);
2390 retries++; 2359 if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
2391 } else 2360 ZFCP_LOG_INFO("error: exchange port data timed out (adapter "
2392 sleep = ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP; 2361 "%s)\n", zfcp_get_busid_by_adapter(adapter));
2393 schedule_timeout(sleep); 2362 ret = ZFCP_ERP_FAILED;
2394 } while (1); 2363 }
2364 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status)) {
2365 ZFCP_LOG_INFO("error: exchange port data failed (adapter "
2366 "%s\n", zfcp_get_busid_by_adapter(adapter));
2367 ret = ZFCP_ERP_FAILED;
2368 }
2395 2369
2396 return ZFCP_ERP_SUCCEEDED; 2370 return ret;
2397} 2371}
2398 2372
2399/* 2373/*
@@ -3417,10 +3391,13 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
3417 && (!atomic_test_mask(ZFCP_STATUS_UNIT_TEMPORARY, 3391 && (!atomic_test_mask(ZFCP_STATUS_UNIT_TEMPORARY,
3418 &unit->status)) 3392 &unit->status))
3419 && !unit->device 3393 && !unit->device
3420 && port->rport) 3394 && port->rport) {
3421 scsi_add_device(port->adapter->scsi_host, 0, 3395 atomic_set_mask(ZFCP_STATUS_UNIT_REGISTERED,
3422 port->rport->scsi_target_id, 3396 &unit->status);
3423 unit->scsi_lun); 3397 scsi_scan_target(&port->rport->dev, 0,
3398 port->rport->scsi_target_id,
3399 unit->scsi_lun, 0);
3400 }
3424 zfcp_unit_put(unit); 3401 zfcp_unit_put(unit);
3425 break; 3402 break;
3426 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: 3403 case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
@@ -3441,6 +3418,8 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
3441 "(adapter %s, wwpn=0x%016Lx)\n", 3418 "(adapter %s, wwpn=0x%016Lx)\n",
3442 zfcp_get_busid_by_port(port), 3419 zfcp_get_busid_by_port(port),
3443 port->wwpn); 3420 port->wwpn);
3421 else
3422 scsi_flush_work(adapter->scsi_host);
3444 } 3423 }
3445 zfcp_port_put(port); 3424 zfcp_port_put(port);
3446 break; 3425 break;