aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSawan Chandak <sawan.chandak@qlogic.com>2015-04-09 15:00:07 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-04-10 11:43:07 -0400
commit718abbdca79f8ad87b359cc2cbcc4b1cb3aa6759 (patch)
tree5ba56340118c25e01ef49486bedf649db1fdfcdd /drivers/scsi
parentded6411fd88267510dcee6d6c29cfd0bd82d4f0e (diff)
qla2xxx: Restore physical port WWPN only, when port down detected for FA-WWPN port.
For FA-WWPN is enabled port, if NPIV created on that port and, if port link is brought down, then WWPN was restored from flash for both physical and NPIV port. This will result in NPIV port and physical port sharing same WWPN. Any application refreshing ports information will not be able to scan NPIV port because of this behavior. So while restoring WWPN, only restore physical port WWPN. Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 72dfbc162856..6dc14cd782b2 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -756,14 +756,23 @@ skip_rio:
756 /* 756 /*
757 * In case of loop down, restore WWPN from 757 * In case of loop down, restore WWPN from
758 * NVRAM in case of FA-WWPN capable ISP 758 * NVRAM in case of FA-WWPN capable ISP
759 * Restore for Physical Port only
759 */ 760 */
760 if (ha->flags.fawwpn_enabled) { 761 if (!vha->vp_idx) {
761 void *wwpn = ha->init_cb->port_name; 762 if (ha->flags.fawwpn_enabled) {
763 void *wwpn = ha->init_cb->port_name;
764 memcpy(vha->port_name, wwpn, WWN_SIZE);
765 fc_host_port_name(vha->host) =
766 wwn_to_u64(vha->port_name);
767 ql_dbg(ql_dbg_init + ql_dbg_verbose,
768 vha, 0x0144, "LOOP DOWN detected,"
769 "restore WWPN %016llx\n",
770 wwn_to_u64(vha->port_name));
771 }
762 772
763 memcpy(vha->port_name, wwpn, WWN_SIZE); 773 clear_bit(VP_CONFIG_OK, &vha->vp_flags);
764 } 774 }
765 775
766 clear_bit(VP_CONFIG_OK, &vha->vp_flags);
767 vha->device_flags |= DFLG_NO_CABLE; 776 vha->device_flags |= DFLG_NO_CABLE;
768 qla2x00_mark_all_devices_lost(vha, 1); 777 qla2x00_mark_all_devices_lost(vha, 1);
769 } 778 }