aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_mbx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index c4e036b449c2..1003e48d2200 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -39,6 +39,15 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
39 "pointer\n", ha->host_no, __func__)); 39 "pointer\n", ha->host_no, __func__));
40 return status; 40 return status;
41 } 41 }
42
43 if (is_qla8022(ha) &&
44 test_bit(AF_FW_RECOVERY, &ha->flags)) {
45 DEBUG2(ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: prematurely "
46 "completing mbx cmd as firmware recovery detected\n",
47 ha->host_no, __func__));
48 return status;
49 }
50
42 /* Mailbox code active */ 51 /* Mailbox code active */
43 wait_count = MBOX_TOV * 100; 52 wait_count = MBOX_TOV * 100;
44 53
@@ -196,6 +205,14 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
196 205
197 /* Check for mailbox timeout. */ 206 /* Check for mailbox timeout. */
198 if (!test_bit(AF_MBOX_COMMAND_DONE, &ha->flags)) { 207 if (!test_bit(AF_MBOX_COMMAND_DONE, &ha->flags)) {
208 if (is_qla8022(ha) &&
209 test_bit(AF_FW_RECOVERY, &ha->flags)) {
210 DEBUG2(ql4_printk(KERN_INFO, ha,
211 "scsi%ld: %s: prematurely completing mbx cmd as "
212 "firmware recovery detected\n",
213 ha->host_no, __func__));
214 goto mbox_exit;
215 }
199 DEBUG2(printk("scsi%ld: Mailbox Cmd 0x%08X timed out ...," 216 DEBUG2(printk("scsi%ld: Mailbox Cmd 0x%08X timed out ...,"
200 " Scheduling Adapter Reset\n", ha->host_no, 217 " Scheduling Adapter Reset\n", ha->host_no,
201 mbx_cmd[0])); 218 mbx_cmd[0]));
@@ -246,6 +263,28 @@ mbox_exit:
246 return status; 263 return status;
247} 264}
248 265
266void qla4xxx_mailbox_premature_completion(struct scsi_qla_host *ha)
267{
268 set_bit(AF_FW_RECOVERY, &ha->flags);
269 ql4_printk(KERN_INFO, ha, "scsi%ld: %s: set FW RECOVERY!\n",
270 ha->host_no, __func__);
271
272 if (test_bit(AF_MBOX_COMMAND, &ha->flags)) {
273 if (test_bit(AF_MBOX_COMMAND_NOPOLL, &ha->flags)) {
274 complete(&ha->mbx_intr_comp);
275 ql4_printk(KERN_INFO, ha, "scsi%ld: %s: Due to fw "
276 "recovery, doing premature completion of "
277 "mbx cmd\n", ha->host_no, __func__);
278
279 } else {
280 set_bit(AF_MBOX_COMMAND_DONE, &ha->flags);
281 ql4_printk(KERN_INFO, ha, "scsi%ld: %s: Due to fw "
282 "recovery, doing premature completion of "
283 "polling mbx cmd\n", ha->host_no, __func__);
284 }
285 }
286}
287
249static uint8_t 288static uint8_t
250qla4xxx_set_ifcb(struct scsi_qla_host *ha, uint32_t *mbox_cmd, 289qla4xxx_set_ifcb(struct scsi_qla_host *ha, uint32_t *mbox_cmd,
251 uint32_t *mbox_sts, dma_addr_t init_fw_cb_dma) 290 uint32_t *mbox_sts, dma_addr_t init_fw_cb_dma)