Re: [PATCH] cpufreq: use cpufreq_cpu_get to avoid cpufreq_get race conditions

From: Rafael J. Wysocki
Date: Thu Mar 06 2014 - 07:15:53 EST


On Wednesday, March 05, 2014 05:14:26 PM Aaron Plattner wrote:
> On 03/05/14 17:23, Rafael J. Wysocki wrote:
> > On Tuesday, March 04, 2014 12:42:15 PM Aaron Plattner wrote:
> >> If a module calls cpufreq_get while cpufreq is initializing, it's possible for
> >> it to be called after cpufreq_driver is set but before cpufreq_cpu_data is
> >> written during subsys_interface_register. This happens because cpufreq_get
> >> doesn't take the cpufreq_driver_lock around its use of cpufreq_cpu_data.
> >
> > Is this a theoretical race, or can you actually reproduce it? If so, on what
> > system/driver? Or are there any bug reports related to this you can point me
> > to?
>
> It reproduces on my Arch Linux system at home with the nvidia driver,
> and there has been at least one bug report that looks like the same thing:
>
> https://bbs.archlinux.org/viewtopic.php?id=177934
>
> I reproduced the problem with v3.13.5, then applied this change and was
> able to boot successfully 10/10 times. So I guess that means you can add
>
> Tested-by: Aaron Plattner <aplattner@xxxxxxxxxx>

Tested-by is not needed if you're the author.

Everybody should test their patches, right? ;-)

I'll mark it for 3.13-stable and add the link above to the changelog.

Thanks!

--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/