lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAErSpo6EsVyvZ3Wm8n3zVMRpyzMowYBiAhPRe45b4xq_yOiFKA@mail.gmail.com>
Date:	Fri, 1 Nov 2013 07:53:28 -0600
From:	Bjorn Helgaas <bhelgaas@...gle.com>
To:	"LF.Tan" <lftan.linux@...il.com>
Cc:	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: 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@...il.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@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ