Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp967579pxb; Thu, 5 Nov 2020 19:14:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJy73e6Ywtf1KSFon+pn5JrJ3+vU1t9aiGuvWm6eka3yz0V/ydbdlbApXumYWNlOwwl9MhCf X-Received: by 2002:a17:906:748b:: with SMTP id e11mr5262123ejl.513.1604632485284; Thu, 05 Nov 2020 19:14:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604632485; cv=none; d=google.com; s=arc-20160816; b=YF8OJgDhvpfns6m4NPkmnr1Go4fiRj1lPegLB3CQ8bSW6qotDSqIQqKYRpBaNe9Mdu /F7TAIwOIH7WQqQmMClMUJw/ygmsmZXd+MyxhK7ctStn+gW+Twu3OnUtCE+Qb6e0aDF1 +Tr+y/wU1dj5uI/uR75F4cN/Fo3Cf6c4wYt+hKPMk80zSuiEfSU8UZdh5kHhDfZTe4B/ 4oGM1aeooM4JTt/s9ND+8JwNwpc8fTMJ/BZ/J/uSWnpO6vqym5pXexBGAAHpYR0Pm2ii UHj88r3MpWkD4rQCdHDNAwaykv1pNQaTupcMtPdWbIMct3SWhFIy5XWeeTfbDJ5V8QN4 FVMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=QD/cL3Ht6qRcQfsfDE9dwqcri0F1B5GN2gke5aW8HZY=; b=JmTGRClW9dZHYN7Eu5a4h45VFp+fVLtohOZVxeAvZi3GuRyQba+KkijiBgN8gLc478 b3xP4nhaOfD9zwGUswk70XfaG+Y+I3vPaF9FNY8dtpYUiJEbW01doaJdZAQy986p/sWu Xq+iFmMk56Jc0OTSK/zoLYJQXXe2bX+BNQ3qktQtTDbrr29hHcrcz0/fpGUfPPX8v502 L8vfKjyDzQPM3C+TewADclh9F4XNqbU9884N9l3nIGWobB5bBF9aUp/HLXWtRBizq6sC CZewc6XGG9uC7HB5uQK88CcyZPd/6gDhn8JNqkmQagJoRPioq1zbRyw3QB+sTLx07xet RQMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ne6si3130394ejb.416.2020.11.05.19.14.23; Thu, 05 Nov 2020 19:14:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726003AbgKFDMW (ORCPT + 99 others); Thu, 5 Nov 2020 22:12:22 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:47340 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgKFDMV (ORCPT ); Thu, 5 Nov 2020 22:12:21 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id D3BE7232E6; Thu, 5 Nov 2020 22:12:18 -0500 (EST) Date: Fri, 6 Nov 2020 14:12:08 +1100 (AEDT) From: Finn Thain To: Greg Ungerer cc: Arnd Bergmann , "linux-kernel@vger.kernel.org" , Russell King , Tony Luck , Fenghua Yu , Geert Uytterhoeven , Philip Blundell , Joshua Thompson , Sam Creasey , "James E.J. Bottomley" , Helge Deller , Thomas Gleixner , Daniel Lezcano , John Stultz , Stephen Boyd , Linus Walleij , linux-ia64@vger.kernel.org, Parisc List , linux-m68k , Linux ARM Subject: Re: [RFC 13/13] m68k: mac: convert to generic clockevent In-Reply-To: <580c3542-92cc-7e33-a43d-bf6a68134a46@linux-m68k.org> Message-ID: References: <20201008154651.1901126-1-arnd@arndb.de> <20201008154651.1901126-14-arnd@arndb.de> <580c3542-92cc-7e33-a43d-bf6a68134a46@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Oct 2020, Greg Ungerer wrote: > > > > > ... > > > > The other 11 platforms in that category also have 'synthetic' > > > > clocksources derived from a timer reload interrupt. In 3 cases, > > > > the clocksource read method does not (or can not) check for a > > > > pending counter reload interrupt. For these also, I see no > > > > practical alternative to the approach you've taken in your RFC > > > > patch: > > > > > > > > arch/m68k/68000/timers.c > > > > arch/m68k/atari/time.c > > > > arch/m68k/coldfire/timers.c > > > > > > Agreed. It's possible there is a way, but I don't see one either. > > > > > > > For arch/m68k/68000/timers.c, I suppose we may be able to check for > > the TMR1 bit in the Interrupt Status Register at 0xFFFFF30C or the > > COMP bit in the Timer Status Register at 0xFFFFF60A. But testing that > > patch could be difficult. > > > > I expect that equivalent flags are available in Coldfire registers, > > making it possible to improve upon mcftmr_read_clk() and > > m68328_read_clk() if need be -- that is, if it turns out that the > > clocksource interrupt was subject to higher priority IRQs that would > > slow down the clocksource or defeat its monotonicity. > > > > The other difficulty is a lack of hardware timers. There's only one > > timer on MC68EZ328. On Atari, for now only Timer C is available though > > Michael has said that it would be possible to free up Timer D. Some > > Coldfire chips have only 2 timers and the second timer seems to be > > allocated to profiling. > > FWIW, I would have no problem with ditching the profiling clock, and > using both on ColdFire platforms that have this. I doubt anyone has used > that profiling setup in a _very_ long time. > If we ditched the Coldfire profiling clock, it would be possible to dedicate one hardware timer to the clocksource device and the other to the (oneshot) clockevent device. That's a win if it means that the clocksource can use the full counter width (making timer interrupts less frequent and timer interrupt latency less problematic) and run at higher frequency (making the clocksource more precise). Also, note that hrtimers won't work with a periodic clockevent device (as in Arnd's RFC patch). If you want hrtimers, I think you'll need both hardware timers or else re-implement the existing synthetic clocksource using the same oneshot timer driving a new oneshot clockevent device. Please note that the lack of a spare hardware timer is a separate issue to the failure of mcftmr_read_clk() and m68328_read_clk() to check the timer reload interrupt flag (which may make those clocksources needlessly susceptible to issues caused by timer interrupt latency...).