diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_mbx.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index f65626aec7c1..47b259190b5a 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c | |||
@@ -32,6 +32,7 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, | |||
32 | u_long wait_count; | 32 | u_long wait_count; |
33 | uint32_t intr_status; | 33 | uint32_t intr_status; |
34 | unsigned long flags = 0; | 34 | unsigned long flags = 0; |
35 | uint32_t dev_state; | ||
35 | 36 | ||
36 | /* Make sure that pointers are valid */ | 37 | /* Make sure that pointers are valid */ |
37 | if (!mbx_cmd || !mbx_sts) { | 38 | if (!mbx_cmd || !mbx_sts) { |
@@ -40,12 +41,23 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, | |||
40 | return status; | 41 | return status; |
41 | } | 42 | } |
42 | 43 | ||
43 | if (is_qla8022(ha) && | 44 | if (is_qla8022(ha)) { |
44 | test_bit(AF_FW_RECOVERY, &ha->flags)) { | 45 | if (test_bit(AF_FW_RECOVERY, &ha->flags)) { |
45 | DEBUG2(ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: prematurely " | 46 | DEBUG2(ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: " |
46 | "completing mbx cmd as firmware recovery detected\n", | 47 | "prematurely completing mbx cmd as firmware " |
47 | ha->host_no, __func__)); | 48 | "recovery detected\n", ha->host_no, __func__)); |
48 | return status; | 49 | return status; |
50 | } | ||
51 | /* Do not send any mbx cmd if h/w is in failed state*/ | ||
52 | qla4_8xxx_idc_lock(ha); | ||
53 | dev_state = qla4_8xxx_rd_32(ha, QLA82XX_CRB_DEV_STATE); | ||
54 | qla4_8xxx_idc_unlock(ha); | ||
55 | if (dev_state == QLA82XX_DEV_FAILED) { | ||
56 | ql4_printk(KERN_WARNING, ha, "scsi%ld: %s: H/W is in " | ||
57 | "failed state, do not send any mailbox commands\n", | ||
58 | ha->host_no, __func__); | ||
59 | return status; | ||
60 | } | ||
49 | } | 61 | } |
50 | 62 | ||
51 | if ((is_aer_supported(ha)) && | 63 | if ((is_aer_supported(ha)) && |