Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp126795rwa; Sat, 20 Aug 2022 00:06:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4fN57cnQdpIxyuyiGy2g581anQ3uzBeZt9pBIkRl1vJloS0RqBhkQky49mJV+OjKaWwoZQ X-Received: by 2002:a17:902:f54e:b0:16f:206b:74cc with SMTP id h14-20020a170902f54e00b0016f206b74ccmr10879260plf.170.1660979194281; Sat, 20 Aug 2022 00:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660979194; cv=none; d=google.com; s=arc-20160816; b=JYGIplKSqA7/mXya0J9doN8kA3Qq+1oVSE5Ot4EmFaVyxN2MgB+K9EZYte5Fzr9E3V Gi5QmeC3Q3+JxxG6WLIyUhBEpm4W7eJk4vqgWFu6QxpetSCrvIoEhYj9/AibS4fWZ6vu we3LNcwRqqCUjTqgGOKy6VKtaXNj+z/EKlDYQrD7p0ijrkOrwsSyQCvxuW+9booy0zra GTDSM53iay4jXGwgl14dAJKy/gNEUvOlT7ocWR5DAf2ovFNYC392iac197iduMn31/87 xAU9/WYAuMWcnkt5zYNmgvno+ZBWd/EkhsKjumSXvOrH98R5xzWMEvy5ixies3/opT8n D+tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tQCr/IgKCdRHY8LSP1T2xhus9TIrH4sruSlDTlO3guE=; b=Ov/Kgb00eebAmIFJAueGPRcDNOgwlZwIlRT+S7SAtpLhRdrprNCODFcKmoRUZynxuk 6woaOh7tPTN1CjlNzKjT1+LpnIVM64uLEL77rn9XdBNxXP17Rqrm0mffonZliHprr4ao uAAhGCOVOKXoIvRXgbNakx+7G59ai4EVDUXd1e0AzoAoRy8CjocZfjmRFACrzVLCiWPh YcMLZlVm5T+IRfFBYoiKYtsczKhhYXD568QeAaupZijKhnCCSK1YFNIYcIZ8vXQO1wcc Bk4Bnb+vQZCNZcVlqPZ2JQl6+5sZXOd91ITkYhu/QqAYcG6PS8M28fuYOA2R5GQP4rzA WzeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ei8+a9am; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9-20020a170902d2c900b00172936139f2si6528500plc.287.2022.08.20.00.06.03; Sat, 20 Aug 2022 00:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ei8+a9am; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244300AbiHTGz4 (ORCPT + 99 others); Sat, 20 Aug 2022 02:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243781AbiHTGzv (ORCPT ); Sat, 20 Aug 2022 02:55:51 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9A99C04E7 for ; Fri, 19 Aug 2022 23:55:50 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id p128so6969753oif.9 for ; Fri, 19 Aug 2022 23:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=tQCr/IgKCdRHY8LSP1T2xhus9TIrH4sruSlDTlO3guE=; b=ei8+a9amYDoCpz1QI5IeR7TYam6l5ohxbZI/T1kt/X1fsxq0YHMoqW0v47Oz3RAAAg xqTBjui/X0e6KsM/aQoYTgFSvGmF99FFNS9LZ9IUUFXqS+2SsqVFFtlcCCus00feE1zn 177JILJY5e9+mryKtBTtj6NEu3ew9G6pHpLNrGFtD75A/u7hyrlSrR2XB5HFYvS0WYpY rBvo9BaAWW58MQee7u1gevoo7SGHaBNpW9Z9OEUMw7wNbhzZ6vNcgkxJLop7lKC9ir4j 91RjGjhY5ljxNPiJmQ7gCbcwEM4b0f+BBaOto7yzD/0WEU/f23NVdizyHYhVKRoQONRo X0yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=tQCr/IgKCdRHY8LSP1T2xhus9TIrH4sruSlDTlO3guE=; b=57/iP6Q8FcEHMtgmNQt+ZzGvyrwbPpbQyWXgEPgFrEoCIt8uR7Xfdu8mTNrPZSIx0Z XLkXrzT1oH7fnQfuF+LndOTEw86lW0LIAH7vLmfej58v/fyOp5qtew+CmmHXdqJVlu08 8rMiuws+MasMY91SrHSmTsECZnDSys6cHD2Hk3QC/KaN61dzSmBbHJkRKRQrIMhnGODM jc4AnfgtAQviesagp6HqYwS6sWDkAmYw/ci48Pwqx1xvYkg26hK63ompzOPIM/oN7zTQ un6mRmVqb6WOakYEFVZ3moLwWa4L5V/XJ3WzmBQhxz+oVeKDC9XWpMHWT68NGSnNAFDn jaDQ== X-Gm-Message-State: ACgBeo0OOX+d8trbNoavJZ6auNxS5f5vOzxGqJaemtJNdtVDRNprMWjw 3MrvotWQ3R1JBfkkdpYcwnymKg== X-Received: by 2002:a05:6808:19a4:b0:343:300c:a1b2 with SMTP id bj36-20020a05680819a400b00343300ca1b2mr5420429oib.253.1660978549973; Fri, 19 Aug 2022 23:55:49 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([171.76.82.68]) by smtp.gmail.com with ESMTPSA id h26-20020a9d641a000000b00636faf5e2d9sm1661098otl.39.2022.08.19.23.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 23:55:49 -0700 (PDT) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel , Bin Meng Subject: [PATCH v8 1/7] RISC-V: Clear SIP bit only when using SBI IPI operations Date: Sat, 20 Aug 2022 12:24:40 +0530 Message-Id: <20220820065446.389788-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220820065446.389788-1-apatel@ventanamicro.com> References: <20220820065446.389788-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.34.1