[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52C65C4F.1060804@marvell.com>
Date: Fri, 3 Jan 2014 14:44:31 +0800
From: Jane Li <jiel@...vell.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
CC: "rjw@...ysocki.net" <rjw@...ysocki.net>,
"viresh.kumar@...aro.org" <viresh.kumar@...aro.org>,
"cpufreq@...r.kernel.org" <cpufreq@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] cpufreq: Fix timer/workqueue corruption by protecting
reading governor_enabled
On 01/03/2014 07:26 AM, Dmitry Torokhov wrote
> Unlocking in different branches is not the best practice IMO, I'd
> recommend doing:
>
> mutex_lock(&cpufreq_governor_lock);
>
> if (!policy->governor_enabled)
> goto out_unlock;
>
> ...
>
> out_unlock:
> mutex_unlock(&cpufreq_governor_lock);
>
> Thanks!
>
OK. I have pushed PATCH v3. Please review again.
Besides, I use checkpatch.pl to check this patch, and find there is warning. PATCH v3 also move cpufreq_governor_lock declaration to cpufreq.h.
WARNING: externs should be avoided in .c files
#106: FILE: drivers/cpufreq/cpufreq_governor.c:25:
+extern struct mutex cpufreq_governor_lock;
Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists