From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755395AbdCTObw (ORCPT ); Mon, 20 Mar 2017 10:31:52 -0400 Received: from foss.arm.com ([217.140.101.70]:39752 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753427AbdCTOan (ORCPT ); Mon, 20 Mar 2017 10:30:43 -0400 Date: Mon, 20 Mar 2017 14:06:18 +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 06/17] arm64: arch_timer: Get rid of erratum_workaround_set_sne Message-ID: <20170320140618.GF31213@leverpostej> References: <20170306112622.13853-1-marc.zyngier@arm.com> <20170306112622.13853-7-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170306112622.13853-7-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:11AM +0000, Marc Zyngier wrote: > Let's move the handling of workarounds affecting set_next_event > to the affected function, instead of overwriding the pointers Nit: overriding > as an afterthough. Yes, this is an extra indirection on the > erratum handling path, but the HW is busted anyway. [...] > +#define erratum_set_next_event_tval_virt(...) ({BUG_ON(1); 0;}) > +#define erratum_set_next_event_tval_phys(...) ({BUG_ON(1); 0;}) Nit: BUG() [...] > { > + if (needs_unstable_timer_counter_workaround()) > + return erratum_set_next_event_tval_virt(evt, clk); > + > set_next_event(ARCH_TIMER_VIRT_ACCESS, evt, clk); > return 0; > } > @@ -487,6 +490,9 @@ static int arch_timer_set_next_event_virt(unsigned long evt, > static int arch_timer_set_next_event_phys(unsigned long evt, > struct clock_event_device *clk) > { > + if (needs_unstable_timer_counter_workaround()) > + return erratum_set_next_event_tval_phys(evt, clk); > + > set_next_event(ARCH_TIMER_PHYS_ACCESS, evt, clk); > return 0; > } I take it that the new conditionals are NOPs in the !erratum case, so this doesn't adversely affect the usual case. Thanks, Mark.