misc: rtsx: release IRQ during shutdown
Subsystems (3)
PATCH 1/1 misc: 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 the shutdown step 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 | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/rtsx_pcr.c +1 -0
@@ -1543,6 +1543,7 @@ 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); }#else /* CONFIG_PM */
Signature · 1 line
1.9.1
Rafael J. Wysocki
maintainerQuoted 46 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 the shutdown step 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")Tested-by Chris Clayton <[email protected]>Signed-off-by Sinan Kaya <[email protected]>--- drivers/mfd/rtsx_pcr.c | 1 + 1 file changed, 1 insertion(+)drivers/mfd/rtsx_pcr.c +0
-0
drivers/mfd/rtsx_pcr.c static void rtsx_pci_shutdown(struct pci_dev *pcidev) · line 1546
Quoted 4 lines
drivers/mfd/rtsx_pcr.c +1
-0@@ -1543,6 +1543,7 @@ 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);
Do you need to disable MSI here too?
Quoted 4 lines
drivers/mfd/rtsx_pcr.c +0
-1}#else /* CONFIG_PM */ --
Quoted 4 lines · Rafael J. Wysocki
Quoted 2 lines
pci_disable_device(pcidev);
+free_irq(pcr->irq, (void *)pcr);Do you need to disable MSI here too?
Makes sense. I'll post V2 in a minute.
Signature · 3 lines
Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.