Skip to content

Commit

Permalink
Fix assertion failure with MSI on sparc64
Browse files Browse the repository at this point in the history
Today's find is a triggered assertion in msi_free_irqs() when the system
doesn't support MSI, in which case arch_setup_msi_irqs() always returns
an error.

The problem is that when this happens we branch into msi_free_irqs(), to
which you added the following assertion loop:

	list_for_each_entry(entry, &dev->msi_list, list)
		BUG_ON(irq_has_action(entry->irq));

Well, if arch_setup_msi_irqs() fails, entry->irq will be zero and
although that's never assigned to any normal devices we use that IRQ
number for the timer interrupt on sparc64 so this assertion triggers.

Better to test for zero before doing the irq_has_action() assertion
thing.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Miller authored and Linus Torvalds committed May 11, 2007
1 parent 0a3fd05 commit b3b7cc7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,10 @@ static int msi_free_irqs(struct pci_dev* dev)
{
struct msi_desc *entry, *tmp;

list_for_each_entry(entry, &dev->msi_list, list)
BUG_ON(irq_has_action(entry->irq));
list_for_each_entry(entry, &dev->msi_list, list) {
if (entry->irq)
BUG_ON(irq_has_action(entry->irq));
}

arch_teardown_msi_irqs(dev);

Expand Down

0 comments on commit b3b7cc7

Please sign in to comment.