From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 105F8C4338F for ; Tue, 10 Aug 2021 08:27:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC3D161052 for ; Tue, 10 Aug 2021 08:27:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238141AbhHJI16 (ORCPT ); Tue, 10 Aug 2021 04:27:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:52034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237565AbhHJI14 (ORCPT ); Tue, 10 Aug 2021 04:27:56 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E28860E78; Tue, 10 Aug 2021 08:27:34 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mDN6i-0040J0-Jv; Tue, 10 Aug 2021 09:27:32 +0100 Date: Tue, 10 Aug 2021 09:27:32 +0100 Message-ID: <87fsvhbt6z.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , Daniel Lezcano , Thomas Gleixner , Peter Shier , Raghavendra Rao Ananta , Ricardo Koller , Will Deacon , Catalin Marinas , Linus Walleij , kernel-team@android.com Subject: Re: [PATCH 05/13] clocksource/arm_arch_timer: Fix MMIO base address vs callback ordering issue In-Reply-To: References: <20210809152651.2297337-1-maz@kernel.org> <20210809152651.2297337-6-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, daniel.lezcano@linaro.org, tglx@linutronix.de, pshier@google.com, rananta@google.com, ricarkol@google.com, will@kernel.org, catalin.marinas@arm.com, linus.walleij@linaro.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 09 Aug 2021 17:52:00 +0100, Oliver Upton wrote: > > On Mon, Aug 9, 2021 at 8:27 AM Marc Zyngier wrote: > > > > The MMIO timer base address gets published after we have registered > > the callbacks and the interrupt handler, which is... a bit dangerous. > > > > Fix this by moving the base address publication to the point where > > we register the timer, and expose a pointer to the timer structure > > itself rather than a naked value. > > > > Signed-off-by: Marc Zyngier > > Is this patch stable-worthy? I take it there haven't been any reports > of issues, though this seems rather perilous. It *could* deserve a Cc stable, although I suspect it doesn't easily fall over with the current code: - When programming a timer, the driver uses the base contained in struct arch_timer, and derived from the clock_event_device. - As long as you don't need to read the counter, you are good (the whole point of using TVAL is that you avoid reading the counter). It is only if someone called into the standalone counter accessor that there would be a firework, and that's rather unlikely. Thanks, M. -- Without deviation from the norm, progress is not possible.