+++ /dev/null
-From: Gerald Schaefer <geraldsc@de.ibm.com>
-Subject: zfcp: Only issue one test link command per port
-References: bnc#529188,LTC#55337
-
-Symptom: During error recovery, the SAN trace shows a long series
- of els adisc commands being issued to the same remote port.
-Problem: When the FCP channel returns a series of failed commands,
- a els adisc test link command is issued for each failed
- command.
-Solution: Introduce a flag to ensure only one els adisc is pending
- at one time. This is enough to trigger follow-on actions.
-
-Acked-by: John Jolly <jjolly@suse.de>
----
- drivers/s390/scsi/zfcp_def.h | 1 +
- drivers/s390/scsi/zfcp_fc.c | 9 +++++++++
- 2 files changed, 10 insertions(+)
-
---- a/drivers/s390/scsi/zfcp_def.h 2009-07-16 12:20:57.000000000 +0200
-+++ b/drivers/s390/scsi/zfcp_def.h 2009-07-16 12:22:20.000000000 +0200
-@@ -260,6 +260,7 @@ struct zfcp_ls_adisc {
- #define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004
- #define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
- #define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
-+#define ZFCP_STATUS_PORT_LINK_TEST 0x00000040
-
- /* well known address (WKA) port status*/
- enum zfcp_wka_status {
---- a/drivers/s390/scsi/zfcp_fc.c 2009-07-16 12:20:57.000000000 +0200
-+++ b/drivers/s390/scsi/zfcp_fc.c 2009-07-16 12:23:15.000000000 +0200
-@@ -389,6 +389,7 @@ static void zfcp_fc_adisc_handler(unsign
- zfcp_scsi_schedule_rport_register(port);
-
- out:
-+ atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
- zfcp_port_put(port);
- kfree(adisc);
- }
-@@ -435,13 +436,21 @@ void zfcp_fc_link_test_work(struct work_
- port->rport_task = RPORT_DEL;
- zfcp_scsi_rport_work(&port->rport_work);
-
-+ /* only issue one test command at one time per port */
-+ if (atomic_read(&port->status) & ZFCP_STATUS_PORT_LINK_TEST)
-+ goto out;
-+
-+ atomic_set_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
-+
- retval = zfcp_fc_adisc(port);
- if (retval == 0)
- return;
-
- /* send of ADISC was not possible */
-+ atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
- zfcp_erp_port_forced_reopen(port, 0, 65, NULL);
-
-+out:
- zfcp_port_put(port);
- }
-