diff options
author | Paul Mackerras <paulus@samba.org> | 2006-02-23 22:05:47 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-23 22:05:47 -0500 |
commit | a00428f5b149e36b8225b2a0812742a6dfb07b8c (patch) | |
tree | a78869cd67cf78a0eb091fb0ea5d397734bd6738 /drivers/s390/scsi/zfcp_erp.c | |
parent | 774fee58c465ea1c7e9775e347ec307bcf2deeb3 (diff) | |
parent | fb5c594c2acc441f0d2d8f457484a0e0e9285db3 (diff) |
Merge ../powerpc-merge
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 82 |
1 files changed, 30 insertions, 52 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index da947e662031..e3c4bdd29a60 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -2246,15 +2246,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action) | |||
2246 | { | 2246 | { |
2247 | int retval; | 2247 | int retval; |
2248 | 2248 | ||
2249 | if ((atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, | ||
2250 | &erp_action->adapter->status)) && | ||
2251 | (erp_action->adapter->adapter_features & | ||
2252 | FSF_FEATURE_HBAAPI_MANAGEMENT)) { | ||
2253 | zfcp_erp_adapter_strategy_open_fsf_xport(erp_action); | ||
2254 | atomic_set(&erp_action->adapter->erp_counter, 0); | ||
2255 | return ZFCP_ERP_FAILED; | ||
2256 | } | ||
2257 | |||
2258 | retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action); | 2249 | retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action); |
2259 | if (retval == ZFCP_ERP_FAILED) | 2250 | if (retval == ZFCP_ERP_FAILED) |
2260 | return ZFCP_ERP_FAILED; | 2251 | return ZFCP_ERP_FAILED; |
@@ -2266,13 +2257,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action) | |||
2266 | return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action); | 2257 | return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action); |
2267 | } | 2258 | } |
2268 | 2259 | ||
2269 | /* | ||
2270 | * function: | ||
2271 | * | ||
2272 | * purpose: | ||
2273 | * | ||
2274 | * returns: | ||
2275 | */ | ||
2276 | static int | 2260 | static int |
2277 | zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) | 2261 | zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) |
2278 | { | 2262 | { |
@@ -2350,48 +2334,40 @@ static int | |||
2350 | zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) | 2334 | zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) |
2351 | { | 2335 | { |
2352 | int ret; | 2336 | int ret; |
2353 | int retries; | 2337 | struct zfcp_adapter *adapter; |
2354 | int sleep; | ||
2355 | struct zfcp_adapter *adapter = erp_action->adapter; | ||
2356 | 2338 | ||
2339 | adapter = erp_action->adapter; | ||
2357 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); | 2340 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); |
2358 | 2341 | ||
2359 | retries = 0; | 2342 | write_lock(&adapter->erp_lock); |
2360 | do { | 2343 | zfcp_erp_action_to_running(erp_action); |
2361 | write_lock(&adapter->erp_lock); | 2344 | write_unlock(&adapter->erp_lock); |
2362 | zfcp_erp_action_to_running(erp_action); | ||
2363 | write_unlock(&adapter->erp_lock); | ||
2364 | zfcp_erp_timeout_init(erp_action); | ||
2365 | ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL); | ||
2366 | if (ret == -EOPNOTSUPP) { | ||
2367 | debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp"); | ||
2368 | return ZFCP_ERP_SUCCEEDED; | ||
2369 | } else if (ret) { | ||
2370 | debug_text_event(adapter->erp_dbf, 3, "a_xport_failed"); | ||
2371 | return ZFCP_ERP_FAILED; | ||
2372 | } | ||
2373 | debug_text_event(adapter->erp_dbf, 6, "a_xport_ok"); | ||
2374 | 2345 | ||
2375 | down(&adapter->erp_ready_sem); | 2346 | zfcp_erp_timeout_init(erp_action); |
2376 | if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { | 2347 | ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL); |
2377 | ZFCP_LOG_INFO("error: exchange of port data " | 2348 | if (ret == -EOPNOTSUPP) { |
2378 | "for adapter %s timed out\n", | 2349 | debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp"); |
2379 | zfcp_get_busid_by_adapter(adapter)); | 2350 | return ZFCP_ERP_SUCCEEDED; |
2380 | break; | 2351 | } else if (ret) { |
2381 | } | 2352 | debug_text_event(adapter->erp_dbf, 3, "a_xport_failed"); |
2382 | if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, | 2353 | return ZFCP_ERP_FAILED; |
2383 | &adapter->status)) | 2354 | } |
2384 | break; | 2355 | debug_text_event(adapter->erp_dbf, 6, "a_xport_ok"); |
2385 | 2356 | ||
2386 | if (retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES) { | 2357 | ret = ZFCP_ERP_SUCCEEDED; |
2387 | sleep = ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP; | 2358 | down(&adapter->erp_ready_sem); |
2388 | retries++; | 2359 | if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { |
2389 | } else | 2360 | ZFCP_LOG_INFO("error: exchange port data timed out (adapter " |
2390 | sleep = ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP; | 2361 | "%s)\n", zfcp_get_busid_by_adapter(adapter)); |
2391 | schedule_timeout(sleep); | 2362 | ret = ZFCP_ERP_FAILED; |
2392 | } 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 | } | ||
2393 | 2369 | ||
2394 | return ZFCP_ERP_SUCCEEDED; | 2370 | return ret; |
2395 | } | 2371 | } |
2396 | 2372 | ||
2397 | /* | 2373 | /* |
@@ -3439,6 +3415,8 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter, | |||
3439 | "(adapter %s, wwpn=0x%016Lx)\n", | 3415 | "(adapter %s, wwpn=0x%016Lx)\n", |
3440 | zfcp_get_busid_by_port(port), | 3416 | zfcp_get_busid_by_port(port), |
3441 | port->wwpn); | 3417 | port->wwpn); |
3418 | else | ||
3419 | scsi_flush_work(adapter->scsi_host); | ||
3442 | } | 3420 | } |
3443 | zfcp_port_put(port); | 3421 | zfcp_port_put(port); |
3444 | break; | 3422 | break; |