diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-03-02 07:08:54 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-12 13:58:18 -0400 |
commit | a5b11dda12ed7e3a79180b10ad6209a40a02989f (patch) | |
tree | 57196bdb6f2c48a5e6f12a5d1129b57c1e393c3f /drivers/s390 | |
parent | 77c019768f0607c36e25bec11ce3e1eabef09277 (diff) |
[SCSI] zfcp: Remove some port flags
PORT_PHYS_CLOSING is only set and cleared, but not actually used
for status checking.
PORT_INVALID_WWPN is set when the GID_PN request does not return
a d_id for a remote port, e.g. when a remote port has been
unplugged. For this case, the d_id is zero. In the erp we can
check the d_id and use the normal escalation procedure that gives
up after three retries and remove the special case.
PORT_NO_WWPN is unused: Each port in the remote port list has a
valid wwpn. The WKA ports are now tracked outside the port
list. Remove the PORT_NO_WWPN flag, since this is no longer set
for any port.
Acked-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 13 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 3 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 16 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 5 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 6 |
5 files changed, 11 insertions, 32 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 8af7dfbe022c..497986f6d643 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -249,8 +249,8 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter, | |||
249 | struct zfcp_port *port; | 249 | struct zfcp_port *port; |
250 | 250 | ||
251 | list_for_each_entry(port, &adapter->port_list_head, list) | 251 | list_for_each_entry(port, &adapter->port_list_head, list) |
252 | if ((port->wwpn == wwpn) && !(atomic_read(&port->status) & | 252 | if ((port->wwpn == wwpn) && |
253 | (ZFCP_STATUS_PORT_NO_WWPN | ZFCP_STATUS_COMMON_REMOVE))) | 253 | !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE)) |
254 | return port; | 254 | return port; |
255 | return NULL; | 255 | return NULL; |
256 | } | 256 | } |
@@ -620,11 +620,10 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, | |||
620 | dev_set_drvdata(&port->sysfs_device, port); | 620 | dev_set_drvdata(&port->sysfs_device, port); |
621 | 621 | ||
622 | read_lock_irq(&zfcp_data.config_lock); | 622 | read_lock_irq(&zfcp_data.config_lock); |
623 | if (!(status & ZFCP_STATUS_PORT_NO_WWPN)) | 623 | if (zfcp_get_port_by_wwpn(adapter, wwpn)) { |
624 | if (zfcp_get_port_by_wwpn(adapter, wwpn)) { | 624 | read_unlock_irq(&zfcp_data.config_lock); |
625 | read_unlock_irq(&zfcp_data.config_lock); | 625 | goto err_out_free; |
626 | goto err_out_free; | 626 | } |
627 | } | ||
628 | read_unlock_irq(&zfcp_data.config_lock); | 627 | read_unlock_irq(&zfcp_data.config_lock); |
629 | 628 | ||
630 | if (device_register(&port->sysfs_device)) | 629 | if (device_register(&port->sysfs_device)) |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 510662783a6f..62f9ee58c9b8 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -243,9 +243,6 @@ struct zfcp_ls_adisc { | |||
243 | 243 | ||
244 | /* remote port status */ | 244 | /* remote port status */ |
245 | #define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001 | 245 | #define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001 |
246 | #define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004 | ||
247 | #define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 | ||
248 | #define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 | ||
249 | 246 | ||
250 | /* well known address (WKA) port status*/ | 247 | /* well known address (WKA) port status*/ |
251 | enum zfcp_wka_status { | 248 | enum zfcp_wka_status { |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 387a3af528ac..aed08e70aa96 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -777,10 +777,7 @@ static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) | |||
777 | 777 | ||
778 | static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) | 778 | static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) |
779 | { | 779 | { |
780 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | | 780 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &port->status); |
781 | ZFCP_STATUS_PORT_PHYS_CLOSING | | ||
782 | ZFCP_STATUS_PORT_INVALID_WWPN, | ||
783 | &port->status); | ||
784 | } | 781 | } |
785 | 782 | ||
786 | static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) | 783 | static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) |
@@ -875,13 +872,8 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | |||
875 | return ZFCP_ERP_CONTINUES; | 872 | return ZFCP_ERP_CONTINUES; |
876 | } | 873 | } |
877 | case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: | 874 | case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: |
878 | if (!port->d_id) { | 875 | if (!port->d_id) |
879 | if (p_status & (ZFCP_STATUS_PORT_INVALID_WWPN)) { | ||
880 | zfcp_erp_port_failed(port, 26, NULL); | ||
881 | return ZFCP_ERP_EXIT; | ||
882 | } | ||
883 | return ZFCP_ERP_FAILED; | 876 | return ZFCP_ERP_FAILED; |
884 | } | ||
885 | return zfcp_erp_port_strategy_open_port(act); | 877 | return zfcp_erp_port_strategy_open_port(act); |
886 | 878 | ||
887 | case ZFCP_ERP_STEP_PORT_OPENING: | 879 | case ZFCP_ERP_STEP_PORT_OPENING: |
@@ -1269,10 +1261,6 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) | |||
1269 | 1261 | ||
1270 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 1262 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
1271 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 1263 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
1272 | if (atomic_read(&port->status) & ZFCP_STATUS_PORT_NO_WWPN) { | ||
1273 | zfcp_port_put(port); | ||
1274 | return; | ||
1275 | } | ||
1276 | if ((result == ZFCP_ERP_SUCCEEDED) && !port->rport) | 1264 | if ((result == ZFCP_ERP_SUCCEEDED) && !port->rport) |
1277 | zfcp_erp_rport_register(port); | 1265 | zfcp_erp_rport_register(port); |
1278 | if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) { | 1266 | if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) { |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index eabdfe24456e..67e6b7177870 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -259,10 +259,9 @@ static void zfcp_fc_ns_gid_pn_eval(unsigned long data) | |||
259 | 259 | ||
260 | if (ct->status) | 260 | if (ct->status) |
261 | return; | 261 | return; |
262 | if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT) { | 262 | if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT) |
263 | atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); | ||
264 | return; | 263 | return; |
265 | } | 264 | |
266 | /* paranoia */ | 265 | /* paranoia */ |
267 | if (ct_iu_req->wwpn != port->wwpn) | 266 | if (ct_iu_req->wwpn != port->wwpn) |
268 | return; | 267 | return; |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index babe1b8ba25e..638cd5a2919d 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -1712,7 +1712,7 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req) | |||
1712 | struct zfcp_unit *unit; | 1712 | struct zfcp_unit *unit; |
1713 | 1713 | ||
1714 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) | 1714 | if (req->status & ZFCP_STATUS_FSFREQ_ERROR) |
1715 | goto skip_fsfstatus; | 1715 | return; |
1716 | 1716 | ||
1717 | switch (header->fsf_status) { | 1717 | switch (header->fsf_status) { |
1718 | case FSF_PORT_HANDLE_NOT_VALID: | 1718 | case FSF_PORT_HANDLE_NOT_VALID: |
@@ -1752,8 +1752,6 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req) | |||
1752 | &unit->status); | 1752 | &unit->status); |
1753 | break; | 1753 | break; |
1754 | } | 1754 | } |
1755 | skip_fsfstatus: | ||
1756 | atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, &port->status); | ||
1757 | } | 1755 | } |
1758 | 1756 | ||
1759 | /** | 1757 | /** |
@@ -1789,8 +1787,6 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
1789 | req->erp_action = erp_action; | 1787 | req->erp_action = erp_action; |
1790 | req->handler = zfcp_fsf_close_physical_port_handler; | 1788 | req->handler = zfcp_fsf_close_physical_port_handler; |
1791 | erp_action->fsf_req = req; | 1789 | erp_action->fsf_req = req; |
1792 | atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, | ||
1793 | &erp_action->port->status); | ||
1794 | 1790 | ||
1795 | zfcp_fsf_start_erp_timer(req); | 1791 | zfcp_fsf_start_erp_timer(req); |
1796 | retval = zfcp_fsf_req_send(req); | 1792 | retval = zfcp_fsf_req_send(req); |