Re: [PATCH] cpufreq: acpi: policy->driver_data can't be NULL in ->exit()

From: Rafael J. Wysocki
Date: Wed Mar 30 2016 - 07:18:15 EST


On Wed, Mar 30, 2016 at 1:15 PM, Rafael J. Wysocki <rafael@xxxxxxxxxx> wrote:
> On Wed, Mar 30, 2016 at 6:24 AM, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>> Its always set by ->init() and so it will always be there in ->exit().
>> There is no need to have a special check for just that.
>
> I'm not sure what happens if there are two (or more) CPUs in the policy, though.
>
> That case is almost certainly handled incorrectly here (or rather not
> handled at all), but it may just happen to sort of work, because the
> first exiting CPU will clear driver_data and the second one will
> notice that it is NULL now. Of course, that still is racy with
> respect to governors etc, but I'd rather fix the driver properly.

Sorry, scratch that. To core only calls ->exit for the last CPU in
the policy, so I agree with the patch.

It conflicts with other stuff (as you know), so I'm not sure about the
order in which they are going to be applied, though.

Thanks,
Rafael