mfd: rtsx: release IRQ during shutdown
Subsystems (3)
PATCH v2 1/1 mfd: rtsx: release IRQ during shutdown
'Commit cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")' revealed a resource leak in rtsx_pci driver during shutdown.
Issue shows up as a warning during shutdown as follows:
remove_proc_entry: removing non-empty directory 'irq/17', leaking at least 'rtsx_pci'
WARNING: CPU: 0 PID: 1578 at fs/proc/generic.c:572 remove_proc_entry+0x11d/0x130 Modules linked in <long list but none that are out-of-tree> ... Call Trace:
unregister_irq_procfree_descirq_free_descsmp_unmap_irqacpi_unregister_gsi_apicacpi_pci_irq_disabledo_pci_disable_devicepci_disable_devicedevice_shutdownkernel_restartSys_reboot
Even though rtsx_pci driver implements a shutdown callback, it is not releasing the interrupt that it registered during probe. This is causing the ACPI layer to complain that the shared IRQ is in use while freeing IRQ.
This code releases the IRQ to prevent resource leak and eliminate the warning.
--- drivers/mfd/rtsx_pcr.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mfd/rtsx_pcr.c +3 -0
@@ -1543,6 +1543,9 @@ static void rtsx_pci_shutdown(struct pci_dev *pcidev)rtsx_pci_power_off (pcr,HOST_ENTER_S1 );pci_disable_device (pcidev); +free_irq (pcr->irq, (void *)pcr); +if (pcr->msi_en) + pci_disable_msi(pcr->pci); }#else /* CONFIG_PM */
Signature · 1 line
1.9.1
Quoted 29 lines · Sinan Kaya
'Commit
cc27b735ad3a("PCI/portdrv: Turn off PCIe services during shutdown")' revealed a resource leak inrtsx_pcidriver during shutdown.Issue shows up as a warning during shutdown as follows:
remove_proc_entry: removing non-empty directory 'irq/17', leaking at least 'rtsx_pci'WARNING: CPU: 0 PID: 1578 at fs/proc/generic.c:572 remove_proc_entry+0x11d/0x130 Modules linked in <long list but none that are out-of-tree> ... Call Trace:
unregister_irq_procfree_descirq_free_descsmp_unmap_irqacpi_unregister_gsi_apicacpi_pci_irq_disabledo_pci_disable_devicepci_disable_devicedevice_shutdownkernel_restartSys_rebootEven though
rtsx_pcidriver implements a shutdown callback, it is not releasing the interrupt that it registered during probe. This is causing the ACPI layer to complain that the shared IRQ is in use while freeing IRQ.
Quoted 7 lines
This code releases the IRQ to prevent resource leak and eliminate the warning.
Reported-by Chris Clayton <[email protected]>Fixes cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")Signed-off-by Sinan Kaya <[email protected]>
Quoted 19 lines
--- drivers/mfd/rtsx_pcr.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mfd/rtsx_pcr.c +3
-1@@ -1543,6 +1543,9 @@ static void rtsx_pci_shutdown(struct pci_dev *pcidev)rtsx_pci_power_off (pcr,HOST_ENTER_S1 );pci_disable_device (pcidev); +free_irq (pcr->irq, (void *)pcr); +if (pcr->msi_en) + pci_disable_msi(pcr->pci); }#else /* CONFIG_PM */ --
Quoted 45 lines · Sinan Kaya
'Commit
cc27b735ad3a("PCI/portdrv: Turn off PCIe services during shutdown")' revealed a resource leak inrtsx_pcidriver during shutdown.Issue shows up as a warning during shutdown as follows:
remove_proc_entry: removing non-empty directory 'irq/17', leaking at least 'rtsx_pci'WARNING: CPU: 0 PID: 1578 at fs/proc/generic.c:572 remove_proc_entry+0x11d/0x130 Modules linked in <long list but none that are out-of-tree> ... Call Trace:
unregister_irq_procfree_descirq_free_descsmp_unmap_irqacpi_unregister_gsi_apicacpi_pci_irq_disabledo_pci_disable_devicepci_disable_devicedevice_shutdownkernel_restartSys_rebootEven though
rtsx_pcidriver implements a shutdown callback, it is not releasing the interrupt that it registered during probe. This is causing the ACPI layer to complain that the shared IRQ is in use while freeing IRQ.This code releases the IRQ to prevent resource leak and eliminate the warning.
Reported-by Chris Clayton <[email protected]>Fixes cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")Signed-off-by Sinan Kaya <[email protected]>--- drivers/mfd/rtsx_pcr.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mfd/rtsx_pcr.c +0
-0
drivers/mfd/rtsx_pcr.c static void rtsx_pci_shutdown(struct pci_dev *pcidev) · line 1551
Quoted 9 lines
drivers/mfd/rtsx_pcr.c +3
-0@@ -1543,6 +1543,9 @@ static void rtsx_pci_shutdown(struct pci_dev *pcidev)rtsx_pci_power_off (pcr,HOST_ENTER_S1 );pci_disable_device (pcidev); +free_irq (pcr->irq, (void *)pcr); +if (pcr->msi_en) + pci_disable_msi(pcr->pci); }#else /* CONFIG_PM */
I've applied v2 of the patch and built and installed the kernel (-rc6). All I can say, is that my system still closes down without the warning and call trace that the unpatched kernel produces. It's the best I can do by way of a test because I have no idea what the code added in v2 is supposed to achieve and, because my system shuts down (or reboots) moments later, there is no opportunity to check. If that constitutes a valid test:
Quoted 1 line
Lee Jones
AppliedQuoted 32 lines · Sinan Kaya
'Commit
cc27b735ad3a("PCI/portdrv: Turn off PCIe services during shutdown")' revealed a resource leak inrtsx_pcidriver during shutdown.Issue shows up as a warning during shutdown as follows:
remove_proc_entry: removing non-empty directory 'irq/17', leaking at least 'rtsx_pci'WARNING: CPU: 0 PID: 1578 at fs/proc/generic.c:572 remove_proc_entry+0x11d/0x130 Modules linked in <long list but none that are out-of-tree> ... Call Trace:
unregister_irq_procfree_descirq_free_descsmp_unmap_irqacpi_unregister_gsi_apicacpi_pci_irq_disabledo_pci_disable_devicepci_disable_devicedevice_shutdownkernel_restartSys_rebootEven though
rtsx_pcidriver implements a shutdown callback, it is not releasing the interrupt that it registered during probe. This is causing the ACPI layer to complain that the shared IRQ is in use while freeing IRQ.This code releases the IRQ to prevent resource leak and eliminate the warning.
Quoted 7 lines
Reported-by Chris Clayton <[email protected]>Fixes cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")Signed-off-by Sinan Kaya <[email protected]>--- drivers/mfd/rtsx_pcr.c | 3 +++ 1 file changed, 3 insertions(+)
Applied, thanks.
Signature · 4 lines
Lee Jones Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog