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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable 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 1CAAFC10F14 for ; Mon, 8 Apr 2019 16:05:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D232220857 for ; Mon, 8 Apr 2019 16:05:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ap/6hhtb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D232220857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NiK/5W4+lo4hfAsL3V9qckv56/iIkyTQXl4kDKIxMyU=; b=Ap/6hhtbLcNlZs +uf6f3+oPFwGUg+uOfj8xPBLXvvgyZKgsYwXnBZ+C/rOdex2gQ6K0W09kQDqfjlYjoh05g8q5yoFe DMzMjSP9Hewa2zA2wU6PrMMgnoE5QBYh3i+bBca6YJFUt1CDxTPz/DQX0HbHS9qbkv3na6MvXNYHy CVrCpMZc3HGe8BI5a4AhV0F4m+xiFVMVKgJH1JoEzv4F2RxNRThPDtDB8ZiFlNqtgXS2wvSxUiaTs /h76XDRwMU4Qn/ut3Dzdl2zk87leEXlwAAZ+gVCW/m8heD7DrvfIRNGaudD6ftYGm4iTP5eHvjsNj W3PMFsE56i8o8JQ96Vlw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDWm5-0007Dt-Dr; Mon, 08 Apr 2019 16:05:33 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDWm1-0007DD-Cj for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2019 16:05:31 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E37E315AB; Mon, 8 Apr 2019 09:05:28 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 236493F557; Mon, 8 Apr 2019 09:05:27 -0700 (PDT) Date: Mon, 8 Apr 2019 17:05:24 +0100 From: Mark Rutland To: Marc Zyngier Subject: Re: [PATCH 6/7] clocksource/arm_arch_timer: Remove use of workaround static key Message-ID: <20190408160524.GR6139@lakrids.cambridge.arm.com> References: <20190408154907.223536-1-marc.zyngier@arm.com> <20190408154907.223536-7-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190408154907.223536-7-marc.zyngier@arm.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190408_090529_437104_DA550239 X-CRM114-Status: GOOD ( 20.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , Catalin Marinas , Daniel Lezcano , Will Deacon , linux-kernel@vger.kernel.org, Guenter Roeck , Wim Van Sebroeck , Valentin Schneider , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 08, 2019 at 04:49:06PM +0100, Marc Zyngier wrote: > The use of a static key in a hotplug path has proved to be a real > nightmare, and makes it impossible to have scream-free lockdep > kernel. > > Let's remove the static key altogether, and focus on something saner. > > Signed-off-by: Marc Zyngier Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/arch_timer.h | 4 ---- > drivers/clocksource/arm_arch_timer.c | 25 +++++++------------------ > 2 files changed, 7 insertions(+), 22 deletions(-) > > diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h > index 4a06d46def7e..5502ea049b63 100644 > --- a/arch/arm64/include/asm/arch_timer.h > +++ b/arch/arm64/include/asm/arch_timer.h > @@ -45,13 +45,9 @@ > (__wa && __wa->h) ? __wa->h : arch_timer_##h; \ > }) > > -extern struct static_key_false arch_timer_read_ool_enabled; > -#define needs_unstable_timer_counter_workaround() \ > - static_branch_unlikely(&arch_timer_read_ool_enabled) > #else > #define has_erratum_handler(h) false > #define erratum_handler(h) (arch_timer_##h) > -#define needs_unstable_timer_counter_workaround() false > #endif > > enum arch_timer_erratum_match_type { > diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c > index c7f5b66d893c..da487fbfada3 100644 > --- a/drivers/clocksource/arm_arch_timer.c > +++ b/drivers/clocksource/arm_arch_timer.c > @@ -372,8 +372,6 @@ static u32 notrace sun50i_a64_read_cntv_tval_el0(void) > DEFINE_PER_CPU(const struct arch_timer_erratum_workaround *, timer_unstable_counter_workaround); > EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround); > > -DEFINE_STATIC_KEY_FALSE(arch_timer_read_ool_enabled); > -EXPORT_SYMBOL_GPL(arch_timer_read_ool_enabled); > > static void erratum_set_next_event_tval_generic(const int access, unsigned long evt, > struct clock_event_device *clk) > @@ -552,12 +550,6 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa > per_cpu(timer_unstable_counter_workaround, i) = wa; > } > > - /* > - * Use the locked version, as we're called from the CPU > - * hotplug framework. Otherwise, we end-up in deadlock-land. > - */ > - static_branch_enable_cpuslocked(&arch_timer_read_ool_enabled); > - > /* > * Don't use the vdso fastpath if errata require using the > * out-of-line counter accessor. We may change our mind pretty > @@ -573,7 +565,7 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa > static void arch_timer_check_ool_workaround(enum arch_timer_erratum_match_type type, > void *arg) > { > - const struct arch_timer_erratum_workaround *wa; > + const struct arch_timer_erratum_workaround *wa, *__wa; > ate_match_fn_t match_fn = NULL; > bool local = false; > > @@ -597,16 +589,13 @@ static void arch_timer_check_ool_workaround(enum arch_timer_erratum_match_type t > if (!wa) > return; > > - if (needs_unstable_timer_counter_workaround()) { > - const struct arch_timer_erratum_workaround *__wa; > - __wa = __this_cpu_read(timer_unstable_counter_workaround); > - if (__wa && wa != __wa) > - pr_warn("Can't enable workaround for %s (clashes with %s\n)", > - wa->desc, __wa->desc); > + __wa = __this_cpu_read(timer_unstable_counter_workaround); > + if (__wa && wa != __wa) > + pr_warn("Can't enable workaround for %s (clashes with %s\n)", > + wa->desc, __wa->desc); > > - if (__wa) > - return; > - } > + if (__wa) > + return; > > arch_timer_enable_workaround(wa, local); > pr_info("Enabling %s workaround for %s\n", > -- > 2.20.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel