Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2176859imu; Sun, 18 Nov 2018 17:48:42 -0800 (PST) X-Google-Smtp-Source: AJdET5de7n+zaD+oo+8nqqBjHRVeBAN+fQC4MDyVpfw9ny5O3t6/V2JY6mukgC+7iCMUlXRKdU2/ X-Received: by 2002:a65:50c1:: with SMTP id s1mr17822761pgp.350.1542592122822; Sun, 18 Nov 2018 17:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542592122; cv=none; d=google.com; s=arc-20160816; b=ChcdwyKPI1sDsQDsazC3woZkVzO9Ufsu9fvRX6n4tnWNQjGtxdb14GdnlzinHIoeXw I1/I/7IIwHsDO1SbKs+QIcgl42VaTJwZ+AP6DJdZ4Q7/JnpkeeqFcOAMDmioemJ3YOfY z8RswTWogPdme9DPGypzz+yfItYDlI74ZGPOttObesQ+NrGgwJCGKO3dSFnxvRujByrM efBkaEO+zde4N1zRO6oZhE16n0RkjmQ4W4VVEkVFKv770kAr7cI46FfVAmhi5IEBnyOS mv6DmyzW/Z+bpo8rEmu2427+dSOYLvbS58DvdPN0nkaMFXfr5yb0NS0ifYsNKXKeeQx6 st6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:message-id:cc:to; bh=mNFEcxB4J8R9dSgbo5hfHQwTuD2q4AupbNrpHrP8HCA=; b=fORr3Gg6u4zNaTdQQS7NmaBlR2rBZxXMElTWnVry+yV+pgl7j8WpyBJ7GSHii7JIhd s3FG0Mo2y8RE90J+BbHm/cwOMbn/VvkVeID8hGTsKrWijO8OOMQSj1BtjZIbWolRxUFI wbIaRXfZYfsD8Q6lO/dVMLjwfrHP+/F0D1to7IxfA+LGSWm2RtYCQs3ftoGtITRM5toc EDhThtyZEWB4ZhEjihuP3owaiHCgbp2lKgJKa9xyDqegmz6ki0iNDb2nBeLChBLxstvl wLB3u302pzhfEWYKtH75o+7fwgl3GoY31jITjlzyoQHuBdCr79c0pZaGx0LgzhDE7Cgz 5uGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si40800389pld.70.2018.11.18.17.48.27; Sun, 18 Nov 2018 17:48:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbeKSLoR (ORCPT + 99 others); Mon, 19 Nov 2018 06:44:17 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:49090 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727419AbeKSLoR (ORCPT ); Mon, 19 Nov 2018 06:44:17 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 64FEF29DF5; Sun, 18 Nov 2018 20:22:17 -0500 (EST) To: Geert Uytterhoeven Cc: Andreas Schwab , Arnd Bergmann , Stephen N Chivers , Thomas Gleixner , Daniel Lezcano , Michael Schmitz , John Stultz , Linus Walleij , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-Id: From: Finn Thain Subject: [RFC PATCH v2 00/14] m68k: Drop arch_gettimeoffset and adopt clocksource API Date: Mon, 19 Nov 2018 12:10:38 +1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series removes "select ARCH_USES_GETTIMEOFFSET" from arch/m68k and converts users of arch_gettimeoffset to the clocksource API. Various bugs are fixed along the way. Those platforms which do not actually implement arch_gettimeoffset (apollo, q40, sun3, sun3x) use the "jiffies" clocksource by default. The atari and hp300 platforms have an arch_gettimeoffset() implementation which can't readily be converted to a clocksource. Getting a workable clocksource on these platforms will require the insight of a platform expert. The difficulty with these patches is the use of the timer interrupt to update the counter for the clock source. The timer interrupt handler races with clocksource read method, and both of those functions race with the timer hardware. Hence, more testing and code review would be appreciated. Changed since v1: - Dropped patches 1/13 and 2/13. These were a failed attempt to fix 5cfc8ee0bb51 and 4ad4c76b7afb. By adopting the clocksource API we can fix this issue in mainline. By backporting this series we can fix it for -stable (for m68k at least). - Dropped patch "m68k: hp300: Convert to clocksource API" and added patch "m68k: hp300: Remove hp300_gettimeoffset". - Added a new patch to address an old m68k bug pointed out by Thomas Gleixner. The bug can arise when a timer interrupt handler gets interrupted. - Added new patches to address old mvme16x and mvme147 bugs pointed out by Thomas Gleixner. The bug could cause the clock to jump backwards. - Various other changes summarized in the relevant patches. Finn Thain (14): m68k: Call timer_interrupt() with interrupts disabled m68k: mac: Fix VIA timer counter accesses m68k: mac: Clean up unused timer definitions m68k: apollo, q40, sun3, sun3x: Remove arch_gettimeoffset implementations m68k: Drop ARCH_USES_GETTIMEOFFSET m68k: amiga: Convert to clocksource API m68k: atari: Convert to clocksource API m68k: bvme6000: Convert to clocksource API m68k: hp300: Remove hp300_gettimeoffset() m68k: mac: Convert to clocksource API m68k: mvme147: Convert to clocksource API m68k: mvme147: Handle timer counter overflow m68k: mvme16x: Convert to clocksource API m68k: mvme16x: Handle timer counter overflow arch/m68k/Kconfig | 1 - arch/m68k/amiga/cia.c | 10 ++ arch/m68k/amiga/config.c | 46 ++++++--- arch/m68k/apollo/config.c | 7 -- arch/m68k/atari/ataints.c | 4 +- arch/m68k/atari/config.c | 2 - arch/m68k/atari/time.c | 65 +++++++++---- arch/m68k/bvme6000/config.c | 70 +++++++++----- arch/m68k/hp300/config.c | 1 - arch/m68k/hp300/time.c | 29 ++---- arch/m68k/hp300/time.h | 1 - arch/m68k/include/asm/macints.h | 3 - arch/m68k/include/asm/mvme147hw.h | 2 +- arch/m68k/mac/config.c | 3 - arch/m68k/mac/via.c | 150 ++++++++++++++++++++---------- arch/m68k/mvme147/config.c | 73 ++++++++++----- arch/m68k/mvme16x/config.c | 97 +++++++++++++------ arch/m68k/q40/config.c | 9 -- arch/m68k/q40/q40ints.c | 7 +- arch/m68k/sun3/config.c | 2 - arch/m68k/sun3/intersil.c | 7 -- arch/m68k/sun3/sun3ints.c | 3 + arch/m68k/sun3x/config.c | 1 - arch/m68k/sun3x/time.c | 21 ++--- arch/m68k/sun3x/time.h | 1 - 25 files changed, 387 insertions(+), 228 deletions(-) -- 2.18.1