diff options
| -rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 22 | ||||
| -rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 1 | ||||
| -rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 11 |
3 files changed, 22 insertions, 12 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 73d366ba31e5..f73e2180f333 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
| @@ -858,10 +858,7 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | |||
| 858 | if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) | 858 | if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) |
| 859 | return zfcp_erp_open_ptp_port(act); | 859 | return zfcp_erp_open_ptp_port(act); |
| 860 | if (!port->d_id) { | 860 | if (!port->d_id) { |
| 861 | zfcp_port_get(port); | 861 | zfcp_fc_trigger_did_lookup(port); |
| 862 | if (!queue_work(adapter->work_queue, | ||
| 863 | &port->gid_pn_work)) | ||
| 864 | zfcp_port_put(port); | ||
| 865 | return ZFCP_ERP_EXIT; | 862 | return ZFCP_ERP_EXIT; |
| 866 | } | 863 | } |
| 867 | return zfcp_erp_port_strategy_open_port(act); | 864 | return zfcp_erp_port_strategy_open_port(act); |
| @@ -869,12 +866,11 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | |||
| 869 | case ZFCP_ERP_STEP_PORT_OPENING: | 866 | case ZFCP_ERP_STEP_PORT_OPENING: |
| 870 | /* D_ID might have changed during open */ | 867 | /* D_ID might have changed during open */ |
| 871 | if (p_status & ZFCP_STATUS_COMMON_OPEN) { | 868 | if (p_status & ZFCP_STATUS_COMMON_OPEN) { |
| 872 | if (port->d_id) | 869 | if (!port->d_id) { |
| 873 | return ZFCP_ERP_SUCCEEDED; | 870 | zfcp_fc_trigger_did_lookup(port); |
| 874 | else { | 871 | return ZFCP_ERP_EXIT; |
| 875 | act->step = ZFCP_ERP_STEP_PORT_CLOSING; | ||
| 876 | return ZFCP_ERP_CONTINUES; | ||
| 877 | } | 872 | } |
| 873 | return ZFCP_ERP_SUCCEEDED; | ||
| 878 | } | 874 | } |
| 879 | if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) { | 875 | if (port->d_id && !(p_status & ZFCP_STATUS_COMMON_NOESC)) { |
| 880 | port->d_id = 0; | 876 | port->d_id = 0; |
| @@ -889,19 +885,21 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | |||
| 889 | static int zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) | 885 | static int zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) |
| 890 | { | 886 | { |
| 891 | struct zfcp_port *port = erp_action->port; | 887 | struct zfcp_port *port = erp_action->port; |
| 888 | int p_status = atomic_read(&port->status); | ||
| 892 | 889 | ||
| 893 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_NOESC) | 890 | if ((p_status & ZFCP_STATUS_COMMON_NOESC) && |
| 891 | !(p_status & ZFCP_STATUS_COMMON_OPEN)) | ||
| 894 | goto close_init_done; | 892 | goto close_init_done; |
| 895 | 893 | ||
| 896 | switch (erp_action->step) { | 894 | switch (erp_action->step) { |
| 897 | case ZFCP_ERP_STEP_UNINITIALIZED: | 895 | case ZFCP_ERP_STEP_UNINITIALIZED: |
| 898 | zfcp_erp_port_strategy_clearstati(port); | 896 | zfcp_erp_port_strategy_clearstati(port); |
| 899 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_OPEN) | 897 | if (p_status & ZFCP_STATUS_COMMON_OPEN) |
| 900 | return zfcp_erp_port_strategy_close(erp_action); | 898 | return zfcp_erp_port_strategy_close(erp_action); |
| 901 | break; | 899 | break; |
| 902 | 900 | ||
| 903 | case ZFCP_ERP_STEP_PORT_CLOSING: | 901 | case ZFCP_ERP_STEP_PORT_CLOSING: |
| 904 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_OPEN) | 902 | if (p_status & ZFCP_STATUS_COMMON_OPEN) |
| 905 | return ZFCP_ERP_FAILED; | 903 | return ZFCP_ERP_FAILED; |
| 906 | break; | 904 | break; |
| 907 | } | 905 | } |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 629edec70405..b3f28deb4505 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
| @@ -96,6 +96,7 @@ extern int zfcp_fc_scan_ports(struct zfcp_adapter *); | |||
| 96 | extern void _zfcp_fc_scan_ports_later(struct work_struct *); | 96 | extern void _zfcp_fc_scan_ports_later(struct work_struct *); |
| 97 | extern void zfcp_fc_incoming_els(struct zfcp_fsf_req *); | 97 | extern void zfcp_fc_incoming_els(struct zfcp_fsf_req *); |
| 98 | extern void zfcp_fc_port_did_lookup(struct work_struct *); | 98 | extern void zfcp_fc_port_did_lookup(struct work_struct *); |
| 99 | extern void zfcp_fc_trigger_did_lookup(struct zfcp_port *); | ||
| 99 | extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *); | 100 | extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *); |
| 100 | extern void zfcp_fc_test_link(struct zfcp_port *); | 101 | extern void zfcp_fc_test_link(struct zfcp_port *); |
| 101 | extern void zfcp_fc_link_test_work(struct work_struct *); | 102 | extern void zfcp_fc_link_test_work(struct work_struct *); |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 722f22de8753..df23bcead23d 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
| @@ -361,6 +361,17 @@ out: | |||
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | /** | 363 | /** |
| 364 | * zfcp_fc_trigger_did_lookup - trigger the d_id lookup using a GID_PN request | ||
| 365 | * @port: The zfcp_port to lookup the d_id for. | ||
| 366 | */ | ||
| 367 | void zfcp_fc_trigger_did_lookup(struct zfcp_port *port) | ||
| 368 | { | ||
| 369 | zfcp_port_get(port); | ||
| 370 | if (!queue_work(port->adapter->work_queue, &port->gid_pn_work)) | ||
| 371 | zfcp_port_put(port); | ||
| 372 | } | ||
| 373 | |||
| 374 | /** | ||
| 364 | * zfcp_fc_plogi_evaluate - evaluate PLOGI playload | 375 | * zfcp_fc_plogi_evaluate - evaluate PLOGI playload |
| 365 | * @port: zfcp_port structure | 376 | * @port: zfcp_port structure |
| 366 | * @plogi: plogi payload | 377 | * @plogi: plogi payload |
