提交 ffb39f03 编写于 作者: A Andrew Vasquez 提交者: James Bottomley

[SCSI] qla2xxx: ABBA lock ordering fix.

In qla2x00_reset_chip the driver first takes the hardware lock,
and then later on takes the mbx lock.

In the mailbox_command code.. it goes the other way around.

Discovered with the lock validator.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 d1c61909
...@@ -411,7 +411,6 @@ qla2x00_reset_chip(scsi_qla_host_t *ha) ...@@ -411,7 +411,6 @@ qla2x00_reset_chip(scsi_qla_host_t *ha)
unsigned long flags = 0; unsigned long flags = 0;
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
uint32_t cnt; uint32_t cnt;
unsigned long mbx_flags = 0;
uint16_t cmd; uint16_t cmd;
ha->isp_ops.disable_intrs(ha); ha->isp_ops.disable_intrs(ha);
...@@ -519,20 +518,8 @@ qla2x00_reset_chip(scsi_qla_host_t *ha) ...@@ -519,20 +518,8 @@ qla2x00_reset_chip(scsi_qla_host_t *ha)
if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) { if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) {
for (cnt = 0; cnt < 30000; cnt++) { for (cnt = 0; cnt < 30000; cnt++) {
if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) if (RD_MAILBOX_REG(ha, reg, 0) != MBS_BUSY)
spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
if (RD_MAILBOX_REG(ha, reg, 0) != MBS_BUSY) {
if (!(test_bit(ABORT_ISP_ACTIVE,
&ha->dpc_flags)))
spin_unlock_irqrestore(
&ha->mbx_reg_lock, mbx_flags);
break; break;
}
if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)))
spin_unlock_irqrestore(&ha->mbx_reg_lock,
mbx_flags);
udelay(100); udelay(100);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册