-
由 Andrew Vasquez 提交于
Matthew Wilcox <matthew@wil.cx> reported the following lockdep warning: > ================================= > [INFO:inconsistentlockstate] > 2.6.26-rc1-00115-g0340eda-dirty#60 > --------------------------------- > inconsistent{hardirq-on-W}->{in-hardirq-W}usage. > swapper/1[HC1[1]:SC0[0]:HE0:SE1]takes: > (&ha->hardware_lock){+-..},at:[<c035495d>]qla2300_intr_handler+0x35/0x1f5 > {hardirq-on-W}statewasregisteredat: > [<c0139a16>]__lock_acquire+0x459/0xb1d > [<c013a091>]__lock_acquire+0xad4/0xb1d > [<c013a142>]lock_acquire+0x68/0x82 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5 > [<c0506da5>]_spin_lock+0x24/0x4d > [<c035495d>]qla2300_intr_handler+0x35/0x1f5 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5 > [<c01391e4>]trace_hardirqs_on+0xe7/0x10e > [<c034f0a6>]qla2x00_mailbox_command+0x1c6/0x433 ... > other info that might help us debug this: > no locks held by swapper/1. > > stack backtrace: > Pid:1,comm:swapperNottainted2.6.26-rc1-00115-g0340eda-dirty#60 > [<c0138121>]print_usage_bug+0x100/0x10a > [<c0138d37>]mark_lock+0xaa/0x395 > [<c01399af>]__lock_acquire+0x3f2/0xb1d > [<c013a091>]__lock_acquire+0xad4/0xb1d > [<c013a142>]lock_acquire+0x68/0x82 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5 > [<c0506da5>]_spin_lock+0x24/0x4d > [<c035495d>]qla2300_intr_handler+0x35/0x1f5 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5 > [<c014a37b>]handle_IRQ_event+0x13/0x3d > [<c014b366>]handle_fasteoi_irq+0x76/0xab Which shows that lockdep is detecting the driver's interrupt-handler is run in both process and interrupt context with irqs-enabled in the former case. During init-time and error-recovery (after a RISC reset), the driver disables interrupts and 'polls' for completions by calling qla2x00_poll(): static inline void qla2x00_poll(scsi_qla_host_t *ha) { ha->isp_ops->intr_handler(0, ha); } which in-turn calls the ISP registered interrupt handler. This patch corrects it by disabling local interrupts during polling. Reviewed-by: NMatthew Wilcox <willy@linux.intel.com> Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
d2ba5675