* [PATCH v2] thermal/drivers: Remove redundant error messages on IRQ request failure
@ 2026-07-17 2:47 Pan Chuang
2026-07-17 3:00 ` sashiko-bot
2026-07-17 7:37 ` Miquel Raynal
0 siblings, 2 replies; 3+ messages in thread
From: Pan Chuang @ 2026-07-17 2:47 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Miquel Raynal, Markus Mayer, Broadcom internal kernel review list,
Florian Fainelli, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
Magnus Damm, John Madieu, Heiko Stuebner,
Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Peter Griffin,
Alim Akhtar, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
Jonathan Hunter, Matthias Brugger, AngeloGioacchino Del Regno,
Srinivas Pandruvada, Andy Shevchenko, Pan Chuang, Laura Nao,
Fei Shao, Chen-Yu Tsai, Jiapeng Chong, Frank Wunderlich,
Mikko Perttunen, Svyatoslav Ryhel, open list:THERMAL, open list,
moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE,
open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/QUALCOMM MAILING LIST,
open list:RENESAS R-CAR THERMAL DRIVERS,
open list:ARM/Rockchip SoC support,
open list:SAMSUNG THERMAL DRIVER,
moderated list:ARM/STM32 ARCHITECTURE,
open list:TEGRA ARCHITECTURE SUPPORT,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek
Cc: Niklas S?derlund
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
automatically log detailed error messages on failure. Remove the
now-redundant driver-specific dev_err() and dev_err_probe() calls.
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas S?derlund <niklas.soderlund+renesas@ragnatech.se>
---
drivers/thermal/airoha_thermal.c | 4 +---
drivers/thermal/armada_thermal.c | 5 +----
drivers/thermal/broadcom/brcmstb_thermal.c | 3 +--
drivers/thermal/db8500_thermal.c | 8 ++------
drivers/thermal/hisi_thermal.c | 4 +---
drivers/thermal/imx91_thermal.c | 2 +-
drivers/thermal/imx_thermal.c | 4 +---
.../intel/int340x_thermal/processor_thermal_device_pci.c | 8 ++------
drivers/thermal/intel/intel_bxt_pmic_thermal.c | 4 +---
drivers/thermal/loongson2_thermal.c | 2 +-
drivers/thermal/max77620_thermal.c | 8 ++------
drivers/thermal/mediatek/lvts_thermal.c | 2 +-
drivers/thermal/qcom/lmh.c | 1 -
drivers/thermal/qcom/tsens.c | 5 +----
drivers/thermal/renesas/rcar_thermal.c | 4 +---
drivers/thermal/renesas/rzg3e_thermal.c | 4 +---
drivers/thermal/rockchip_thermal.c | 3 +--
drivers/thermal/samsung/exynos_tmu.c | 4 +---
drivers/thermal/st/st_thermal_memmap.c | 4 +---
drivers/thermal/st/stm_thermal.c | 5 +----
drivers/thermal/tegra/soctherm.c | 8 ++------
drivers/thermal/tegra/tegra30-tsensor.c | 3 +--
22 files changed, 25 insertions(+), 70 deletions(-)
diff --git a/drivers/thermal/airoha_thermal.c b/drivers/thermal/airoha_thermal.c
index b9fd6bfc88e5..b1c2bf28a90e 100644
--- a/drivers/thermal/airoha_thermal.c
+++ b/drivers/thermal/airoha_thermal.c
@@ -444,10 +444,8 @@ static int airoha_thermal_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
airoha_thermal_irq, IRQF_ONESHOT,
pdev->name, priv);
- if (ret) {
- dev_err(dev, "Can't get interrupt working.\n");
+ if (ret)
return ret;
- }
airoha_thermal_setup_monitor(priv);
airoha_thermal_setup_adc_val(dev, priv);
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index c2fbdb534f61..44910a953439 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -913,11 +913,8 @@ static int armada_thermal_probe(struct platform_device *pdev)
armada_overheat_isr,
armada_overheat_isr_thread,
0, NULL, priv);
- if (ret) {
- dev_err(&pdev->dev, "Cannot request threaded IRQ %d\n",
- irq);
+ if (ret)
return ret;
- }
}
/*
diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index a9ffa596f7c0..5e23f9e00847 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -356,8 +356,7 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
IRQF_ONESHOT,
DRV_NAME, priv);
if (ret < 0)
- return dev_err_probe(&pdev->dev, ret,
- "could not request IRQ\n");
+ return ret;
}
dev_info(&pdev->dev, "registered AVS TMON of-sensor driver\n");
diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
index cf1706569e6d..46005b476722 100644
--- a/drivers/thermal/db8500_thermal.c
+++ b/drivers/thermal/db8500_thermal.c
@@ -167,10 +167,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(dev, low_irq, NULL,
prcmu_low_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
"dbx500_temp_low", th);
- if (ret < 0) {
- dev_err(dev, "failed to allocate temp low irq\n");
+ if (ret < 0)
return ret;
- }
high_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_HIGH");
if (high_irq < 0)
@@ -179,10 +177,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(dev, high_irq, NULL,
prcmu_high_irq_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
"dbx500_temp_high", th);
- if (ret < 0) {
- dev_err(dev, "failed to allocate temp high irq\n");
+ if (ret < 0)
return ret;
- }
/* register of thermal sensor and get info from DT */
th->tz = devm_thermal_of_zone_register(dev, 0, th, &thdev_ops);
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 4307161533a7..17ed0c5b7767 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -578,10 +578,8 @@ static int hisi_thermal_probe(struct platform_device *pdev)
hisi_thermal_alarm_irq_thread,
IRQF_ONESHOT, sensor->irq_name,
sensor);
- if (ret < 0) {
- dev_err(dev, "Failed to request alarm irq: %d\n", ret);
+ if (ret < 0)
return ret;
- }
ret = data->ops->enable_sensor(sensor);
if (ret) {
diff --git a/drivers/thermal/imx91_thermal.c b/drivers/thermal/imx91_thermal.c
index 25915bb702be..274eee303142 100644
--- a/drivers/thermal/imx91_thermal.c
+++ b/drivers/thermal/imx91_thermal.c
@@ -331,7 +331,7 @@ static int imx91_tmu_probe(struct platform_device *pdev)
IRQF_ONESHOT, "imx91_thermal", tmu);
if (ret < 0)
- return dev_err_probe(dev, ret, "failed to request alarm irq\n");
+ return ret;
pm_runtime_put(dev);
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 5aaacbc53478..416d89c6287a 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -732,10 +732,8 @@ static int imx_thermal_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(dev, data->irq,
imx_thermal_alarm_irq, imx_thermal_alarm_irq_thread,
0, "imx_thermal", data);
- if (ret < 0) {
- dev_err(dev, "failed to request alarm irq: %d\n", ret);
+ if (ret < 0)
goto thermal_zone_unregister;
- }
pm_runtime_put(data->dev);
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
index c693d934103a..c5131423ec9b 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
@@ -308,10 +308,8 @@ static int proc_thermal_setup_msi(struct pci_dev *pdev, struct proc_thermal_pci
ret = devm_request_threaded_irq(&pdev->dev, irq, proc_thermal_irq_handler,
proc_thermal_irq_thread_handler,
0, KBUILD_MODNAME, pci_info);
- if (ret) {
- dev_err(&pdev->dev, "Request IRQ %d failed\n", irq);
+ if (ret)
goto err_free_msi_vectors;
- }
proc_thermal_msi_map[i] = irq;
}
@@ -394,10 +392,8 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_
ret = devm_request_threaded_irq(&pdev->dev, irq, proc_thermal_irq_handler,
proc_thermal_irq_thread_handler, irq_flag,
KBUILD_MODNAME, pci_info);
- if (ret) {
- dev_err(&pdev->dev, "Request IRQ %d failed\n", pdev->irq);
+ if (ret)
goto err_ret_tzone;
- }
}
ret = thermal_zone_device_enable(pci_info->tzone);
diff --git a/drivers/thermal/intel/intel_bxt_pmic_thermal.c b/drivers/thermal/intel/intel_bxt_pmic_thermal.c
index 6312c6ba081f..aeaefbbd5d8f 100644
--- a/drivers/thermal/intel/intel_bxt_pmic_thermal.c
+++ b/drivers/thermal/intel/intel_bxt_pmic_thermal.c
@@ -245,10 +245,8 @@ static int pmic_thermal_probe(struct platform_device *pdev)
NULL, pmic_thermal_irq_handler,
IRQF_ONESHOT, "pmic_thermal", pdev);
- if (ret) {
- dev_err(dev, "request irq(%d) failed: %d\n", virq, ret);
+ if (ret)
return ret;
- }
pmic_irq_count++;
}
diff --git a/drivers/thermal/loongson2_thermal.c b/drivers/thermal/loongson2_thermal.c
index 88f87badfdf6..4d40fc706a53 100644
--- a/drivers/thermal/loongson2_thermal.c
+++ b/drivers/thermal/loongson2_thermal.c
@@ -173,7 +173,7 @@ static int loongson2_thermal_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(dev, irq, NULL, loongson2_thermal_irq_thread,
IRQF_ONESHOT, "loongson2_thermal", tzd);
if (ret < 0)
- return dev_err_probe(dev, ret, "failed to request alarm irq\n");
+ return ret;
devm_thermal_add_hwmon_sysfs(dev, tzd);
diff --git a/drivers/thermal/max77620_thermal.c b/drivers/thermal/max77620_thermal.c
index 85a12e98d6dc..f4a1535f4806 100644
--- a/drivers/thermal/max77620_thermal.c
+++ b/drivers/thermal/max77620_thermal.c
@@ -121,19 +121,15 @@ static int max77620_thermal_probe(struct platform_device *pdev)
max77620_thermal_irq,
IRQF_ONESHOT | IRQF_SHARED,
dev_name(&pdev->dev), mtherm);
- if (ret < 0) {
- dev_err(&pdev->dev, "Failed to request irq1: %d\n", ret);
+ if (ret < 0)
return ret;
- }
ret = devm_request_threaded_irq(&pdev->dev, mtherm->irq_tjalarm2, NULL,
max77620_thermal_irq,
IRQF_ONESHOT | IRQF_SHARED,
dev_name(&pdev->dev), mtherm);
- if (ret < 0) {
- dev_err(&pdev->dev, "Failed to request irq2: %d\n", ret);
+ if (ret < 0)
return ret;
- }
return 0;
}
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index a9617d5e0077..d357968f362b 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -1491,7 +1491,7 @@ static int lvts_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(dev, irq, NULL, lvts_irq_handler,
IRQF_ONESHOT, dev_name(dev), lvts_td);
if (ret)
- return dev_err_probe(dev, ret, "Failed to request interrupt\n");
+ return ret;
platform_set_drvdata(pdev, lvts_td);
diff --git a/drivers/thermal/qcom/lmh.c b/drivers/thermal/qcom/lmh.c
index 3d072b7a4a6d..99396b93eff5 100644
--- a/drivers/thermal/qcom/lmh.c
+++ b/drivers/thermal/qcom/lmh.c
@@ -223,7 +223,6 @@ static int lmh_probe(struct platform_device *pdev)
IRQF_NO_THREAD | IRQF_NO_SUSPEND,
"lmh-irq", lmh_data);
if (ret) {
- dev_err(dev, "Error %d registering irq %x\n", ret, lmh_data->irq);
irq_domain_remove(lmh_data->domain);
return ret;
}
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 6e3714ecab1d..b5ec70201e2f 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -1258,10 +1258,7 @@ static int tsens_register_irq(struct tsens_priv *priv, char *irqname,
dev_name(&pdev->dev),
priv);
- if (ret)
- dev_err(&pdev->dev, "%s: failed to get irq\n",
- __func__);
- else
+ if (!ret)
*irq_num = irq;
}
diff --git a/drivers/thermal/renesas/rcar_thermal.c b/drivers/thermal/renesas/rcar_thermal.c
index 6e5dcac5d47a..cf80e2655416 100644
--- a/drivers/thermal/renesas/rcar_thermal.c
+++ b/drivers/thermal/renesas/rcar_thermal.c
@@ -446,10 +446,8 @@ static int rcar_thermal_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, irq, rcar_thermal_irq,
IRQF_SHARED, dev_name(dev), common);
- if (ret) {
- dev_err(dev, "irq request failed\n");
+ if (ret)
goto error_unregister;
- }
/* update ENR bits */
if (chip->irq_per_ch)
diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/renesas/rzg3e_thermal.c
index f0e29fe633db..c44f5b8858d0 100644
--- a/drivers/thermal/renesas/rzg3e_thermal.c
+++ b/drivers/thermal/renesas/rzg3e_thermal.c
@@ -461,10 +461,8 @@ static int rzg3e_thermal_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(dev, irq, rzg3e_thermal_irq,
rzg3e_thermal_irq_thread,
IRQF_ONESHOT, "rzg3e_thermal", priv);
- if (ret) {
- dev_err(dev, "Failed to request IRQ: %d\n", ret);
+ if (ret)
goto err_pm_put;
- }
/* Add hwmon sysfs interface */
ret = devm_thermal_add_hwmon_sysfs(dev, priv->zone);
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index c49ddf70f86e..08891608baa6 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1773,8 +1773,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
IRQF_ONESHOT,
"rockchip_thermal", thermal);
if (error)
- return dev_err_probe(&pdev->dev, error,
- "failed to request tsadc irq.\n");
+ return error;
thermal->chip->control(thermal->regs, true);
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 47a99b3c5395..56717bb50d60 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1102,10 +1102,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
IRQF_TRIGGER_RISING
| IRQF_SHARED | IRQF_ONESHOT,
dev_name(dev), data);
- if (ret) {
- dev_err(dev, "Failed to request irq: %d\n", data->irq);
+ if (ret)
goto err_sclk;
- }
exynos_tmu_control(pdev, true);
return 0;
diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c
index 8f76e50ea567..e3dbe4df80cb 100644
--- a/drivers/thermal/st/st_thermal_memmap.c
+++ b/drivers/thermal/st/st_thermal_memmap.c
@@ -101,10 +101,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor)
NULL, st_mmap_thermal_trip_handler,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
dev->driver->name, sensor);
- if (ret) {
- dev_err(dev, "failed to register IRQ %d\n", sensor->irq);
+ if (ret)
return ret;
- }
return st_mmap_enable_irq(sensor);
}
diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
index 5d8170bfb382..3290da7ab607 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -390,11 +390,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
stm_thermal_irq_handler,
IRQF_ONESHOT,
dev->driver->name, sensor);
- if (ret) {
- dev_err(dev, "%s: Failed to register IRQ %d\n", __func__,
- sensor->irq);
+ if (ret)
return ret;
- }
dev_dbg(dev, "%s: thermal IRQ registered", __func__);
diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index d8e988a0d43e..f74acf13b24d 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -2007,10 +2007,8 @@ static int soctherm_interrupts_init(struct platform_device *pdev,
IRQF_ONESHOT,
dev_name(&pdev->dev),
tegra);
- if (ret < 0) {
- dev_err(&pdev->dev, "request_irq 'thermal_irq' failed.\n");
+ if (ret < 0)
return ret;
- }
ret = devm_request_threaded_irq(&pdev->dev,
tegra->edp_irq,
@@ -2019,10 +2017,8 @@ static int soctherm_interrupts_init(struct platform_device *pdev,
IRQF_ONESHOT,
"soctherm_edp",
tegra);
- if (ret < 0) {
- dev_err(&pdev->dev, "request_irq 'edp_irq' failed.\n");
+ if (ret < 0)
return ret;
- }
return 0;
}
diff --git a/drivers/thermal/tegra/tegra30-tsensor.c b/drivers/thermal/tegra/tegra30-tsensor.c
index 6245f6b97f43..10a5ab1fe1b9 100644
--- a/drivers/thermal/tegra/tegra30-tsensor.c
+++ b/drivers/thermal/tegra/tegra30-tsensor.c
@@ -602,8 +602,7 @@ static int tegra_tsensor_probe(struct platform_device *pdev)
tegra_tsensor_isr, IRQF_ONESHOT,
"tegra_tsensor", ts);
if (err)
- return dev_err_probe(&pdev->dev, err,
- "failed to request interrupt\n");
+ return err;
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] thermal/drivers: Remove redundant error messages on IRQ request failure
2026-07-17 2:47 [PATCH v2] thermal/drivers: Remove redundant error messages on IRQ request failure Pan Chuang
@ 2026-07-17 3:00 ` sashiko-bot
2026-07-17 7:37 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-17 3:00 UTC (permalink / raw)
To: Pan Chuang; +Cc: imx, wsa+renesas, Frank.Li
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
Pre-existing issues:
- [High] PM runtime usage counter is leaked on multiple error paths in `imx91_tmu_probe()`.
- [High] Double decrement of the Runtime PM usage counter in the error handling path of `imx_thermal_probe()`.
- [High] Global static array `proc_thermal_msi_map` is corrupted across devices and on probe failures.
- [High] The IRQ domain created for over-current interrupts in `soctherm_oc_int_init()` is permanently leaked and can cause a Use-After-Free.
--
--- Patch [1]: [PATCH v2] thermal/drivers: Remove redundant error messages on IRQ request failure ---
commit c2aa5d21cea82c30c0f98a72f0af891902e951bd
Author: Pan Chuang <panchuang@vivo.com>
Subject: thermal/drivers: Remove redundant error messages on IRQ request failure
This patch removes redundant driver-specific dev_err() and dev_err_probe()
logging when devm_request_irq() or devm_request_threaded_irq() fails across
various thermal drivers. The core IRQ subsystem already provides detailed
error messages for these failures.
[ ... ]
> diff --git a/drivers/thermal/imx91_thermal.c b/drivers/thermal/imx91_thermal.c
> index 25915bb702bea..274eee3031429 100644
> --- a/drivers/thermal/imx91_thermal.c
> +++ b/drivers/thermal/imx91_thermal.c
> @@ -331,7 +331,7 @@ static int imx91_tmu_probe(struct platform_device *pdev)
> IRQF_ONESHOT, "imx91_thermal", tmu);
>
> if (ret < 0)
> - return dev_err_probe(dev, ret, "failed to request alarm irq\n");
> + return ret;
[Severity: High]
This is a pre-existing issue, but does this error path leak the PM runtime
usage counter?
Looking at imx91_tmu_probe(), the usage counter is incremented earlier with
pm_runtime_get_noresume(). If devm_request_threaded_irq() fails, returning
directly bypasses the pm_runtime_put(dev) call at the end of the function.
Because the device persists across probe failures like -EPROBE_DEFER, the
usage counter will accumulate on every retry, preventing the device from
ever entering runtime suspend.
[ ... ]
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index 5aaacbc534786..416d89c6287ad 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -732,10 +732,8 @@ static int imx_thermal_probe(struct platform_device *pdev)
> ret = devm_request_threaded_irq(dev, data->irq,
> imx_thermal_alarm_irq, imx_thermal_alarm_irq_thread,
> 0, "imx_thermal", data);
> - if (ret < 0) {
> - dev_err(dev, "failed to request alarm irq: %d\n", ret);
> + if (ret < 0)
> goto thermal_zone_unregister;
> - }
[Severity: High]
This is a pre-existing issue, but is there a double decrement of the PM
runtime usage counter on error paths in imx_thermal_probe()?
pm_runtime_resume_and_get() automatically drops the usage counter if it
fails. If it fails, the code jumps to the disable_runtime_pm label:
disable_runtime_pm:
pm_runtime_put_noidle(data->dev);
pm_runtime_disable(data->dev);
Since the usage count was already dropped internally by the failed get
operation, this second decrement underflows the usage counter, corrupting
the PM core state tracking.
[ ... ]
> diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
> index c693d934103af..c5131423ec9bd 100644
> --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
> +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
> @@ -308,10 +308,8 @@ static int proc_thermal_setup_msi(struct pci_dev *pdev, struct proc_thermal_pci
> ret = devm_request_threaded_irq(&pdev->dev, irq, proc_thermal_irq_handler,
> proc_thermal_irq_thread_handler,
> 0, KBUILD_MODNAME, pci_info);
> - if (ret) {
> - dev_err(&pdev->dev, "Request IRQ %d failed\n", irq);
> + if (ret)
> goto err_free_msi_vectors;
> - }
>
> proc_thermal_msi_map[i] = irq;
> }
[Severity: High]
This isn't a bug introduced by this patch, but does the use of the global
static array proc_thermal_msi_map cause corruption across devices?
If multiple PCI thermal devices exist on the system, probing a second
device overwrites the mappings in this shared array. When an interrupt
arrives, proc_thermal_match_msi_irq() will fail to match the IRQ for any
device except the last probed one, leading to ignored thermal events.
Additionally, on probe failure, proc_thermal_free_msi() looping over this
shared array might attempt to free IRQs belonging to another active device.
[ ... ]
> diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
> index d8e988a0d43e9..f74acf13b24d2 100644
> --- a/drivers/thermal/tegra/soctherm.c
> +++ b/drivers/thermal/tegra/soctherm.c
> @@ -2007,10 +2007,8 @@ static int soctherm_interrupts_init(struct platform_device *pdev,
> IRQF_ONESHOT,
> dev_name(&pdev->dev),
> tegra);
> - if (ret < 0) {
> - dev_err(&pdev->dev, "request_irq 'thermal_irq' failed.\n");
> + if (ret < 0)
> return ret;
> - }
[Severity: High]
This is a pre-existing issue, but does returning early here leak the IRQ
domain created in soctherm_oc_int_init()?
soctherm_oc_int_init() allocates a new linear IRQ domain and assigns it to
the static global pointer soc_irq_cdata.domain. If we return ret here, the
domain is abandoned. Furthermore, tegra_soctherm_remove() does not call
irq_domain_remove(). Since the ops pointer points to module memory, this
leaves a dangling pointer in the kernel's global IRQ domain list, leading
to a potential Use-After-Free after module unload.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260717024733.374913-1-panchuang@vivo.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] thermal/drivers: Remove redundant error messages on IRQ request failure
2026-07-17 2:47 [PATCH v2] thermal/drivers: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-17 3:00 ` sashiko-bot
@ 2026-07-17 7:37 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2026-07-17 7:37 UTC (permalink / raw)
To: Pan Chuang
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Markus Mayer, Broadcom internal kernel review list,
Florian Fainelli, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
Magnus Damm, John Madieu, Heiko Stuebner,
Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Peter Griffin,
Alim Akhtar, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
Jonathan Hunter, Matthias Brugger, AngeloGioacchino Del Regno,
Srinivas Pandruvada, Andy Shevchenko, Laura Nao, Fei Shao,
Chen-Yu Tsai, Jiapeng Chong, Frank Wunderlich, Mikko Perttunen,
Svyatoslav Ryhel, open list:THERMAL, open list,
moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE,
open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
open list:ARM/QUALCOMM MAILING LIST,
open list:RENESAS R-CAR THERMAL DRIVERS,
open list:ARM/Rockchip SoC support,
open list:SAMSUNG THERMAL DRIVER,
moderated list:ARM/STM32 ARCHITECTURE,
open list:TEGRA ARCHITECTURE SUPPORT,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
Niklas S?derlund
On 17/07/2026 at 10:47:10 +08, Pan Chuang <panchuang@vivo.com> wrote:
> Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
> devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq()
> automatically log detailed error messages on failure. Remove the
> now-redundant driver-specific dev_err() and dev_err_probe() calls.
>
> Signed-off-by: Pan Chuang <panchuang@vivo.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Niklas S?derlund <niklas.soderlund+renesas@ragnatech.se>
^
There is an encoding issue here
> drivers/thermal/armada_thermal.c | 5 +----
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-17 7:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 2:47 [PATCH v2] thermal/drivers: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-17 3:00 ` sashiko-bot
2026-07-17 7:37 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox