diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_fc.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index e8d032b9dfbd..19ae0842047c 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -98,13 +98,6 @@ static void zfcp_wka_port_offline(struct work_struct *work) | |||
98 | struct zfcp_wka_port *wka_port = | 98 | struct zfcp_wka_port *wka_port = |
99 | container_of(dw, struct zfcp_wka_port, work); | 99 | container_of(dw, struct zfcp_wka_port, work); |
100 | 100 | ||
101 | /* Don't wait forvever. If the wka_port is too busy take it offline | ||
102 | through a new call later */ | ||
103 | if (!wait_event_timeout(wka_port->completion_wq, | ||
104 | atomic_read(&wka_port->refcount) == 0, | ||
105 | HZ >> 1)) | ||
106 | return; | ||
107 | |||
108 | mutex_lock(&wka_port->mutex); | 101 | mutex_lock(&wka_port->mutex); |
109 | if ((atomic_read(&wka_port->refcount) != 0) || | 102 | if ((atomic_read(&wka_port->refcount) != 0) || |
110 | (wka_port->status != ZFCP_WKA_PORT_ONLINE)) | 103 | (wka_port->status != ZFCP_WKA_PORT_ONLINE)) |
@@ -142,6 +135,14 @@ void zfcp_fc_nameserver_init(struct zfcp_adapter *adapter) | |||
142 | INIT_DELAYED_WORK(&wka_port->work, zfcp_wka_port_offline); | 135 | INIT_DELAYED_WORK(&wka_port->work, zfcp_wka_port_offline); |
143 | } | 136 | } |
144 | 137 | ||
138 | void zfcp_fc_wka_port_force_offline(struct zfcp_wka_port *wka) | ||
139 | { | ||
140 | cancel_delayed_work_sync(&wka->work); | ||
141 | mutex_lock(&wka->mutex); | ||
142 | wka->status = ZFCP_WKA_PORT_OFFLINE; | ||
143 | mutex_unlock(&wka->mutex); | ||
144 | } | ||
145 | |||
145 | static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, | 146 | static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, |
146 | struct fcp_rscn_element *elem) | 147 | struct fcp_rscn_element *elem) |
147 | { | 148 | { |
@@ -372,7 +373,8 @@ static void zfcp_fc_adisc_handler(unsigned long data) | |||
372 | 373 | ||
373 | if (adisc->els.status) { | 374 | if (adisc->els.status) { |
374 | /* request rejected or timed out */ | 375 | /* request rejected or timed out */ |
375 | zfcp_erp_port_forced_reopen(port, 0, "fcadh_1", NULL); | 376 | zfcp_erp_port_forced_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, |
377 | "fcadh_1", NULL); | ||
376 | goto out; | 378 | goto out; |
377 | } | 379 | } |
378 | 380 | ||
@@ -431,11 +433,6 @@ void zfcp_fc_link_test_work(struct work_struct *work) | |||
431 | container_of(work, struct zfcp_port, test_link_work); | 433 | container_of(work, struct zfcp_port, test_link_work); |
432 | int retval; | 434 | int retval; |
433 | 435 | ||
434 | if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_UNBLOCKED)) { | ||
435 | zfcp_port_put(port); | ||
436 | return; /* port erp is running and will update rport status */ | ||
437 | } | ||
438 | |||
439 | zfcp_port_get(port); | 436 | zfcp_port_get(port); |
440 | port->rport_task = RPORT_DEL; | 437 | port->rport_task = RPORT_DEL; |
441 | zfcp_scsi_rport_work(&port->rport_work); | 438 | zfcp_scsi_rport_work(&port->rport_work); |
@@ -542,6 +539,9 @@ static void zfcp_validate_port(struct zfcp_port *port) | |||
542 | { | 539 | { |
543 | struct zfcp_adapter *adapter = port->adapter; | 540 | struct zfcp_adapter *adapter = port->adapter; |
544 | 541 | ||
542 | if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_NOESC)) | ||
543 | return; | ||
544 | |||
545 | atomic_clear_mask(ZFCP_STATUS_COMMON_NOESC, &port->status); | 545 | atomic_clear_mask(ZFCP_STATUS_COMMON_NOESC, &port->status); |
546 | 546 | ||
547 | if ((port->supported_classes != 0) || | 547 | if ((port->supported_classes != 0) || |
@@ -602,10 +602,8 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft, int max_entries) | |||
602 | if (acc->wwpn == fc_host_port_name(adapter->scsi_host)) | 602 | if (acc->wwpn == fc_host_port_name(adapter->scsi_host)) |
603 | continue; | 603 | continue; |
604 | port = zfcp_get_port_by_wwpn(adapter, acc->wwpn); | 604 | port = zfcp_get_port_by_wwpn(adapter, acc->wwpn); |
605 | if (port) { | 605 | if (port) |
606 | zfcp_port_get(port); | ||
607 | continue; | 606 | continue; |
608 | } | ||
609 | 607 | ||
610 | port = zfcp_port_enqueue(adapter, acc->wwpn, | 608 | port = zfcp_port_enqueue(adapter, acc->wwpn, |
611 | ZFCP_STATUS_COMMON_NOESC, d_id); | 609 | ZFCP_STATUS_COMMON_NOESC, d_id); |
@@ -637,7 +635,8 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter) | |||
637 | max_entries = chain ? ZFCP_GPN_FT_MAX_ENTRIES : ZFCP_GPN_FT_ENTRIES; | 635 | max_entries = chain ? ZFCP_GPN_FT_MAX_ENTRIES : ZFCP_GPN_FT_ENTRIES; |
638 | max_bytes = chain ? ZFCP_GPN_FT_MAX_SIZE : ZFCP_CT_SIZE_ONE_PAGE; | 636 | max_bytes = chain ? ZFCP_GPN_FT_MAX_SIZE : ZFCP_CT_SIZE_ONE_PAGE; |
639 | 637 | ||
640 | if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT) | 638 | if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT && |
639 | fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPIV) | ||
641 | return 0; | 640 | return 0; |
642 | 641 | ||
643 | ret = zfcp_wka_port_get(&adapter->nsp); | 642 | ret = zfcp_wka_port_get(&adapter->nsp); |