diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2006-05-17 18:09:06 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-05-20 10:41:56 -0400 |
commit | ffb39f0324b56bacaabac26133143cf861d0e9f9 (patch) | |
tree | 3c4f1fd64e5199565637ff40b01228d3ec82a2fd /drivers/scsi | |
parent | d1c61909c05ead100f855e640fba53925d0665ac (diff) |
[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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 1cf27fe92f4b..1289a18e7ad2 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -411,7 +411,6 @@ qla2x00_reset_chip(scsi_qla_host_t *ha) | |||
411 | unsigned long flags = 0; | 411 | unsigned long flags = 0; |
412 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; | 412 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; |
413 | uint32_t cnt; | 413 | uint32_t cnt; |
414 | unsigned long mbx_flags = 0; | ||
415 | uint16_t cmd; | 414 | uint16_t cmd; |
416 | 415 | ||
417 | ha->isp_ops.disable_intrs(ha); | 416 | ha->isp_ops.disable_intrs(ha); |
@@ -519,20 +518,8 @@ qla2x00_reset_chip(scsi_qla_host_t *ha) | |||
519 | 518 | ||
520 | if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) { | 519 | if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) { |
521 | for (cnt = 0; cnt < 30000; cnt++) { | 520 | for (cnt = 0; cnt < 30000; cnt++) { |
522 | if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) | 521 | if (RD_MAILBOX_REG(ha, reg, 0) != MBS_BUSY) |
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); | ||
530 | break; | 522 | break; |
531 | } | ||
532 | |||
533 | if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) | ||
534 | spin_unlock_irqrestore(&ha->mbx_reg_lock, | ||
535 | mbx_flags); | ||
536 | 523 | ||
537 | udelay(100); | 524 | udelay(100); |
538 | } | 525 | } |