linux-stable/drivers/thermal/intel/int340x_thermal
Srinivas Pandruvada b630a04121 thermal: intel: int340x: Fix kernel warning during MSI cleanup
On some pre-production Lunar Lake systems, there is a kernel
warning:

remove_proc_entry: removing non-empty directory 'irq/172'
WARNING: CPU: 0 PID: 501 at fs/proc/generic.c:717
	remove_proc_entry+0x1b4/0x1e0
...
...
remove_proc_entry+0x1b4/0x1e0
report_bug+0x182/0x1b0
handle_bug+0x51/0xa0
exc_invalid_op+0x18/0x80
asm_exc_invalid_op+0x1b/0x20
remove_proc_entry+0x1b4/0x1e0
remove_proc_entry+0x1b4/0x1e0
unregister_irq_proc+0xf2/0x120
free_desc+0x41/0xe0
irq_domain_free_irqs+0x138/0x1c0
irq_free_descs+0x52/0x80
irq_domain_free_irqs+0x151/0x1c0
msi_domain_free_locked.part.0+0x17e/0x1c0
msi_domain_free_irqs_all_locked+0x74/0xc0
pci_msi_teardown_msi_irqs+0x50/0x60
pci_free_msi_irqs+0x12/0x40
pci_free_irq_vectors+0x58/0x70

On these systems, not all the MSI thermal vectors are valid. This causes
devm_request_threaded_irq() to fail for some vectors. As part of the
clean up on this error, pci_free_irq_vectors() is called without calling
devm_free_irq(). This causes the above warning.

Add a function proc_thermal_free_msi() to call devm_free_irq() for all
successfully registered IRQ handlers, then call pci_free_irq_vectors().
Call this function for MSI cleanup.

Fixes: 7a9a8c5faf ("thermal: intel: int340x: Support MSI interrupt for Lunar Lake")
Reported-by: Yijun Shen <Yijun.shen@dell.com>
Tested-by: Yijun Shen <Yijun.shen@dell.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Link: https://patch.msgid.link/20240723140228.865919-2-srinivas.pandruvada@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-07-30 16:36:39 +02:00
..
acpi_thermal_rel.c thermal: intel: int340x_thermal: replace deprecated strncpy() with strscpy() 2024-03-27 14:57:44 +01:00
acpi_thermal_rel.h thermal: intel: int340x_thermal: New IOCTLs for Passive v2 table 2023-06-13 17:57:39 +02:00
int340x_thermal_zone.c thermal: trip: Pass trip pointer to .set_trip_temp() thermal zone callback 2024-07-12 15:14:01 +02:00
int340x_thermal_zone.h thermal: intel: Adjust ops handling during thermal zone registration 2024-02-23 18:24:48 +01:00
int3400_thermal.c thermal: int3400: Use sizeof(*pointer) instead of sizeof(type) 2024-06-07 20:59:33 +02:00
int3401_thermal.c thermal: int3401: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
int3402_thermal.c thermal: int3402: Convert to platform remove callback returning void 2023-09-29 12:34:16 +02:00
int3403_thermal.c thermal: int3403: remove unused struct 'int3403_performance_state' 2024-06-07 21:22:02 +02:00
int3406_thermal.c thermal: int3406: Convert to platform remove callback returning void 2023-09-29 12:34:17 +02:00
Kconfig thermal: ACPI: Move the ACPI thermal library to drivers/acpi/ 2023-11-21 15:04:08 +01:00
Makefile thermal: int340x: processor_thermal: Support power floor notifications 2023-10-12 21:09:48 +02:00
processor_thermal_device_pci_legacy.c thermal: int340x: processor_thermal: Move mailbox code to common module 2023-09-14 21:52:19 +02:00
processor_thermal_device_pci.c thermal: intel: int340x: Fix kernel warning during MSI cleanup 2024-07-30 16:36:39 +02:00
processor_thermal_device.c thermal: intel: int340x: Cleanup of DLVR sysfs on driver remove 2024-06-21 15:20:28 +02:00
processor_thermal_device.h thermal: intel: int340x: Support MSI interrupt for Lunar Lake 2024-06-21 15:20:32 +02:00
processor_thermal_mbox.c thermal: intel: Add missing module description 2024-05-02 12:51:48 +02:00
processor_thermal_power_floor.c thermal: intel: Add missing module description 2024-05-02 12:51:48 +02:00
processor_thermal_rapl.c thermal: intel: Add missing module description 2024-05-02 12:51:48 +02:00
processor_thermal_rfim.c thermal: intel: int340x: Add DLVR support for Lunar Lake 2024-06-21 15:20:28 +02:00
processor_thermal_wt_hint.c thermal: intel: Add missing module description 2024-05-02 12:51:48 +02:00
processor_thermal_wt_req.c thermal: intel: Add missing module description 2024-05-02 12:51:48 +02:00