aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSawan Chandak <sawan.chandak@qlogic.com>2015-04-09 15:00:06 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-04-10 11:42:58 -0400
commitded6411fd88267510dcee6d6c29cfd0bd82d4f0e (patch)
tree3dd1aa9a733cdb0d71bbd2bce5b20d95275d7e4b
parente8fb1250ba5898c6c53e0063bbdcc9cadd580797 (diff)
qla2xxx: Fix virtual port configuration, when switch port is disabled/enabled.
On some vendor switches, when switch port is toggled (down /up), then in some condition driver tries to configure virtual port, before FW is actually in ready state to process any commands on wire. At this time, configuring virtual port can fail. Add fix in driver to make driver wait, for FW to be ready state before 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>
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c22
3 files changed, 17 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 9a8aa11cd15f..e86201d3b8c6 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -3590,6 +3590,7 @@ typedef struct scsi_qla_host {
3590#define VP_BIND_NEEDED 2 3590#define VP_BIND_NEEDED 2
3591#define VP_DELETE_NEEDED 3 3591#define VP_DELETE_NEEDED 3
3592#define VP_SCR_NEEDED 4 /* State Change Request registration */ 3592#define VP_SCR_NEEDED 4 /* State Change Request registration */
3593#define VP_CONFIG_OK 5 /* Flag to cfg VP, if FW is ready */
3593 atomic_t vp_state; 3594 atomic_t vp_state;
3594#define VP_OFFLINE 0 3595#define VP_OFFLINE 0
3595#define VP_ACTIVE 1 3596#define VP_ACTIVE 1
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index a04a1b1f7f32..72dfbc162856 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -763,6 +763,7 @@ skip_rio:
763 memcpy(vha->port_name, wwpn, WWN_SIZE); 763 memcpy(vha->port_name, wwpn, WWN_SIZE);
764 } 764 }
765 765
766 clear_bit(VP_CONFIG_OK, &vha->vp_flags);
766 vha->device_flags |= DFLG_NO_CABLE; 767 vha->device_flags |= DFLG_NO_CABLE;
767 qla2x00_mark_all_devices_lost(vha, 1); 768 qla2x00_mark_all_devices_lost(vha, 1);
768 } 769 }
@@ -947,6 +948,7 @@ skip_rio:
947 948
948 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); 949 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
949 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); 950 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
951 set_bit(VP_CONFIG_OK, &vha->vp_flags);
950 952
951 qlt_async_event(mb[0], vha, mb); 953 qlt_async_event(mb[0], vha, mb);
952 break; 954 break;
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 5c2e0317f1c0..8f458efc125a 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -306,19 +306,25 @@ qla2x00_vp_abort_isp(scsi_qla_host_t *vha)
306static int 306static int
307qla2x00_do_dpc_vp(scsi_qla_host_t *vha) 307qla2x00_do_dpc_vp(scsi_qla_host_t *vha)
308{ 308{
309 struct qla_hw_data *ha = vha->hw;
310 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
311
309 ql_dbg(ql_dbg_dpc + ql_dbg_verbose, vha, 0x4012, 312 ql_dbg(ql_dbg_dpc + ql_dbg_verbose, vha, 0x4012,
310 "Entering %s vp_flags: 0x%lx.\n", __func__, vha->vp_flags); 313 "Entering %s vp_flags: 0x%lx.\n", __func__, vha->vp_flags);
311 314
312 qla2x00_do_work(vha); 315 qla2x00_do_work(vha);
313 316
314 if (test_and_clear_bit(VP_IDX_ACQUIRED, &vha->vp_flags)) { 317 /* Check if Fw is ready to configure VP first */
315 /* VP acquired. complete port configuration */ 318 if (test_bit(VP_CONFIG_OK, &base_vha->vp_flags)) {
316 ql_dbg(ql_dbg_dpc, vha, 0x4014, 319 if (test_and_clear_bit(VP_IDX_ACQUIRED, &vha->vp_flags)) {
317 "Configure VP scheduled.\n"); 320 /* VP acquired. complete port configuration */
318 qla24xx_configure_vp(vha); 321 ql_dbg(ql_dbg_dpc, vha, 0x4014,
319 ql_dbg(ql_dbg_dpc, vha, 0x4015, 322 "Configure VP scheduled.\n");
320 "Configure VP end.\n"); 323 qla24xx_configure_vp(vha);
321 return 0; 324 ql_dbg(ql_dbg_dpc, vha, 0x4015,
325 "Configure VP end.\n");
326 return 0;
327 }
322 } 328 }
323 329
324 if (test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) { 330 if (test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) {