Re: [PATCH] cpufreq: Add CPU frequency policy change notification support

From: Tony W Wang-oc

Date: Wed Jan 21 2026 - 03:53:58 EST




On 2026/1/21 13:51, Viresh Kumar wrote:



On 20-01-26, 17:24, Tony W Wang-oc wrote:
Implemented CPUFREQ_CHANGE_POLICY notification in cpufreq subsystem.
This enhancement allows kernel modules to be notified when a CPU frequency
policy is modified, facilitating more integrated system management.
The notification is dispatched after a successful governor switch during
policy updates.

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@xxxxxxxxxxx>
---
drivers/cpufreq/cpufreq.c | 2 ++
include/linux/cpufreq.h | 1 +
2 files changed, 3 insertions(+)

Who is using this stuff ? Please explain why you need this and how you
are going to use it. I don't think it is a great idea, but I still
want to see what you are doing in the first place.


The expectation is to register a notifier of type CPUFREQ_POLICY_NOTIFIER via cpufreq_register_notifier in one of our drivers. The notifier callback will configure Zhaoxin registers to different values based on the different cpufreq governors when the event is CPUFREQ_GOVERNOR_CHANGE, thereby allowing the Zhaoxin hardware to adopt different power management strategies.

Sincerely!
TonyWWang-oc