diff options
author | Andreas Herrmann <aherrman@de.ibm.com> | 2006-02-10 19:41:50 -0500 |
---|---|---|
committer | <jejb@mulgrave.il.steeleye.com> | 2006-02-12 12:11:58 -0500 |
commit | 2f8f3ed5fc566700cf45d422f4cf1624bd123d93 (patch) | |
tree | b319da619c080aa27f00afa9105c526157fc4a87 /drivers/s390/scsi/zfcp_fsf.c | |
parent | c8024eb549f0c701e6d1c46c32e997f06f05d76d (diff) |
[SCSI] zfcp: fix adapter erp when link is unplugged
Remove endless polling for replug of the local link. Just wait for
link up notification.
Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 74 |
1 files changed, 41 insertions, 33 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 9f0cb3d820c..bd8cd4d4613 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -388,6 +388,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) | |||
388 | case FSF_PROT_LINK_DOWN: | 388 | case FSF_PROT_LINK_DOWN: |
389 | zfcp_fsf_link_down_info_eval(adapter, | 389 | zfcp_fsf_link_down_info_eval(adapter, |
390 | &prot_status_qual->link_down_info); | 390 | &prot_status_qual->link_down_info); |
391 | zfcp_erp_adapter_reopen(adapter, 0); | ||
391 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 392 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
392 | break; | 393 | break; |
393 | 394 | ||
@@ -558,10 +559,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, | |||
558 | 559 | ||
559 | atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); | 560 | atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); |
560 | 561 | ||
561 | if (link_down == NULL) { | 562 | if (link_down == NULL) |
562 | zfcp_erp_adapter_reopen(adapter, 0); | 563 | goto out; |
563 | return; | ||
564 | } | ||
565 | 564 | ||
566 | switch (link_down->error_code) { | 565 | switch (link_down->error_code) { |
567 | case FSF_PSQ_LINK_NO_LIGHT: | 566 | case FSF_PSQ_LINK_NO_LIGHT: |
@@ -643,16 +642,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, | |||
643 | link_down->explanation_code, | 642 | link_down->explanation_code, |
644 | link_down->vendor_specific_code); | 643 | link_down->vendor_specific_code); |
645 | 644 | ||
646 | switch (link_down->error_code) { | 645 | out: |
647 | case FSF_PSQ_LINK_NO_LIGHT: | 646 | zfcp_erp_adapter_failed(adapter); |
648 | case FSF_PSQ_LINK_WRAP_PLUG: | ||
649 | case FSF_PSQ_LINK_NO_FCP: | ||
650 | case FSF_PSQ_LINK_FIRMWARE_UPDATE: | ||
651 | zfcp_erp_adapter_reopen(adapter, 0); | ||
652 | break; | ||
653 | default: | ||
654 | zfcp_erp_adapter_failed(adapter); | ||
655 | } | ||
656 | } | 647 | } |
657 | 648 | ||
658 | /* | 649 | /* |
@@ -2304,6 +2295,35 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, | |||
2304 | return retval; | 2295 | return retval; |
2305 | } | 2296 | } |
2306 | 2297 | ||
2298 | /** | ||
2299 | * zfcp_fsf_exchange_port_evaluate | ||
2300 | * @fsf_req: fsf_req which belongs to xchg port data request | ||
2301 | * @xchg_ok: specifies if xchg port data was incomplete or complete (0/1) | ||
2302 | */ | ||
2303 | static void | ||
2304 | zfcp_fsf_exchange_port_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) | ||
2305 | { | ||
2306 | struct zfcp_adapter *adapter; | ||
2307 | struct fsf_qtcb *qtcb; | ||
2308 | struct fsf_qtcb_bottom_port *bottom, *data; | ||
2309 | struct Scsi_Host *shost; | ||
2310 | |||
2311 | adapter = fsf_req->adapter; | ||
2312 | qtcb = fsf_req->qtcb; | ||
2313 | bottom = &qtcb->bottom.port; | ||
2314 | shost = adapter->scsi_host; | ||
2315 | |||
2316 | data = (struct fsf_qtcb_bottom_port*) fsf_req->data; | ||
2317 | if (data) | ||
2318 | memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port)); | ||
2319 | |||
2320 | if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) | ||
2321 | fc_host_permanent_port_name(shost) = bottom->wwpn; | ||
2322 | else | ||
2323 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); | ||
2324 | fc_host_maxframe_size(shost) = bottom->maximum_frame_size; | ||
2325 | fc_host_supported_speeds(shost) = bottom->supported_speed; | ||
2326 | } | ||
2307 | 2327 | ||
2308 | /** | 2328 | /** |
2309 | * zfcp_fsf_exchange_port_data_handler - handler for exchange_port_data request | 2329 | * zfcp_fsf_exchange_port_data_handler - handler for exchange_port_data request |
@@ -2312,38 +2332,26 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, | |||
2312 | static void | 2332 | static void |
2313 | zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) | 2333 | zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) |
2314 | { | 2334 | { |
2315 | struct zfcp_adapter *adapter = fsf_req->adapter; | 2335 | struct zfcp_adapter *adapter; |
2316 | struct Scsi_Host *shost = adapter->scsi_host; | 2336 | struct fsf_qtcb *qtcb; |
2317 | struct fsf_qtcb *qtcb = fsf_req->qtcb; | 2337 | |
2318 | struct fsf_qtcb_bottom_port *bottom, *data; | 2338 | adapter = fsf_req->adapter; |
2339 | qtcb = fsf_req->qtcb; | ||
2319 | 2340 | ||
2320 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) | 2341 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) |
2321 | return; | 2342 | return; |
2322 | 2343 | ||
2323 | switch (qtcb->header.fsf_status) { | 2344 | switch (qtcb->header.fsf_status) { |
2324 | case FSF_GOOD: | 2345 | case FSF_GOOD: |
2346 | zfcp_fsf_exchange_port_evaluate(fsf_req, 1); | ||
2325 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); | 2347 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); |
2326 | |||
2327 | bottom = &qtcb->bottom.port; | ||
2328 | data = (struct fsf_qtcb_bottom_port*) fsf_req->data; | ||
2329 | if (data) | ||
2330 | memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port)); | ||
2331 | if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) | ||
2332 | fc_host_permanent_port_name(shost) = bottom->wwpn; | ||
2333 | else | ||
2334 | fc_host_permanent_port_name(shost) = | ||
2335 | fc_host_port_name(shost); | ||
2336 | fc_host_maxframe_size(shost) = bottom->maximum_frame_size; | ||
2337 | fc_host_supported_speeds(shost) = bottom->supported_speed; | ||
2338 | break; | 2348 | break; |
2339 | |||
2340 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: | 2349 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: |
2350 | zfcp_fsf_exchange_port_evaluate(fsf_req, 0); | ||
2341 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); | 2351 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); |
2342 | |||
2343 | zfcp_fsf_link_down_info_eval(adapter, | 2352 | zfcp_fsf_link_down_info_eval(adapter, |
2344 | &qtcb->header.fsf_status_qual.link_down_info); | 2353 | &qtcb->header.fsf_status_qual.link_down_info); |
2345 | break; | 2354 | break; |
2346 | |||
2347 | default: | 2355 | default: |
2348 | debug_text_event(adapter->erp_dbf, 0, "xchg-port-ng"); | 2356 | debug_text_event(adapter->erp_dbf, 0, "xchg-port-ng"); |
2349 | debug_event(adapter->erp_dbf, 0, | 2357 | debug_event(adapter->erp_dbf, 0, |