Skip to content

Commit b85a2d3

Browse files
spandruvadarafaeljw
authored andcommitted
thermal: intel: int340x: Allow limited thermal MSI support
On some Lunar Lake pre-production systems, not all the MSI thermal vectors are valid. In that case instead of failing module load, continue with partial thermal interrupt support. pci_alloc_irq_vectors() can return less than expected maximum vectors. In that case call devm_request_threaded_irq() only for current maximum vectors. Fixes: 7a9a8c5 ("thermal: intel: int340x: Support MSI interrupt for Lunar Lake") Reported-by: Yijun Shen <[email protected]> Tested-by: Yijun Shen <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Reviewed-by: Zhang Rui <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b630a04 commit b85a2d3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,18 +292,18 @@ static void proc_thermal_free_msi(struct pci_dev *pdev, struct proc_thermal_pci
292292

293293
static int proc_thermal_setup_msi(struct pci_dev *pdev, struct proc_thermal_pci *pci_info)
294294
{
295-
int ret, i, irq;
295+
int ret, i, irq, count;
296296

297-
ret = pci_alloc_irq_vectors(pdev, 1, MSI_THERMAL_MAX, PCI_IRQ_MSI | PCI_IRQ_MSIX);
298-
if (ret < 0) {
297+
count = pci_alloc_irq_vectors(pdev, 1, MSI_THERMAL_MAX, PCI_IRQ_MSI | PCI_IRQ_MSIX);
298+
if (count < 0) {
299299
dev_err(&pdev->dev, "Failed to allocate vectors!\n");
300-
return ret;
300+
return count;
301301
}
302302

303303
dev_info(&pdev->dev, "msi enabled:%d msix enabled:%d\n", pdev->msi_enabled,
304304
pdev->msix_enabled);
305305

306-
for (i = 0; i < MSI_THERMAL_MAX; i++) {
306+
for (i = 0; i < count; i++) {
307307
irq = pci_irq_vector(pdev, i);
308308

309309
ret = devm_request_threaded_irq(&pdev->dev, irq, proc_thermal_irq_handler,

0 commit comments

Comments
 (0)