lkml.org 
[lkml]   [2013]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: BUG_ON(irq_has_action(entry->irq + i)) in free_msi_irqs()
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


\
 
 \ /
  Last update: 2013-11-01 16:01    [W:0.097 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site