[PATCH v5 0/2] PM / devfreq: Add HiSilicon uncore frequency scaling driver

Jie Zhan zhanjie9 at hisilicon.com
Mon Jun 23 01:45:30 PDT 2025



On 23/06/2025 11:39, lihuisong (C) wrote:
> LGTM, for series,
> Reviewed-by: lihuisong at huawei.com
> 

Huisong, thanks for reviewing!
> 
> 在 2025/6/19 23:14, Jie Zhan 写道:
>> Add the HiSilicon uncore frequency scaling driver for Kunpeng SoCs based on
>> the devfreq framework.  The uncore domain contains shared computing
>> resources, including system interconnects and L3 cache.  The uncore
>> frequency significantly impacts the system-wide performance as well as
>> power consumption.  This driver adds support for runtime management of
>> uncore frequency from kernel and userspace.  The main function includes
>> setting and getting frequencies, changing frequency scaling policies, and
>> querying the list of CPUs whose performance is significantly related to
>> this uncore frequency domain, etc.  The driver communicates with a platform
>> controller through an ACPI PCC mailbox to take the actual actions of
>> frequency scaling.
>>
>> Changelog:
>>
>> v5:
>> - Comment more on error code related stuff about
>>    hisi_uncore_mark_related_cpus(), and return failure early on errors
>>    except for -EINVAL, which indicates possibly broken firmware.
>> - Separate error prints apart for two cases in hisi_platform_gov_handler()
>> - Make the 'related_cpus' sysfs ABI description more generic
>> - Some coding style cleanups and typo fixes
>>
>> v4:
>> https://lore.kernel.org/linux-pm/20250530081722.280776-1-zhanjie9@hisilicon.com/
>> - Allow devfreq core to accept device-specific sysfs ABIs
>> - Replace custom sysfs attrs with dev_groups and let the devfreq core
>>    manage it
>> - Update 'related_cpus' description in the devfreq ABI doc
>> - Remove COMPILE_TEST in Kconfig as the mailbox_client.h doesn't support
>>    this yet
>> - Replace dev_err() with dev_err_probe() during drv->probe()
>> - Replace mutex_init() with devm_mutex_init() to warn on UAF
>> - Replace uncore->dev with dev in some places to make code a bit shorter
>> - Remove redundant uncore->pchan check in hisi_uncore_free_pcc_chan()
>> - Use __free() to let compiler release temporary memory
>> - Clean up the error handling and redundant 'status = 0' in
>>    hisi_uncore_send_cmd()
>> - Some coding style cleanup
>>
>> v3:
>> https://lore.kernel.org/linux-pm/20250522031701.1912458-1-zhanjie9@hisilicon.com/
>> - Remove redundant resource freeing processes when drv->probe() fails as
>>    they're already handled by devm
>>
>> v2:
>> https://lore.kernel.org/linux-pm/20250520074120.4187096-1-zhanjie9@hisilicon.com/
>> - Make devm manage the release sequence, remove drv->remove()
>> - Warn on !uncore or !uncore->pchan as they're no longer expected
>> - Remove ioremap of pcc shared memory because it's done by the pcc driver
>> - Fix compiler warning of discarding 'const'
>> - Minor trivial coding style changes
>>
>> v1:
>> https://lore.kernel.org/linux-pm/20250506021434.944386-1-zhanjie9@hisilicon.com/
>>
>> Jie Zhan (2):
>>    PM / devfreq: Allow devfreq driver to add custom sysfs ABIs
>>    PM / devfreq: Add HiSilicon uncore frequency scaling driver
>>
>>   Documentation/ABI/testing/sysfs-class-devfreq |   9 +
>>   drivers/devfreq/Kconfig                       |  11 +
>>   drivers/devfreq/Makefile                      |   1 +
>>   drivers/devfreq/devfreq.c                     |   1 +
>>   drivers/devfreq/hisi_uncore_freq.c            | 664 ++++++++++++++++++
>>   include/linux/devfreq.h                       |   4 +
>>   6 files changed, 690 insertions(+)
>>   create mode 100644 drivers/devfreq/hisi_uncore_freq.c
>>



More information about the linux-arm-kernel mailing list