Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp626658imu; Tue, 20 Nov 2018 04:34:34 -0800 (PST) X-Google-Smtp-Source: AJdET5cURKwMakBbaWuYoV/GfL8Be7RYXWP5PYEUCEC9uaOJpg0VDT5g9QeXvk3NwYcrrwmfucfk X-Received: by 2002:a62:528e:: with SMTP id g136mr2055258pfb.111.1542717274339; Tue, 20 Nov 2018 04:34:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542717274; cv=none; d=google.com; s=arc-20160816; b=la87uKZlU2CHo5zeVzjXI9qhj4yVib5/uLupoFeIfY/0PXSlvR/nYx7FcPlMbnV6aR zrg0PubHeMHFAGlSUTELtG0astK9Prn+7R6/Rr0pKyXaWhvQ5h3xFPsyH6mCoStmLdOJ U13T73F4r1oY956p9Bvfh+m01aGP5T3ggVRa6ZFmJmtI1VDOuRFvj/Ogl1D/Q8Mjh4EQ Inw1y9sif7WsH/z2C/F7oQa4YYTnEla2Y4eihq2um/ZuhJSrSTld87Y/2lgEwf4GvwYD BkKU+kHe+vl/BCGErk37iCsK2I3nwH2lUC2fZk3Z1EVkYLq6EY/KGQCTB2k6OhHm/6jZ Tmfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=mWgg3uv+S1ObnsH41uQXeuX4JOflnlud8yoIzF1kAh8=; b=JysVVhNXagT7ayynxZllsrD0lqjTdsON3yBBcxexm1PrLE0QKB9wtaMnWEEuP3KXP2 fEW2FBndHvdXh2cctj/qrFeg4i81ui20Z5vcQUZz7ZmOufhpUy1+hWqvnz6eZBjR+/3+ XP1ArbVlAlWoM6UesprnxZrvq+iUONHbvmX9W2OfJvuS7XkJUZwSt5p/QE/YARqd5FqD cGVwGo3I/bdD7PTaw8owrs71GFuf+y2CYxWIax4QmbWn464jFQXnU6SIWAJIlsFcsIrO 6dhTFHLmmMNFn7IzFXyyRWgQGR9mAWGbDHAlVgOKuf8lR3cL1LgbtsxMh18vl7VgF8Z+ 0HvQ== 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 ba9si5117239plb.109.2018.11.20.04.34.19; Tue, 20 Nov 2018 04:34:34 -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 S1726950AbeKTT2c (ORCPT + 99 others); Tue, 20 Nov 2018 14:28:32 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:56812 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeKTT2c (ORCPT ); Tue, 20 Nov 2018 14:28:32 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id D3B8329FDD; Tue, 20 Nov 2018 04:00:26 -0500 (EST) Date: Tue, 20 Nov 2018 20:00:32 +1100 (AEDT) From: Finn Thain To: Linus Walleij cc: Geert Uytterhoeven , funaho@jurai.org, schwab@linux-m68k.org, Arnd Bergmann , schivers@csc.com.au, Thomas Gleixner , Daniel Lezcano , schmitzmic@gmail.com, John Stultz , linux-m68k@lists.linux-m68k.org, "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH v2 10/14] m68k: mac: Convert to clocksource API In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Nov 2018, Linus Walleij wrote: > On Mon, Nov 19, 2018 at 2:22 AM Finn Thain wrote: > > > Add a platform clocksource by adapting the existing arch_gettimeoffset > > implementation. > > > > Signed-off-by: Finn Thain > > Acked-by: Linus Walleij > > Tested-by: Stan Johnson > > As noted for the Amiga CIA (which is pretty much a sibling to this MOS > 6522 VIA) this chip also has two counters and could use one as > clocksource and the other as clock event. > > Again I bet this is just using one timer out of habit. > > It will be an easy feat to make a clean clocksource+clock event for this > hardware as well once this refactoring is complete. > Right. Both timer 1 and timer 2 have a timed interrupt mode, and either could probably serve as a clock event device or a clocksource. Some Mac models have a second VIA with two more timers, but not all. (As clock event devices, the longest interval you can program is about 83 ms. As 783360 Hz, 16-bit clocksources, they wrap about 12 times every second.) If you use one timer as a clock event device and the other as a clocksource, there are no timers left to run the existing timer_interrupt() handler. So this arrangement would require GENERIC_CLOCKEVENTS=y, right? Then, wouldn't all relevant platforms have to support GENERIC_CLOCKEVENTS=y, if a single binary was to support all of those platforms? -- > Yours, > Linus Walleij >