diff options
author | Poornima Vonti <poornima.vonti@qlogic.com> | 2012-09-20 07:35:04 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-24 04:36:39 -0400 |
commit | 8276190725aca00bcf8869493a5040d2eebbca31 (patch) | |
tree | 3aa7c8da0ba827daf5e2a3b354c1e87bcac67963 /drivers/scsi/qla4xxx | |
parent | fbd8107cc9a0e31b3b028da607157fd23561975b (diff) |
[SCSI] qla4xxx: Fix double IDC locking in qla4_8xxx_error_recovery
Issue:
In qla4_8xxx_error_recovery() IDC lock recovery is initiated as
IDC lock is held while enabling the interrupts
Fix:
Correctly handle IDC locking mechanism in qla4_8xxx_error_recovery().
Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index c1093eb16e2e..afaba52ff250 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -6140,22 +6140,25 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha) | |||
6140 | ha->isp_ops->idc_unlock(ha); | 6140 | ha->isp_ops->idc_unlock(ha); |
6141 | clear_bit(AF_FW_RECOVERY, &ha->flags); | 6141 | clear_bit(AF_FW_RECOVERY, &ha->flags); |
6142 | rval = qla4xxx_initialize_adapter(ha, RESET_ADAPTER); | 6142 | rval = qla4xxx_initialize_adapter(ha, RESET_ADAPTER); |
6143 | ha->isp_ops->idc_lock(ha); | ||
6144 | 6143 | ||
6145 | if (rval != QLA_SUCCESS) { | 6144 | if (rval != QLA_SUCCESS) { |
6146 | ql4_printk(KERN_INFO, ha, "scsi%ld: %s: HW State: " | 6145 | ql4_printk(KERN_INFO, ha, "scsi%ld: %s: HW State: " |
6147 | "FAILED\n", ha->host_no, __func__); | 6146 | "FAILED\n", ha->host_no, __func__); |
6147 | ha->isp_ops->idc_lock(ha); | ||
6148 | qla4_8xxx_clear_drv_active(ha); | 6148 | qla4_8xxx_clear_drv_active(ha); |
6149 | qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, | 6149 | qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, |
6150 | QLA8XXX_DEV_FAILED); | 6150 | QLA8XXX_DEV_FAILED); |
6151 | ha->isp_ops->idc_unlock(ha); | ||
6151 | } else { | 6152 | } else { |
6152 | ql4_printk(KERN_INFO, ha, "scsi%ld: %s: HW State: " | 6153 | ql4_printk(KERN_INFO, ha, "scsi%ld: %s: HW State: " |
6153 | "READY\n", ha->host_no, __func__); | 6154 | "READY\n", ha->host_no, __func__); |
6155 | ha->isp_ops->idc_lock(ha); | ||
6154 | qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, | 6156 | qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DEV_STATE, |
6155 | QLA8XXX_DEV_READY); | 6157 | QLA8XXX_DEV_READY); |
6156 | /* Clear driver state register */ | 6158 | /* Clear driver state register */ |
6157 | qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_STATE, 0); | 6159 | qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_STATE, 0); |
6158 | qla4_8xxx_set_drv_active(ha); | 6160 | qla4_8xxx_set_drv_active(ha); |
6161 | ha->isp_ops->idc_unlock(ha); | ||
6159 | ret = qla4xxx_request_irqs(ha); | 6162 | ret = qla4xxx_request_irqs(ha); |
6160 | if (ret) { | 6163 | if (ret) { |
6161 | ql4_printk(KERN_WARNING, ha, "Failed to " | 6164 | ql4_printk(KERN_WARNING, ha, "Failed to " |
@@ -6167,7 +6170,6 @@ static uint32_t qla4_8xxx_error_recovery(struct scsi_qla_host *ha) | |||
6167 | rval = QLA_SUCCESS; | 6170 | rval = QLA_SUCCESS; |
6168 | } | 6171 | } |
6169 | } | 6172 | } |
6170 | ha->isp_ops->idc_unlock(ha); | ||
6171 | } else { | 6173 | } else { |
6172 | ql4_printk(KERN_INFO, ha, "scsi%ld: %s: devfn 0x%x is not " | 6174 | ql4_printk(KERN_INFO, ha, "scsi%ld: %s: devfn 0x%x is not " |
6173 | "the reset owner\n", ha->host_no, __func__, | 6175 | "the reset owner\n", ha->host_no, __func__, |