diff mbox series

[10/13] qla2xxx: Restore FAWWPN of Physical Port only for loop down

Message ID 20190125072351.3504-11-hmadhani@marvell.com (mailing list archive)
State Mainlined
Commit dcbf8f8087ebc4d721fd55c4c2072f1a97f6ef6d
Headers show
Series qla2xxx: Driver updates and bug fixes | expand

Commit Message

Himanshu Madhani Jan. 25, 2019, 7:23 a.m. UTC
From: Sawan Chandak <schandak@marvell.com>

When loop was made down explicitly due to cable pull, then for N2N
toplogy, if FAWWPN BIT is enabled by user, then it would restore some
default(garbage) value for Physical port WWPN, so this show garbage
WWPN for the port. Fix is, to restore phsical port WWPN, if it is fabric
configuration. When loop is explicitly made down, and FAWWPN feature is
enabled, then driver need to restore original flashed WWPN.

Signed-off-by: Sawan Chandak <schandak@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_isr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 8507c43b918c..ed4d1d8f4d1b 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -834,7 +834,8 @@  qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
 			 * Restore for Physical Port only
 			 */
 			if (!vha->vp_idx) {
-				if (ha->flags.fawwpn_enabled) {
+				if (ha->flags.fawwpn_enabled &&
+				    (ha->current_topology == ISP_CFG_F)) {
 					void *wwpn = ha->init_cb->port_name;
 					memcpy(vha->port_name, wwpn, WWN_SIZE);
 					fc_host_port_name(vha->host) =