Skip to content

Commit

Permalink
powerpc/pseries: Use irq_has_action() in eeh_disable_irq()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Grant Likely <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
mpe authored and ozbenh committed Oct 30, 2009
1 parent 551b81f commit 59e3f83
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions arch/powerpc/platforms/pseries/eeh_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,6 @@ static void print_device_node_tree(struct pci_dn *pdn, int dent)
}
#endif

/**
* irq_in_use - return true if this irq is being used
*/
static int irq_in_use(unsigned int irq)
{
int rc = 0;
unsigned long flags;
struct irq_desc *desc = irq_desc + irq;

spin_lock_irqsave(&desc->lock, flags);
if (desc->action)
rc = 1;
spin_unlock_irqrestore(&desc->lock, flags);
return rc;
}

/**
* eeh_disable_irq - disable interrupt for the recovering device
*/
Expand All @@ -93,7 +77,7 @@ static void eeh_disable_irq(struct pci_dev *dev)
if (dev->msi_enabled || dev->msix_enabled)
return;

if (!irq_in_use(dev->irq))
if (!irq_has_action(dev->irq))
return;

PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED;
Expand Down

0 comments on commit 59e3f83

Please sign in to comment.