Re: [PATCH] PCI: mvebu: Dispose INTx irqs prior to removing INTx domain

From: Jianjun Wang
Date: Mon Aug 08 2022 - 21:27:21 EST


Hi Pali,

On Sun, 2022-07-10 at 02:14 +0200, Pali Rohár wrote:
> On Saturday 09 July 2022 18:18:58 Pali Rohár wrote:
> > Documentation for irq_domain_remove() says that all mapping within
> > the
> > domain must be disposed prior to domain remove.
> >
> > Currently INTx irqs are not disposed in pci-mvebu.c device unbind
> > callback
> > which cause that kernel crashes after unloading driver and trying
> > to read
> > /sys/kernel/debug/irq/irqs/<num> or /proc/interrupts.
> >
> > Fixes: ec075262648f ("PCI: mvebu: Implement support for legacy INTx
> > interrupts")
> > Reported-by: Hajo Noerenberg <hajo-linux-bugzilla@xxxxxxxxxxxxx>
> > Signed-off-by: Pali Rohár <pali@xxxxxxxxxx>
>
> Just to note, Hajo Noerenberg observed this issue during testing and
> debugging other unrelated issue in bugzilla [1] and triggered this
> crash
> just by calling: rmmod pci_mvebu && modprobe pci-mvebu && cat
> /proc/interrupts
>
> I suppose that other pci controller drivers with unbind / rmmod
> support
> would suffer from same issues.

FYI, we found the same issue after unloading the PCIe controller
driver, if this is the proper way to dispose the INTx irqs, I'll send a
similar patch for MediaTek's PCIe controller driver.

Thanks.