I have an IRQ which is using handle_level_irq()
. Most of the time, the ISR requires that a bottom half be scheduled, but occasionally, it is able to determine it is spurious, and does not want to schedule a bottom half (for performance reasons). The problem is, in the latter case, there is a race condition. If the ISR determines it is spurious, it will unmask the interrupt and prepare to exit (note -- the ISR is not protected by desc->lock
at this point). But then, the interrupt is triggered on the second CPU, which, according to handle_level_irq()
, grabs desc->lock
, masks the IRQ, determines the ISR is in progress on the first CPU, so it unlocks desc->lock
and exits. The original ISR on the first CPU would also then exit, leaving the interrupt masked for all time.
I'd like to be able to NOT schedule the bottom half unless I need to, so is there some way for the ISR to unmask itself while avoiding the above race condition?