From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755549AbdCTO64 (ORCPT ); Mon, 20 Mar 2017 10:58:56 -0400 Received: from foss.arm.com ([217.140.101.70]:40166 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755020AbdCTO6o (ORCPT ); Mon, 20 Mar 2017 10:58:44 -0400 Date: Mon, 20 Mar 2017 14:58:03 +0000 From: Mark Rutland To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Daniel Lezcano , Scott Wood , Will Deacon , Catalin Marinas , Hanjun Guo , Ding Tianhong Subject: Re: [PATCH 15/17] arm64: arch_timer: Workaround for Cortex-A73 erratum 858921 Message-ID: <20170320145803.GI31213@leverpostej> References: <20170306112622.13853-1-marc.zyngier@arm.com> <20170306112622.13853-16-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170306112622.13853-16-marc.zyngier@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 06, 2017 at 11:26:20AM +0000, Marc Zyngier wrote: > Cortex-A73 (all versions) counter read can return a wrong value > when the counter crosses a 32bit boundary. > > The workaround involves performing the read twice, and to return > one or the other depending on whether a transition has taken place. > +#ifdef CONFIG_ARM64_ERRATUM_858921 > +static u64 notrace arm64_858921_read_cntvct_el0(void) > +{ > + u64 _old, _new; > + > + _old = read_sysreg(cntvct_el0); > + _new = read_sysreg(cntvct_el0); > + return (((_old ^ _new) >> 32) & 1) ? _old : _new; > +} > +#endif Given this is a static inline, I think we can drop the underscores here. Thanks, Mark.