From patchwork Fri Aug 19 20:39:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 9290871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BABC3600CB for ; Fri, 19 Aug 2016 20:39:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACD1629580 for ; Fri, 19 Aug 2016 20:39:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A10C929584; Fri, 19 Aug 2016 20:39:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05E0829580 for ; Fri, 19 Aug 2016 20:39:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753576AbcHSUjQ (ORCPT ); Fri, 19 Aug 2016 16:39:16 -0400 Received: from mout.gmx.net ([212.227.17.22]:60499 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbcHSUjQ (ORCPT ); Fri, 19 Aug 2016 16:39:16 -0400 Received: from p100.box ([92.203.47.77]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0M3eDF-1bJ2jb2c9B-00rG1x; Fri, 19 Aug 2016 22:39:06 +0200 Date: Fri, 19 Aug 2016 22:39:02 +0200 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: [PATCH] parisc: Fix automatic selection of cr16 clocksource Message-ID: <20160819203902.GA17039@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:q6riS1KPqcf+lwRgf1O+KSHxXzN/nDv824Kc7M6sRpRpc8s9Zfw I72xfCbDhh9XWymjxJL9+9nd2clgrL4Id118bsB/Vjpfji2bzY+0FGSIS4LgueaAAFKiK/J lAMHjDubOzsCpmfSF9WGMCO3Tl/tyWxTRtN4ftuJFR6xE+CSEva4W0CX1f6Qy9PSZei00ZN elNTdV1B+NaCVsQ28UajQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:QXuVuvRVY+M=:CZKT3DU1ZhN9VgSg3Xo/i9 eoTfNMfdDiJ6J9YIGLuoTBbdXXGvs2E8Pqv5+WOOWacfzZorqTFweEJJOfrKDz9VYf3p3wn6r Wa4Tk77AP5sKSEMJRHisFWlHK87R+v6O6XIhs7tTVlPFeOw+dJkQkhk69C5iOEGYskSOaItOP A+BQL0RN8GdBwLluv/n3nYEEcwmejGTxC+4/6tnSPS27c4ZQtVGxWS5j8ihD8RbINTMuLSpAV 1NANbS/JXgFDspLkxwieqh6PSfqCxS4iXMAwmePqWUhkk/D6llyjv+ge+0paah7ZDqxwGjib7 qdzDOiQW3Yp4gjUDWmatwgaf8N5REHJ07Dyhi20vMlNrO1zys2JQRuTAH2zUqFMzKu++pdv84 gzPG0iWpnynKqgZBFLEV5gMCAhxm3e211QgYQhjdfp+9R1XxY3+RI+7IDolt3xn3UaBwJW0Dh 6eCTGUnljndFr+xwfBUxaYevvJNbBHLIhsVwJfjxkUHK+2x4UvIku9sC8wQOqWqixgd0C3P4P klUJTArydBfyCeK7P5XNs2w33ZSiS/067HK2wg5f9KzC+zGoObjt1t0AcxnXbEVlwUPAWZadk b4zucu2rs6jOEgKeCJ1Of+dB0IONI4row1CzrjdA5/7HkkCi0jIRy+iRHD7kXpNBn+/NI18Cx GgbzLbTfzuR/ZtB/zcmsWBEE8NA4QdlFipx1YJnmmVVyLwAfhn8j/8vhryqTGx6B7ykqSFCy8 6d7aIT2C8VdGeaSJN8TMtEMregZKyeODOZmALTYIXVdcjv1p16XDF0AAUc4= Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 54b66800907 (parisc: Add native high-resolution sched_clock() implementation) added support to use the CPU-internal cr16 counters as reliable clocksource with the help of HAVE_UNSTABLE_SCHED_CLOCK. Sadly the commit missed to remove the hack which prevented cr16 to become the default clocksource even on SMP systems. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # 4.7+ --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 5adc339..0c2a94a 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -51,8 +51,6 @@ EXPORT_SYMBOL(_parisc_requires_coherency); DEFINE_PER_CPU(struct cpuinfo_parisc, cpu_data); -extern int update_cr16_clocksource(void); /* from time.c */ - /* ** PARISC CPU driver - claim "device" and initialize CPU data structures. ** @@ -228,12 +226,6 @@ static int processor_probe(struct parisc_device *dev) } #endif - /* If we've registered more than one cpu, - * we'll use the jiffies clocksource since cr16 - * is not synchronized between CPUs. - */ - update_cr16_clocksource(); - return 0; } diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 505cf1a..4b0b963 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -221,18 +221,6 @@ static struct clocksource clocksource_cr16 = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; -int update_cr16_clocksource(void) -{ - /* since the cr16 cycle counters are not synchronized across CPUs, - we'll check if we should switch to a safe clocksource: */ - if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) { - clocksource_change_rating(&clocksource_cr16, 0); - return 1; - } - - return 0; -} - void __init start_cpu_itimer(void) { unsigned int cpu = smp_processor_id();