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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D8938C38145 for ; Thu, 8 Sep 2022 08:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SwYJvqjGRNDv4JKbn5J3yJkTz6IOUu4dE7Psj0+Le+w=; b=ExHK9k4kUpibLx YeeEpiUqe42xooBLYu387R1aLrKHr0HerBd0pifJ0VRe2DzVlNwoalQk4/AtQZ6UexKWXVSX+V8vD TQaQ8weWckOABzV7LAPZ82Be39EppJ8yTsFHe9KBBg5OC50qFOZICAFOGKHJz8igVWQ2yLnv5Bg8t u9Jhy4Vn4gmYkI5jnsrSUmkHRiGemKrDSsX4nF3nlw027PUO23cK4aiyPpa3fZzIsN2oOm8jfT5qz s6JNDm+CEpl+C0jnl0VQ8zKaqS8nEow5S72nS75kpwVXPt3wZx/aqM4MpNaL6l79FYSXloVoVSilp Cv1By8nXaIPxzALevk+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWD3a-0015PD-Qw; Thu, 08 Sep 2022 08:38:42 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWD3Y-0015N8-3m for linux-riscv@lists.infradead.org; Thu, 08 Sep 2022 08:38:41 +0000 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 79FB061AEF; 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") 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_013840_286670_89CABD90 X-CRM114-Status: GOOD ( 24.13 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv