aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mid.c
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 08:42:58 -0700
commitded6411fd88267510dcee6d6c29cfd0bd82d4f0e (patch)
tree3dd1aa9a733cdb0d71bbd2bce5b20d95275d7e4b /drivers/scsi/qla2xxx/qla_mid.c
parentqla2xxx: Prevent multiple firmware dump collection for ISP27XX. (diff)
downloadlinux-dev-ded6411fd88267510dcee6d6c29cfd0bd82d4f0e.tar.xz
linux-dev-ded6411fd88267510dcee6d6c29cfd0bd82d4f0e.zip
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>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mid.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c22
1 files changed, 14 insertions, 8 deletions
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)
static int
qla2x00_do_dpc_vp(scsi_qla_host_t *vha)
{
+ struct qla_hw_data *ha = vha->hw;
+ scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
+
ql_dbg(ql_dbg_dpc + ql_dbg_verbose, vha, 0x4012,
"Entering %s vp_flags: 0x%lx.\n", __func__, vha->vp_flags);
qla2x00_do_work(vha);
- if (test_and_clear_bit(VP_IDX_ACQUIRED, &vha->vp_flags)) {
- /* VP acquired. complete port configuration */
- ql_dbg(ql_dbg_dpc, vha, 0x4014,
- "Configure VP scheduled.\n");
- qla24xx_configure_vp(vha);
- ql_dbg(ql_dbg_dpc, vha, 0x4015,
- "Configure VP end.\n");
- return 0;
+ /* Check if Fw is ready to configure VP first */
+ if (test_bit(VP_CONFIG_OK, &base_vha->vp_flags)) {
+ if (test_and_clear_bit(VP_IDX_ACQUIRED, &vha->vp_flags)) {
+ /* VP acquired. complete port configuration */
+ ql_dbg(ql_dbg_dpc, vha, 0x4014,
+ "Configure VP scheduled.\n");
+ qla24xx_configure_vp(vha);
+ ql_dbg(ql_dbg_dpc, vha, 0x4015,
+ "Configure VP end.\n");
+ return 0;
+ }
}
if (test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags)) {