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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FFDBC54EE9 for ; Thu, 8 Sep 2022 08:38:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbiIHIiu (ORCPT ); Thu, 8 Sep 2022 04:38:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbiIHIik (ORCPT ); Thu, 8 Sep 2022 04:38:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CFA7E1ABB for ; Thu, 8 Sep 2022 01:38:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8379061BBD for ; Thu, 8 Sep 2022 08:38:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF448C433D6; Thu, 8 Sep 2022 08:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662626318; bh=7/+/Q28WsetQxkcMxruLY3ElubDT89XUfj2VYbo4/Bw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o2TWfZxfRwChwIciVNqQ8Cii9kyXjlRbrHzpaAMzFX21ApBVz/jWIYTP+hxPCFvmB EFPJUH5ERd9fQXCkkX9sK2ahCeivchkQYTKYfEISZttcu2iZdYcI/AO3rb2iJkA7bT LIY7ewG48Vl3hhKd6ePuJ4iXrlz2ooiZDHla55ri0swVsIXTiW0yiTPEIr5YqF9zQ+ szny0RaV9O3wlUAGoTZ/eoxw993L0BAA9fQQl4WjoFtbFAxWQk1GHYByXMss+PZHlo ym7mFpMYJ+mIsagDyV0r1I6pivl/N+JRDVkNhSzqIOSsOOmOR71wIlg7I4FGuSIjDX h7HWi6TZlNObQ== 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.95) (envelope-from ) id 1oWD3U-008r0K-It; Thu, 08 Sep 2022 09:38:36 +0100 Date: Thu, 08 Sep 2022 09:38:36 +0100 Message-ID: <87czc6uupf.wl-maz@kernel.org> From: Marc Zyngier To: Anup Patel Cc: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Daniel Lezcano , Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Bin Meng Subject: Re: [PATCH v9 1/7] RISC-V: Clear SIP bit only when using SBI IPI operations In-Reply-To: <20220903161309.32848-2-apatel@ventanamicro.com> References: <20220903161309.32848-1-apatel@ventanamicro.com> <20220903161309.32848-2-apatel@ventanamicro.com> 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: apatel@ventanamicro.com, palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de, daniel.lezcano@linaro.org, atishp@atishpatra.org, Alistair.Francis@wdc.com, anup@brainfault.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, bmeng.cn@gmail.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 Sat, 03 Sep 2022 17:13:03 +0100, Anup Patel wrote: > > The software interrupt pending (i.e. [M|S]SIP) bit is writeable for > S-mode but read-only for M-mode so we clear this bit only when using > SBI IPI operations. > > Signed-off-by: Anup Patel > Reviewed-by: Bin Meng > --- > arch/riscv/kernel/sbi.c | 8 +++++++- > arch/riscv/kernel/smp.c | 2 -- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c > index 775d3322b422..fc614650a2e3 100644 > --- a/arch/riscv/kernel/sbi.c > +++ b/arch/riscv/kernel/sbi.c > @@ -643,8 +643,14 @@ static void sbi_send_cpumask_ipi(const struct cpumask *target) > sbi_send_ipi(target); > } > > +static void sbi_ipi_clear(void) > +{ > + csr_clear(CSR_IP, IE_SIE); > +} > + > static const struct riscv_ipi_ops sbi_ipi_ops = { > - .ipi_inject = sbi_send_cpumask_ipi > + .ipi_inject = sbi_send_cpumask_ipi, > + .ipi_clear = sbi_ipi_clear > }; > > void __init sbi_init(void) > diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c > index 760a64518c58..c56d67f53ea9 100644 > --- a/arch/riscv/kernel/smp.c > +++ b/arch/riscv/kernel/smp.c > @@ -83,8 +83,6 @@ void riscv_clear_ipi(void) > { > if (ipi_ops && ipi_ops->ipi_clear) > ipi_ops->ipi_clear(); > - > - csr_clear(CSR_IP, IE_SIE); > } > EXPORT_SYMBOL_GPL(riscv_clear_ipi); This really begs the question: why on Earth are these things exported to *modules*? I cannot see a good reason why they should be... M> -- Without deviation from the norm, progress is not possible.