Skip to content

Commit ffb39f0

Browse files
avasquez01James Bottomley
authored andcommitted
[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: Andrew Morton <akpm@osdl.org> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1 parent d1c6190 commit ffb39f0

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ qla2x00_reset_chip(scsi_qla_host_t *ha)
411411
unsigned long flags = 0;
412412
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
413413
uint32_t cnt;
414-
unsigned long mbx_flags = 0;
415414
uint16_t cmd;
416415

417416
ha->isp_ops.disable_intrs(ha);
@@ -519,20 +518,8 @@ qla2x00_reset_chip(scsi_qla_host_t *ha)
519518

520519
if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) {
521520
for (cnt = 0; cnt < 30000; cnt++) {
522-
if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)))
523-
spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
524-
525-
if (RD_MAILBOX_REG(ha, reg, 0) != MBS_BUSY) {
526-
if (!(test_bit(ABORT_ISP_ACTIVE,
527-
&ha->dpc_flags)))
528-
spin_unlock_irqrestore(
529-
&ha->mbx_reg_lock, mbx_flags);
521+
if (RD_MAILBOX_REG(ha, reg, 0) != MBS_BUSY)
530522
break;
531-
}
532-
533-
if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)))
534-
spin_unlock_irqrestore(&ha->mbx_reg_lock,
535-
mbx_flags);
536523

537524
udelay(100);
538525
}

0 commit comments

Comments
 (0)