Re: [PATCH v2 0/2] cpufreq: mediatek-hw: Fix initialization resource leaks

From: Zhongqiu Han

Date: Thu Nov 19 2026 - 05:23:51 EST


On 11/19/2026 1:28 PM, Haoxiang Li wrote:
This series fixes two resource cleanup omissions introduced by commit
d776790a5536 ("cpufreq: mediatek-hw: Fix double devm_remap in hotplug case").

Patch 1 releases the resources when the CPUFreq hardware fails to become
enabled.

Following Zhongqiu's suggestion during review, patch 2 handles the
additional failure path where mtk_cpu_create_freq_table() fails after
the registers have been mapped and the memory region requested.
Thanks to Zhongqiu for pointing out this omission and suggesting a
separate fix.

Changes in v2:
- Keep the original hardware enable failure fix unchanged as patch 1.
- Add patch 2 to clean up on frequency table creation failure, using
the same Fixes tag.

Thanks for the update.

Side note on 1/2: if a domain's HW never comes up, subsequent CPUs of
that domain (and every CPU of it on later hotplug/resume) no longer
fail fast with -EBUSY at request_mem_region() in
mtk_cpu_resources_init(); each of them now waits for the full 300 ms
timeout. That said, HW failing to come up is already a broken platform
state, so the extra delay may not need special handling, unless
someone else sees a reason to. The code itself looks good to me.

For the series:

Reviewed-by: Zhongqiu Han <zhongqiu.han@xxxxxxxxxxxxxxxx>



Haoxiang Li (2):
cpufreq: mediatek-hw: Release resources when hardware enable fails
cpufreq: mediatek-hw: Clean up on frequency table creation failure

drivers/cpufreq/mediatek-cpufreq-hw.c | 31 ++++++++++++++++-----------
1 file changed, 18 insertions(+), 13 deletions(-)


base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4


--
Thx and BRs,
Zhongqiu Han