From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Subject: Re: [patch 11/13] cpufreq/sparc-us3: Replace racy task affinity logic Date: Thu, 13 Apr 2017 08:18:27 +0530 Message-ID: <20170413024827.GK5910@vireshk-i7> References: <20170412200726.941336635@linutronix.de> <20170412201043.047558840@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pf0-f178.google.com ([209.85.192.178]:33403 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755557AbdDMCsb (ORCPT ); Wed, 12 Apr 2017 22:48:31 -0400 Received: by mail-pf0-f178.google.com with SMTP id s16so22158310pfs.0 for ; Wed, 12 Apr 2017 19:48:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170412201043.047558840@linutronix.de> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Ingo Molnar , Sebastian Siewior , Benjamin Herrenschmidt , "David S. Miller" , Fenghua Yu , Herbert Xu , Lai Jiangshan , Len Brown , Michael Ellerman , "Rafael J. Wysocki" , Tejun Heo , Tony Luck , linux-pm@vger.kernel.org On 12-04-17, 22:07, Thomas Gleixner wrote: > The access to the safari config register in the CPU frequency functions > must be executed on the target CPU. This is achieved by temporarily setting > the affinity of the calling user space thread to the requested CPU and > reset it to the original affinity afterwards. > > That's racy vs. CPU hotplug and concurrent affinity settings for that > thread resulting in code executing on the wrong CPU and overwriting the > new affinity setting. > > Replace it by a straight forward smp function call. > > Signed-off-by: Thomas Gleixner > Cc: "Rafael J. Wysocki" > Cc: Viresh Kumar > Cc: "David S. Miller" > Cc: linux-pm@vger.kernel.org > --- > drivers/cpufreq/sparc-us3-cpufreq.c | 46 ++++++++++++------------------------ > 1 file changed, 16 insertions(+), 30 deletions(-) Acked-by: Viresh Kumar -- viresh