On 12/3/2026 11:39 PM, Haoxiang Li wrote:
powernv_cpufreq_work_fn() invokes powernv_cpufreq_throttle_check() through an asynchronous IPI. The callback may still be pending or running after cancel_work_sync() returns in clean_chip_info(), allowing it to access chips after they have been freed.Make the IPI synchronous so that the throttle check completes before the work function returns. This ensures that cancel_work_sync() also waits for the IPI callback to finish before freeing chips. Fixes: 86622cb8c57a ("cpufreq: powernv: Free 'chips' on module exit")
Your Signed-off-by is missing, please add it. Also, since this makes the IPI synchronous, please explain in the changelog why waiting is safe here and what the impact is, i.e. the extra time the work now spends waiting for the remote CPU. The work is only queued on OCC throttle events, e.g. thermal or power cap throttle messages and OCC reset recovery.
--- drivers/cpufreq/powernv-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 9dee341b407e..42ff23e14095 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -920,7 +920,7 @@ static void powernv_cpufreq_work_fn(struct work_struct *work) cpus_read_lock(); cpumask_and(&mask, &chip->mask, cpu_online_mask); smp_call_function_any(&mask, - powernv_cpufreq_throttle_check, NULL, 0); + powernv_cpufreq_throttle_check, NULL, 1);if (!chip->restore)goto out;
-- Thx and BRs, Zhongqiu Han
