BUG_ON(irq_has_action(entry->irq + i)) in free_msi_irqs()

From: LF.Tan
Date: Tue Oct 29 2013 - 22:44:39 EST

Hi all

I am new in PCI and now working on MSI support on our PCIe host
driver. I have an endpoint driver requests for a MSI interrupt. When
the endpoint driver try to free the interrupt, it cause the kernel
BUG_ON() message is printed out.

The software flow:
Endpoint driver --> pci_disable_msi -->free_msi_irqs -->
BUG_ON(irq_has_action(entry->irq + i));

I have checked desc->action in irq_has_action(), it is non-zero.
It is running on ARM platform. CONFIG_GENERIC_HARDIRQS is turn on by default.

Anyone how to fix this issue? Thanks.

static void free_msi_irqs(struct pci_dev *dev)
struct msi_desc *entry, *tmp;

list_for_each_entry(entry, &dev->msi_list, list) {
int i, nvec;

if (!entry->irq)
nvec = 1 << entry->msi_attrib.multiple;
for (i = 0; i < nvec; i++)
BUG_ON(irq_has_action(entry->irq + i));

static inline int irq_has_action(unsigned int irq)
struct irq_desc *desc = irq_to_desc(irq);
return desc->action != NULL;

LF Tan
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/