Re: [RFC][PATCH] cpufreq: User/admin documentation update and consolidation

From: Viresh Kumar
Date: Tue Feb 21 2017 - 00:00:59 EST


On 20-02-17, 14:58, Rafael J. Wysocki wrote:
> Yes, it is called for new and inactive policies.
>
> For new policies it has to populate policy->cpus (because otherwise the core
> doesn't know what CPUs should be there), which quite arguably doesn't have
> to (or even doesn't need to) be done for inactive policies (because they already
> have policy->real_cpus and policy->related_cpus populated).

> I would even argue that ->init() should not update policy->cpus for inactive
> (but not new) policies.

I agree, but I am not aware of any platforms that we have today which
does any similar checks in ->init(). And I wouldn't encourage drivers
to have such special handling at all. Why make it complex?

The way you have written it earlier suggests that the drivers should
check if the policy is active or not (by looking at related_cpus mask)
and set the cpus mask only for new policies. I was just worried that
new driver authors will actually try to write special code in init()
for that and if we really want that to be the case.

--
viresh