[PATCH] intel_th: Balance the runtime PM reference on driver removal

From: Wentao Liang

Date: Tue Nov 03 2026 - 02:11:37 EST


intel_th_remove() resumes the device with pm_runtime_get_sync() before
calling the driver's remove callback, but never drops that usage counter
increment. Disabling and re-enabling runtime PM does not reset the usage
counter, nor does the driver core's subsequent pm_runtime_reinit().
Repeated unbind and bind cycles therefore retain an extra reference each
time and can prevent the device and its parent from suspending.

Drop the removal reference with pm_runtime_put_noidle() while runtime PM
is disabled, before restoring the existing active state.

Fixes: 142dfeb20209 ("intel_th: Add runtime power management handling")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/hwtracing/intel_th/core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 56acf31546da..1c1f59b8ed3f 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -162,6 +162,7 @@ static void intel_th_remove(struct device *dev)
}

pm_runtime_disable(dev);
+ pm_runtime_put_noidle(dev);
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
}
--
2.34.1