Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1807615imu; Sun, 18 Nov 2018 09:13:52 -0800 (PST) X-Google-Smtp-Source: AJdET5dAV0f58WUymFykxg79ZPYzNiudYHvFdc1+lLbW0/8u8aEf1JP0T618bFb53PX8WFM3sgKb X-Received: by 2002:a17:902:e101:: with SMTP id cc1-v6mr19435805plb.165.1542561232863; Sun, 18 Nov 2018 09:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542561232; cv=none; d=google.com; s=arc-20160816; b=a9WZwNZMDxy0M6ArbqlQylfSM7nJB4wJjaby3xoKjOp+evyoBHo+uzVHZdzS+xmaZE Cr10jqgQ/u2OWriXTwFg7VWhm4qWryJ+Q2jGoxUaHg1qbtdIDlGNJNVd2EKk6LNIMFW1 s5+1rMsGb1XCBaOS66XliSj2fX/UVjKB6N/QB+kD6mHyQwvoxeLvXmF5HUWIPMj48Kc3 DuShz1isK/8tUHP7dt99BVcR0zWlx7gv9KGs3jrhn8e5uCfaZ+EmATkdSFoOvfDtdXDA cwmeGo48RosoPYvAc+uv4rWOiOhF4GzfpwBTdYoDNBx1nzkS66vRnoCqOh8yabgJU5Dx TzLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=fDysCHqtBONx2FwyitiOkFRb75Hszn8W8pBqH2pk7DM=; b=QoZteamJphJqljjY0EZoe0bn9gxt3GItLixqx25lUrFAcRjrPeuVeBCp6x7IkxhyRP h3pYm6PimpiRhxibYAw6TxAntrYbhczqXDT32rd1D63EdEXL8ZOg7Bz2xePQ2c6JxIaY mOQcbyMlUuDxpMgoDpiWaIAc+NoIaRgbdiVjrv3FN0/TD5eJwqpFuzJ3zw8VYbGJkr1i itd4uBQqC0l2MCzUadIVBcQeW6l2pAWD9IK2Q776jGl59zMkWsxqLCsSKQf5hhtunvD/ k4Ms7pp7pcctmkEvw5y5qTrvQPZ5BTL638dfjuoE4SmGVb4YCAe9NRy98JQ3Zv7NZbd4 fajg== 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 g10si18730679plm.1.2018.11.18.09.13.38; Sun, 18 Nov 2018 09:13:52 -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 S1727089AbeKSDdl (ORCPT + 99 others); Sun, 18 Nov 2018 22:33:41 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:36852 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbeKSDdl (ORCPT ); Sun, 18 Nov 2018 22:33:41 -0500 Received: from p4fea46ac.dip0.t-ipconnect.de ([79.234.70.172] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gOQcp-0002jF-0v; Sun, 18 Nov 2018 18:12:47 +0100 Date: Sun, 18 Nov 2018 18:12:46 +0100 (CET) From: Thomas Gleixner To: Finn Thain cc: Geert Uytterhoeven , Arnd Bergmann , Stephen N Chivers , Daniel Lezcano , John Stultz , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 13/13] m68k: mvme16x: Convert to clocksource APIy In-Reply-To: Message-ID: References: <2f4015ba435f6f06b874295d2a47319875474c7f.1541995959.git.fthain@telegraphics.com.au> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Finn, On Wed, 14 Nov 2018, Finn Thain wrote: > On Tue, 13 Nov 2018, Thomas Gleixner wrote: > > Urgh. Then you have more serious trouble. If the interrupting handler > > calls any of the time accessor functions then you can actually live lock > > when the interrupt happens in the middle of the write locked section of > > the core timekeeping update. > > Does this apply to arch_gettimeoffset also? If so, that would mean another > bug fix patch for -stable... arch_gettimeoffset() can be called from any context. The only interrupt which can affect it is the timer interrupt. As m68k are all UP machines this is not a problem because: ktime_get() do { seq = read_seqcount_begin(tk.seq); nsec = .... + arch_gettimeoffset(); } while (seqcount_retry(tk.seq); and the timer interrupt does: arch_timeoffset += value; ... xtime_update() ... write_seqcount_begin(tk.seq); .... write_seqcount_end(tk.seq); So where ever the timer interrupt hits inside of ktime_get() or any other accessor the seqcount will make it retry, so the result is always consistent. For SMP that would be a different story. > > So you really want to disable interrupts across the whole timer > > interrupt function or make sure that the timer interrupt is the highest > > priority one on the system. > > > > The timer interrupt priority isn't always what one would hope. > > But I can certainly disable interrupts for timer_interrupt() execution > (that is, xtime_update() etc.) Oh yes, you should. Thanks, tglx