[PATCH 1/3] drivers/perf: hisi: Consolidate uncore PMU cpuhp states

Yushan Wang wangyushan12 at huawei.com
Thu Jul 30 19:49:23 PDT 2026



On 7/30/2026 2:38 AM, Jonathan Cameron wrote:
> On Mon, 27 Jul 2026 13:41:59 +0100
> Robin Murphy <robin.murphy at arm.com> wrote:
>
>> On 24/07/2026 3:52 am, Yushan Wang wrote:
>>> Every HiSilicon uncore PMU driver allocates its own static cpuhp state
>>> even though they all register identical online/offline callbacks. This
>>> wastes slots in the cpuhp state enum and needlessly fragments the
>>> hotplug state space.
>>>
>>> Move the cpuhp state setup into the shared hisi_uncore_pmu framework:
>>> register a single dynamic state (CPUHP_AP_ONLINE_DYN) at framework
>>> module init and export it for all HiSilicon uncore PMU drivers to use.
>>> Drop the now-unused static CPUHP_AP_PERF_ARM_HISI_* entries from
>>> include/linux/cpuhotplug.h.
>>>
>>> The L3C PMU driver keeps a private dynamic state because it has its own
>>> hotplug callbacks for migrating multiple per-CPU interrupt affinities,
>>> but switches from its former static slot to CPUHP_AP_ONLINE_DYN for
>>> consistency.
>>>
>>> No intended functional changes.
>>>
>>> Signed-off-by: Yushan Wang <wangyushan12 at huawei.com>
>>> ---
>>>   drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c  | 34 +++---------------
>>>   drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 34 +++---------------
>>>   drivers/perf/hisilicon/hisi_uncore_hha_pmu.c  | 34 +++---------------
>>>   drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c  | 21 +++++------
>>>   drivers/perf/hisilicon/hisi_uncore_mn_pmu.c   | 35 ++----------------
>>>   drivers/perf/hisilicon/hisi_uncore_noc_pmu.c  | 35 ++----------------
>>>   drivers/perf/hisilicon/hisi_uncore_pa_pmu.c   | 34 +++---------------
>>>   drivers/perf/hisilicon/hisi_uncore_pmu.c      | 25 +++++++++++++
>>>   drivers/perf/hisilicon/hisi_uncore_pmu.h      |  2 ++
>>>   drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 34 +++---------------
>>>   drivers/perf/hisilicon/hisi_uncore_uc_pmu.c   | 36 ++-----------------
>>>   include/linux/cpuhotplug.h                    |  6 ----
>>>   12 files changed, 67 insertions(+), 263 deletions(-)  
>> Neat! Seems like a pretty nice win already, plus it only makes a 
>> conversion easier if my generic hotplug idea takes off :)
>>
>> Reviewed-by: Robin Murphy <robin.murphy at arm.com>
> Hi Yushan,
>
> Nice indeed.  It always irritated me to see that block of code cut
> and paste so often + that it stopped use of module_platform_driver()
>
> Reviewed-by: Jonathan Cameron <jonathan.cameron at oss.qualcomm.com>
Hi Jonathan,

Thanks for reviewing, happy to help to make this a bit clearer!




More information about the linux-arm-kernel mailing list