Re: [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: Ben Hutchings <hidden>
Date: 2010-07-11 03:12:39
From: Ben Hutchings <hidden>
Date: 2010-07-11 03:12:39
On Sat, 2010-07-10 at 19:49 -0700, David Miller wrote:
From: Ben Hutchings <redacted> Date: Sun, 11 Jul 2010 03:46:28 +0100quoted
On Sat, 2010-07-10 at 20:18 +0900, Ken Kawasaki wrote:quoted
axnet_cs: use spin_lock_irqsave instead of spin_lock in ax_interrupt[...] I assume this is because it's now called from ei_watchdog() and not only from interrupt context. Perhaps you should explain that in the commit message.No, interrupt handlers in general may not assume that interrupts are off or on when they are invoked. Therefore they must use irqflags saving/restoring.
But an interrupt handler will not be called recursively for the same IRQ. Since this device only uses one IRQ, surely it was OK to use spin_lock() in this function so long as it was only called from the interrupt handler. Ben. -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.