From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dirk Brandewie Subject: Re: [patch 15/16] cpufreq: intel-pstate: Use del_timer_sync in intel_pstate_cpu_exit() Date: Mon, 24 Mar 2014 07:18:01 -0700 Message-ID: <53303E99.70509@gmail.com> References: <20140323150557.288925975@linutronix.de> <20140323150754.272874059@linutronix.de> <2311758.L3eN8OTkba@vostro.rjw.lan> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=tN2WiQzCpTVOZNgDYrbpX+7cqKXD++piyb/xs5RHS80=; b=FvcRkLu4aoa4zhf1mZ7wO9PxnCgqei6ARy6Tx87WI7UXrR59Kwa1SDHe8UCeIDQqD5 J5NiGYBVH/6uoITJs+IZHVNtH9dm+rHBoIuskhuyxdpJGBk/UiXpX2nlFVVtou/vyEO4 CVBdNTOMZsOSYi8sDXJV1/0amreVXx9bg78xzA0GBUe6t/ioFBcYRyqxU/qJX7nC+s8r tFdBP9osjUb0TzOeH3KsD2rOsazfIW6m7+bnv5wz54/Zz0umq8wZ2JkssouCMt4przKT of00ToG5Z86JsUdcNAeQRD7jUZEXOhg2ZinDAr2G6kdU0hvwKfURfiRmIPaDK1+r94VG 6FCQ== In-Reply-To: <2311758.L3eN8OTkba@vostro.rjw.lan> Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: "Rafael J. Wysocki" , Thomas Gleixner , dirk.j.brandewie@intel.com Cc: dirk.brandewie@gmail.com, LKML , Julia Lawall , Andrew Morton , cpufreq , pm Hi Thomas, On 03/23/2014 06:56 PM, Rafael J. Wysocki wrote: > On Sunday, March 23, 2014 03:09:32 PM Thomas Gleixner wrote: >> We are about to free the data structure. Make sure no timer callback >> is running. I might be paranoid, but the ->exit callback can be >> invoked from so many places, that it is not entirely clear whether >> del_timer is always called on the cpu on which it is enqueued. >> >> While looking through the call sites I noticed, that >> cpufreq_init_policy() can fail and invoke cpufreq_driver->exit() but >> it does not return the failure and the callsite happily proceeds. >> The call to del_timer() has been moved to a new callback in material in Rafaels pull request for v3.15. I will send a patch adding this change to the v3.15 material. --Dirk >> Signed-off-by: Thomas Gleixner >> Cc: "Rafael J. Wysocki" >> Cc: cpufreq >> Cc: pm > > Dirk? > >> --- >> >> drivers/cpufreq/intel_pstate.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> Index: tip/drivers/cpufreq/intel_pstate.c >> =================================================================== >> --- tip.orig/drivers/cpufreq/intel_pstate.c >> +++ tip/drivers/cpufreq/intel_pstate.c >> @@ -777,7 +777,7 @@ static int intel_pstate_cpu_exit(struct >> { >> int cpu = policy->cpu; >> >> - del_timer(&all_cpu_data[cpu]->timer); >> + del_timer_sync(&all_cpu_data[cpu]->timer); >> kfree(all_cpu_data[cpu]); >> all_cpu_data[cpu] = NULL; >> return 0; >> >> >