On Wed, Jun 19, 2024 at 04:28:29PM +0200, Marek Behún wrote: > From: Pali Rohár <pali@xxxxxxxxxx> > > 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. I was wondering why this is safe. Are there still users? If the users are being removed first, why are there still mappings. This is discussed in the old thread: > I think that in this case for pci-mvebu.c it is safe because: At the > first step of unbind procedure is called unregistraction of PCIe bus > with all devices bound on it. This ensures that all PCIe endpoint > drivers are unbind, devices removed and no new driver or device and > appear. After that there should not be any remaining usage of PCIe > resources (if there is then whole PCIe hotplug code is broken and we > have other and bigger issue...). Next pci-mvebu.c manually disposes > all remaining legacy interrupts (which PCI core code does not > because legacy interrupts are shared and it does not know if they > are used or not). This is safe because at these stage there are no > PCI drivers bound, there is no PCI device for that controller > registered. And after that is removed IRQ domain (which has finally > disposed all interrupts). If there is a need to respin, it would be good to include this in the commit message. Andrew