Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2161551imu; Sun, 18 Nov 2018 17:24:08 -0800 (PST) X-Google-Smtp-Source: AJdET5dDv0vEF87h2XYxqAgkiNhIAwr86SZStx2EQTstzOLMFbNSfVQq4v11jTSIA5en+7QU6n5l X-Received: by 2002:a65:434d:: with SMTP id k13mr18441199pgq.269.1542590648669; Sun, 18 Nov 2018 17:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542590648; cv=none; d=google.com; s=arc-20160816; b=M2onCdIeVz/oyQxM1BmWvRt3hiOhhbf+rg0Jsf/Hho3NI+E52MXULG0ambluWMd22k STx5BZWw2Uu2qMsVy9FcY9j7JWemqCcSGWMe16639eXxkYN4Mwhdvh9GgxGyyuVZCyDI +FCiZXgaYlKCpEYTMDd/9wua9TfAWkR+zWtRn4GOJcpcIExU7n1i6G3lzjk+I9p1IyUC JuuKzD/UOs9mQEPFW7hblw0RIrZMzpic72atAB0lpcXxU+UN4v1ft6gosvfvyuZYbysH sTZSg3eUH+4KP0W45O7UkFiq+OzoStN1FyaQ2Hh39yfCi+4NC0RSQBebZcoPs8x7qOp1 eQcQ== 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:references:in-reply-to :message-id:cc:to; bh=QXr6l9RKs40sPDJbXR0HbnF4HsFcGT6vDjB+8GVAeaE=; b=DVDyvFtq2qKEwyGw3yFvd4eiBtKK4nNGN5NplIhZ/05bGkITSkzBPDZXIkExUfxGNu 05Ff/y2Y9gGRSuCq0VXwraRk3oA6JN5e31ueHRNVUtP7T8KKp1fctobIkjRUqkHyR4Np PHEuTEnGJeKawdw2bu+Zflk9BHCUtpFXPqrGKAUbQjA+R+rt1unLn5+T+fpCSrTJE7Mz y7W9M8dHkO/5x7IBK7iDZC+UHgsv0UPCYH5C8chh4tAuvsbI2BHbEoZ02bVh0UwT6Cne qyNFGwXvOWFG6fWpyBGHbZ9TtATiUM70yVaLJo1d6zm9cJmDIHphNfRSsxK4iXHANU2L Js7g== 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 e13si38123838pgh.251.2018.11.18.17.23.54; Sun, 18 Nov 2018 17:24:08 -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 S1728287AbeKSLok (ORCPT + 99 others); Mon, 19 Nov 2018 06:44:40 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:49282 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728017AbeKSLoS (ORCPT ); Mon, 19 Nov 2018 06:44:18 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 0236329DFE; Sun, 18 Nov 2018 20:22:17 -0500 (EST) To: Geert Uytterhoeven , Philip Blundell 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: In-Reply-To: References: From: Finn Thain Subject: [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset() 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 hp300_gettimeoffset() never checks the timer interrupt flag and will fail to notice when the timer counter gets reloaded. That means the clock could jump backwards. Remove this code and leave this platform on the 'jiffies' clocksource. Note that this amounts to a regression in clock precision. However, adopting the 'jiffies' clocksource does resolve the monotonicity issue. Signed-off-by: Finn Thain --- hp300_gettimeoffset() cannot be used in a clocksource conversion unless it can be made monotonic. I can't fix this without knowing the details of the timer implementation, such as the relationship between the timer count and the interrupt flag. --- arch/m68k/hp300/time.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c index d30b03ea93a2..37cccdb46def 100644 --- a/arch/m68k/hp300/time.c +++ b/arch/m68k/hp300/time.c @@ -31,9 +31,6 @@ #define CLKMSB2 0x9 #define CLKMSB3 0xD -/* This is for machines which generate the exact clock. */ -#define USECS_PER_JIFFY (1000000/HZ) - #define INTVAL ((10000 / 4) - 1) static irqreturn_t hp300_tick(int irq, void *dev_id) @@ -53,22 +50,6 @@ static irqreturn_t hp300_tick(int irq, void *dev_id) return IRQ_HANDLED; } -u32 hp300_gettimeoffset(void) -{ - /* Read current timer 1 value */ - unsigned char lsb, msb1, msb2; - unsigned short ticks; - - msb1 = in_8(CLOCKBASE + 5); - lsb = in_8(CLOCKBASE + 7); - msb2 = in_8(CLOCKBASE + 5); - if (msb1 != msb2) - /* A carry happened while we were reading. Read it again */ - lsb = in_8(CLOCKBASE + 7); - ticks = INTVAL - ((msb2 << 8) | lsb); - return ((USECS_PER_JIFFY * ticks) / INTVAL) * 1000; -} - void __init hp300_sched_init(irq_handler_t vector) { out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ -- 2.18.1