[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67b55ae1-60b0-4d54-8220-59f7e3ba7c29@kylinos.cn>
Date: Mon, 8 Sep 2025 15:08:50 +0800
From: Zihuan Zhang <zhangzihuan@...inos.cn>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Rafael J . wysocki" <rafael@...nel.org>,
Saravana Kannan <saravanak@...gle.com>, zhenglifeng
<zhenglifeng1@...wei.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/3] cpufreq: Always enforce policy limits even without
frequency table
在 2025/9/8 14:55, Viresh Kumar 写道:
> On 08-09-25, 14:51, Zihuan Zhang wrote:
>> We are currently considering moving the check that ensures a driver
>> providing a freq_table also implements target_index() into the driver
>> registration path.
> That won't work AFAIU. The freq table is initialized during
> policy->init and that's not done at the time of registration.
One idea we are considering is to check whether driver->verify points to
cpufreq_generic_frequency_table_verify and use that as a heuristic to
enforce the presence of target_index():
((driver_data->verify == cpufreq_generic_frequency_table_verify) !=
!!driver_data->target_index)
I haven’t tested this approach yet, so I’m not sure if it will be fully
reliable.
>> This way, freq_table.c no longer needs to defensively check for NULL
>> pointers.
>>
>> Additionally, we are thinking about merging the two related APIs into a
>> single one. Do you think this is a good idea?
> Which ones ? target/target_index ? I am not sure if that can be done.
If this approach
works, cpufreq_generic_frequency_table_verify and cpufreq_frequency_table_verify
should be the same because we dont't need to check pointer is NULL in
freq_table.c.
> We are fine with improvements generally, but please make sure whatever
> you send doesn't break existing users. That will help saving some of
> our review time.
Powered by blists - more mailing lists