linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG_ON(irq_has_action(entry->irq + i)) in free_msi_irqs()
@ 2013-10-30  2:44 LF.Tan
  2013-11-01 13:53 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: LF.Tan @ 2013-10-30  2:44 UTC (permalink / raw)
  To: linux-pci, linux-kernel

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)
                        continue;
                nvec = 1 << entry->msi_attrib.multiple;
#ifdef CONFIG_GENERIC_HARDIRQS
                for (i = 0; i < nvec; i++)
                        BUG_ON(irq_has_action(entry->irq + i));
#endif
        }
        .....................
}


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



Regards
LF Tan

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BUG_ON(irq_has_action(entry->irq + i)) in free_msi_irqs()
  2013-10-30  2:44 BUG_ON(irq_has_action(entry->irq + i)) in free_msi_irqs() LF.Tan
@ 2013-11-01 13:53 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2013-11-01 13:53 UTC (permalink / raw)
  To: LF.Tan; +Cc: linux-pci, linux-kernel

On Tue, Oct 29, 2013 at 8:44 PM, LF.Tan <lftan.linux@gmail.com> wrote:
> 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.

The easiest way is probably to compare your driver with some of the
many drivers in the tree and see what's different in the way your
driver manages MSI.

Bjorn

> 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)
>                         continue;
>                 nvec = 1 << entry->msi_attrib.multiple;
> #ifdef CONFIG_GENERIC_HARDIRQS
>                 for (i = 0; i < nvec; i++)
>                         BUG_ON(irq_has_action(entry->irq + i));
> #endif
>         }
>         .....................
> }
>
>
> static inline int irq_has_action(unsigned int irq)
> {
>          struct irq_desc *desc = irq_to_desc(irq);
>         return desc->action != NULL;
> }
>
>
>
> Regards
> LF Tan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-01 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-30  2:44 BUG_ON(irq_has_action(entry->irq + i)) in free_msi_irqs() LF.Tan
2013-11-01 13:53 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).