Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pseries: Use irq_has_action() in eeh_disable_irq()

Rather than open-coding our own check, use irq_has_action()
to check if an irq has an action - ie. is "in use".

irq_has_action() doesn't take the descriptor lock, but it
shouldn't matter - we're just using it as an indicator
that the irq is in use. disable_irq_nosync() will take
the descriptor lock before doing anything also.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Michael Ellerman and committed by
Benjamin Herrenschmidt
59e3f837 551b81f2

+1 -17
+1 -17
arch/powerpc/platforms/pseries/eeh_driver.c
··· 63 63 } 64 64 #endif 65 65 66 - /** 67 - * irq_in_use - return true if this irq is being used 68 - */ 69 - static int irq_in_use(unsigned int irq) 70 - { 71 - int rc = 0; 72 - unsigned long flags; 73 - struct irq_desc *desc = irq_desc + irq; 74 - 75 - spin_lock_irqsave(&desc->lock, flags); 76 - if (desc->action) 77 - rc = 1; 78 - spin_unlock_irqrestore(&desc->lock, flags); 79 - return rc; 80 - } 81 - 82 66 /** 83 67 * eeh_disable_irq - disable interrupt for the recovering device 84 68 */ ··· 77 93 if (dev->msi_enabled || dev->msix_enabled) 78 94 return; 79 95 80 - if (!irq_in_use(dev->irq)) 96 + if (!irq_has_action(dev->irq)) 81 97 return; 82 98 83 99 PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED;