From patchwork Mon Aug 30 04:17:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464521 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 90821C43214 for ; Mon, 30 Aug 2021 04:18:45 +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 59A4A60F5C for ; Mon, 30 Aug 2021 04:18:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 59A4A60F5C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6y1qP0t6EkK2MVz3kxSs3dzptcjAkBctKTwlUr2mv3U=; b=PdSZviwFZ77lhl sndsmEbDcbFsqJT9+s/7DCENP9o0fO4t8kZRfMB697Ss5Ge9K9ZR+xlDxjp5CGcfugImgTr9cmjE2 nEXk06bC2qYkiOeWeP6gFBb73uUbkRPS8iRflapRiBWknL2+BIaMpMU3r7KdhGWJh+TmTl4kW8CtX yPIdDY+u3J0jF26y1hGLQtMj/AvJFzTSz8BcaCMkWSmrK7x54Vgv1FIFvimjOytbdqm6IngEOHjKa Lp0P/+LkN43tDRRxFJJFaY65CRJN4SuB8JTlURD61rt4eqtdt9lfuk/nxRJ9AZH2Zey6LeqsFcRux UnMTV+tKO5b/Umo2nbVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkQ-00GOPx-Ts; Mon, 30 Aug 2021 04:18:14 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkB-00GONP-Qq for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297079; x=1661833079; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=kRFIsrXRxjx8BbYZWZU/yYhgpwiiKVcT4u/SpXRbxcE=; b=pn2B7m+ID0E9oiG0BDWcZpvD/h2K36BncBlCVVo0TeV7NrCLbl/DvnYZ b42raodDALLeKTBeJC4S4HbEKAMGt/l9ZfDfUMJL8+GiAcyn0GYVycAsl VNUvhLeiwi4ZIwCt0T00Vr7vJuvaom7jVK6ZYusNq/T5LdXoFSPjBqUW1 wiq5cpSTbzzJd8EQI/HLnTHY+D03/ZMgbgk6dFZWOQ3qFt6qgTMMGGqsL HsSfMSOeXA+YkeyXEvtObTc0YYPcogUZUFDz8vnlPa0hNnPQVHypcIaSv ypQaStrfwiWDwk6KDbOyk3YFP77dSuZVnjKCnDksrG4nkCx0o6JH6hZXY w==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="290332138" Received: from mail-mw2nam08lp2177.outbound.protection.outlook.com (HELO NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.177]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:17:58 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gfQngrDvBi5ZQGYkERaBuLCxiOEdKtiLvE7gbifb7zkFRw6ZlmKkVuYX4o8fTZm8C4DKJHt1eO8ZEueNuu33M6G/LVqr/GoqsblItmkKzkDapCVz/rRpOmUIyEdeFq7uppi0JAkKYhxZebV4iwh54S1FaNaCnIOXst1J08xN7oWwPEB6yLtpzqAYKJPrbJzZnWRgujh3mSsd7vvIy8PVC0Id0GhRvRRuB8qvrRVlJIe86glVsa0scvhoNxkYZ0DrnBnSHbvzah1lc6oZABzp98mLD0XnayZgsLhJ+6EMtFUNxtG7ia4rKGovdqaF2Ai0UNhOiuefuI9oynD2y8QP2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cOyALsSZyM5c63OvTUlUo42PR2FT1T9JpuApyyCliEY=; b=Ax4bUn5DvsycuDOiROqTglEcm6ShYZXA/tItOccDoUbv90SmZ9VgeLMo7d9cvwwpUn+38f7xU60f2vgBfxIhrynXNUBRHoOTlywKUTDp8czoYbdaovNQHkQ3ExY6a7qMVXBNctDbV5YJyoKy7V+Eim2QGtsGfvHNC62p7IPoNL3+HAxeCWIXupNXZB35C+fjHqvQRhML1+OYgmvCgvy2uIJWYfhzVekK7y/ZSrWnVJ3yJOVK+7ydJrt7J2QE5paalJtjCLAX33mapKXeV+u3Obzd/3FzLUhUjRK4s83Bt0eg0jjaoibp7L/QxMKLlW1Z4Yo+XY9Y/oRP5bkiBXiwDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cOyALsSZyM5c63OvTUlUo42PR2FT1T9JpuApyyCliEY=; b=FmnTkMcdwWpymqKtIAqVh+Nq24MKuFy1Yw6z6WRliL3pZQdD1CIgeSWDgh1vfchTG02xRi/qA7+k/pOh9rw7n4pMtgP0znrtdH747Ge7PTIzUEe8rH736PzqOV267FgajIFYNcXxpC/iFx2SCEkMd/ggo1XrbfiCu0svlmR99kU= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB7838.namprd04.prod.outlook.com (2603:10b6:a03:3ac::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Mon, 30 Aug 2021 04:17:58 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:17:58 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Bin Meng Subject: [RFC PATCH v3 01/11] RISC-V: Clear SIP bit only when using SBI IPI operations Date: Mon, 30 Aug 2021 09:47:19 +0530 Message-Id: <20210830041729.237252-2-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:17:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12f9beab-9c82-445d-13df-08d96b6d25ba X-MS-TrafficTypeDiagnostic: SJ0PR04MB7838: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fI+ifOaghA2vXGua1TBMHZfQELWxR3D3PnDv/A6Nm7PWm4RQjfiUeH69YQ3OrmTFCwGcpL1X80uM6ALio7jUeT+t0I9vZNKjdi/YsYT0nox7hiNyws+sLvacKMoyHNvVTKbjVl24SN8o5SH77J33impvRo9qOVtWa1jc046oK8c9VcpAtFUiMQjZqGsRo/884CzzwtdEaxwY69ojv8k/fjQamnAnW/yw63MThYue87qUX/7GqLPVYSUD4aUGmm/t1Ka6q8YxDgRzhV4oQ5HrI0bzMTEDYpiCbmRR/YAcxs+AW10cz5nbUwaYXEK1JPBzQMRQmH1oXN3aR/9V63mUm4ZLxinjjQXiaN/HYPbMrDJ23vGkNJXsgSz9fkdbk4vrSPIk6+4Iv2NqKOY273cLfnSwBYQgqvGD96J1IyMeztoErawKOeG/KXdjk1p9rNlZ7LEgimvaYmZuk/uhzQlrorRd+hC3MRwNyjG6CIen/gF14q0//HMB1fsSKM18eKJOr1PJC0Nx4YQ5G8pfYHAQoD683BEurnUl5g7ibHr0GvOAddj8MVQaQoW9+P2J9b1tMahg91dU3g0o51TG06xe5CfYSmknx4O3AgofOBwzXexWkXS/7F4rug8S4qNpRfV8twwNPD7D/kk+RegT6DiuU5mvofdy3SM43oXjwOyrc8eTZEnS+i0+iWfElFKG0fdUEs42hIc2cmW+iDW9eJfZIg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(346002)(136003)(376002)(396003)(366004)(66946007)(8936002)(83380400001)(2906002)(86362001)(110136005)(4326008)(54906003)(186003)(36756003)(66476007)(8886007)(8676002)(7696005)(52116002)(66556008)(316002)(38350700002)(38100700002)(2616005)(55016002)(44832011)(956004)(1076003)(5660300002)(7416002)(478600001)(6666004)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1V36bfYsobGKMz87kw70NsUCPboWr+6ESWElaL2x+jsS9/e22q/KujZRVkzxDM3Ivhw175xz9Hqx3WXiPF7N3cQs+I2KZK/JbgfVEVixOuvV6pbQLFIU7+NBrYjhzJKVIjoChmP9NVl0QSXeFWb9TelGoODYHtS9Fgp8J++7FWFq6r9H0SX8UsAYD6cSWfgRSOss6KewtOH3RwyjrqMvNjVRGvbOYobY1FjJs/CJhPbn/Loqjkdq9TU4wp96rHMnuZdMLa5MWnPXMQj9F+KapMpoxv8uWkpxoeinbkJUtW8XXT4AlLck6XXKassRu1A6K7ZXFGlERp6nuk/QyTDDOP5Ox9BBb83tTX49YKi8E+LdLtIdVCfo5DrVqCKOZgkwZ3nbzrD1HRzx65x5G2bvNTVx/N0usRFc86LR+yhZjndddVXLPOW/j83Fv0hEZpME+exqNa7r/rwWMtI1dlvDJDHzvOYZpZoS1Xk6QEuRICFMz2bIyal1vWILR6lCsRnwkuJXl+tCPJtLMCZCzLPp1E/r7/1CITTkAEqaYYcw7ik6K5Z/czUN8A11jVGGO5SqSFlo4ARjGAAxgKZSEMRZI0TYemp9wL4Awu5UyzDMpM1AfdD22jMuHdkwTMhSlPhR0RD7PrUlWEs5obBH+XSQwHEzjXGAHXx3z3EV6auqTTTuJ9z56e2ub+UbaLR0TcjrAUP9oQIX6yyJ15Z++0IXaGuYYpEydrriZiRCU7lfjQj4eq/FqGuocoh10gL+AcWKBnahrd7VY0ppUI3Hv4iRxOcNHyno+f0axDhiSM6NYTurdkBtf13PsgkMK8mOM7AwQs5WoNC65M1+Zyb3fu5jd6n6ZSSUauAx6zZMAOYjRuv2aPobzi9L686L/yEwoV9CxEw0U3Ohs7OwT56POaMEbKJW/Uy9G/za/SjL57Lxm7oQytNpmUHofTdfQhlWZgzBhO8E9paNQbaXD1v/8m7uhzo8+Cjm2zBcG5bMMVR/dyo1C60DEuV/uxi/tvaakA+01mvjiJyDCPudtF0k5w3u0DG9eo9K/utTK3sNxWk05NapoU3c/N7EVEQ6cwObsQuGteHwyGa5ctEFqkFEgyB4QbhQ8uURwBucK5ZWN19SwaBL1pTsKYAtRr6Snn+CXv+xKRihBr+Bp6RtFkQcTvW7u4HcXWKGwukZtkBRJ/JyEmw4+d2F39YBL14FNZFU2sgT0bxeG8srK+YoipZqEDKPvi5HaPXFf6iwM59JxOLfcF1aE8fb5UiuMkReaWxogBcsxu/oh4PCTQBc3vuiIuZW7asRIP7YwUQ0lRgp7pZHEUbAk59JwB8IM70OOTAEONO+ X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12f9beab-9c82-445d-13df-08d96b6d25ba X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:17:58.2047 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C/QQ3OTV3d8b9eoPUiYFBb2/LRt0wmct4odilOcv9K5/CVFtqkdzgpxjQcFyU3tcuLq39SDx2++DGYk8oYGf6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7838 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211759_922303_61E36F9B X-CRM114-Status: GOOD ( 12.81 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 9a84f0cb5175..8aeca26198f2 100644 --- a/arch/riscv/kernel/sbi.c +++ b/arch/riscv/kernel/sbi.c @@ -598,8 +598,14 @@ static void sbi_send_cpumask_ipi(const struct cpumask *target) sbi_send_ipi(cpumask_bits(&hartid_mask)); } +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 921d9d7df400..547dc508f7d1 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -99,8 +99,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); From patchwork Mon Aug 30 04:17:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464527 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 F18E0C432BE for ; Mon, 30 Aug 2021 04:18:45 +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 B380660F5C for ; Mon, 30 Aug 2021 04:18:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B380660F5C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hfBdDxEgiaozx5y3rOLHTwAAkjAWPJP5aswCd3jKSvo=; b=hJc68FiRfxv+hf BWbv6hupPa+ucxxySZgQlLgNrPEpwBZOpywcULaTnnxuKTzky14bpvbtTTyWZ70F5Pa0JIgC50g0x 9dK14BIp0jadq7sY4v25fGEQp2BXnfc//W1XJ6OkeDuzHHmf/SyZbOUClE7BaaIFxMaqwtH3KBOPH BQGbdenjKrQ2NEMM0PI1eKYSE2W24+/rsLAChoLr+gNYuU4M6iwF818as7XLGxFYFtDHdYoWog35+ 8wP5OmcUTozMW59DBz6BhRWtVZMm1vlClMtKORGO6QtM/pO8Ycp0gEloKBz5Cz0EBbXT8sjihTX+Y g4KM2mnDJJoQCfp2pXlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkS-00GOQF-LM; Mon, 30 Aug 2021 04:18:16 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkJ-00GOOP-7q for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297087; x=1661833087; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=Cx15Qou/sWHshucAv4v1UhYD59B6SbXanyGAok5HBFg=; b=nazJ/hhlssp/NLKf9aCUYTrlB8HKQ+FRHR6JT5Ja/Ip5Pp5aig5dlLW/ x4E3RFTZ2b0X81GNmWIoVkDXF8RQe9KatT0iv4mGF7Vh1FELDHVLOYQJY em0/cdEtGl/mXdtU4KISq6r1m6jcNeoKFRI2iUZz4AdR3zLTPgUFV9hXK cuW4UyNmxKyoR1UiZvu/lRbOUb2dqCwd5jtFcXY4ltoGzrO1Sjm2W+zj/ MCMbojDKpd7y78vcStkZDY6Aas1rFCu80qLQM9Rd5zVETwOpI1+kw87mI CwYFcZldaivF23IpAI0+FSByDYkCRQufL9sP0XiGanGNwAEy7zYcugKRR w==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="179285345" Received: from mail-mw2nam08lp2175.outbound.protection.outlook.com (HELO NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.175]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:04 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JXpqurK0WxCS0+Zi9JcnLsEIx9mXRL35IJfJQvRA9DgxAO9SR5vWFpva1i+5BgTouxHb75m4a8Mup4WIc874baahzmyRpwXkuOW72fQT3z7UT3WO5MErQN9HJnbutywwLf0OfKvqn25ZqOs44+C90jSdPQ13M3yQ2NUUeLSgCW09ZketOEmxqflmEIo0RO3nd8ZzxPdrt3QHsUV/zAPRqUyC/anmXwpFFDNbnx9tDt43WTKIx/Mbe5U6rW6zXdMkif5vNYqym2CGbpB0WLiJ9ZOzNuUCcvDGNFO94YSCk/S5qMfmJMYJzd/lKWyDxeThw+Ns0Hmno/IatKjcifrg8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fyBvuSOEAZNI/lfJCeYih89IeUy/RMfg9Voj/s1Ppyw=; b=J347Sw//IxcSO6kAJs/S6kSAanJcpuw+lavaNhYdmGQ/V03T5L/wjD1yjTJeLiiUHiV99ktuY+r+yU1QIQIVwEReWjRfn2yh/i5onV2foqcFp8NPPXES7FYYnBwDWmyKWEXAOEFVc9TyPSaRrUzIg6u4YPzY2GT0vnnvqh0J6zzvLMW18fn00ifurknVDxpmZpPYaNuJBV3Q8G4yk3hJHvLPYKxw15tD7az9DEBDDRTtCcMmOj+Ev2sxGmNtxkLUrtIvTxpkxzoc9V47PneZdcFmE3wJMxTHFuGClJi5nDnBT5IiBNjq8LeTiUcRSGQ0h5WTlcqmbKn+JziSwX4EvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fyBvuSOEAZNI/lfJCeYih89IeUy/RMfg9Voj/s1Ppyw=; b=dIjgqTDqMaEfGP03WWvaANUs5M9pYmjwlSt/71wFzfbbzD/+nKRHSxIh/mmjIe28nXB9Y1qFy5UVM7VFGT3bq1JGANTmd20o8SJpE48A6a71YaxI/jXlySI4lSIs7jYk9QT+O6p7RK+GyN5mvgpbXOXFFr20A9SeJcytIeytoJE= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB8359.namprd04.prod.outlook.com (2603:10b6:a03:3d5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Mon, 30 Aug 2021 04:18:02 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:02 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [RFC PATCH v3 02/11] RISC-V: Treat IPIs as normal Linux IRQs Date: Mon, 30 Aug 2021 09:47:20 +0530 Message-Id: <20210830041729.237252-3-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:17:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c34e37d-b663-4127-ba50-08d96b6d2846 X-MS-TrafficTypeDiagnostic: SJ0PR04MB8359: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:146; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cfhJTA3hFoqbz42iv52t+SHP+CBSTKo7/rWBMx9tIr9V6p+W5w76EXaHA/amIVqOgXNazqEZsGH+bofHbm6rHKuZLH2QFEOEx+DH2ILwROYwKpXk61FtnBLm1ZTAZWdCkJXB7SA8rzGfkIIYuHM9zTjRRQmFzdt1GlbdafDzr3de00N3yQgeVBaYNYEADu5fkb+yNcfEGiUb6SNdYAY4NhUrHlZqxDik8jwKCymD7u7s55U5mwS/NCVb1FtdsiKg9rMF/JqSDFk45vVgh5E4+/2kFnmaJPInnFhkebUrN2KYGFZxsAAsMct7NuOGykkK9pkMhntA0LGq8UGrt3nYcIhSJgk30Qv6p0yJ/cYP1XXGca5UFt9yHnHSWXvMrXrcX7OQgXTKJHhYQJhxf4fXluC60s3RB/yj82K52wr2wJPR+pcqU5Jp3BMDIIuks/bFbCS7dPhFqG7tPVHmlfp0pm34k97M9R5SE0Xy8AFyrh/EBhRkyKoVRYOoQn1Dr+l6zdA2HPVq0BHyuO2l2vix9tKFQ7JGnO7d1dCzMgtWNT516X57dIM8KVH/OB+p6/ljZ5Q6BMCeSyWHOS2eyPCiu1AW/X/GrTHd7yEXek8+9DQ6ox3shCpEmPJ6PmbDAYu4APoEhpRK2yAiPJDD97WwDuhHLyJ4JmnF04z11Hc6I39Nhf5htid0Hpp32rmWtPTTeDSp3lAka7rJP5+5Pzgpzg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(7696005)(1076003)(316002)(7416002)(66946007)(110136005)(86362001)(26005)(4326008)(8886007)(478600001)(8676002)(83380400001)(2616005)(956004)(52116002)(55016002)(36756003)(44832011)(8936002)(38100700002)(6666004)(186003)(66556008)(30864003)(2906002)(5660300002)(38350700002)(66476007)(54906003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sBroe2uw9yZQT89/S0av2bxw5W9LBN+L0thL95P6nIRaMxc0fbJH2mx39hlfa8mLme6TTqXifnkpctQlH3msEwGNexl/KgSSTMMajuhtRz6zb7IZE2WTtyRZ2B/UIiYDVkx9t7M2MEk86zQWmapA4QrnXkNe0CgQ18UsHp/TwubMyfvwn0gew8Y8UbgL3iI7pR1g7XW4fyr5jxuF2XvTgPqB9zFTx5k2m13aN7T+YqcG2wciZZWrtmZLyzIBhJUtyCSMXhJI7lbJLnNMKNQSV0AZ8ABXhk5OWK2jbfBjbXyRjyqWSRz/FLq1NfUfbGfUJ/3zobMx4ldLT8caQiIkmyuiHj92Q1igg84sTNJzMrBUQrr/7o8O5btOY1kRZW5f2F8d3I7vFf6eO7zGnXwTW8n6YXeJtSgsJwQS3UVCdqoMzPdRRaTlXfvv6IlLlGabjL/h4qilQDdaNccLZMQ1YxMmRfhuA38R6HfIrT2I2jaWYGtgAzMHjSrRaC9h9LNlsz9LYOCp2qc0+wGUjVieeBSdeCP+euwR2RjvTzD+GkmaW5ZwnaXJGcPnLV6warX5teBYdcEgtsnF1wuWGG4G4GFUdKpJAUT9gDhK7L7PGG3sY+7IIRiYwEVz+ulpYZIO/ec5NLf5mGday+o9ztX21smHv7ujl6n031KuobR6cZfp4re1DtV9Obrh6WtpJllc8ACLgzMWKSdSTy124jsHjpNpOwxde91mPVbmiggpSWM2e33lSAwIgF+/jidK5HuqZMExgi/0Xkb1bhIejsTDR9fX+4Xmr75gvL+EP1FkI+ovB3HCiQphq0kK2wdGnHJ1W29/5uRxdM4ov60/Lu9DUdXenBUAiPJq8rTeWAq4ZF4SLAa3mxFZzworw/34B56vucSIOpFC6rYcMsKlZ2Bap+vSZOA8pFZIF8by7D83mf9ndfAs+ZCQ88R/1jcBV0O1kpMgaIFUe7ZJfez24gO7j9VkPSThDrkRy16OhpAFgamgi8vN7AyDtxIxzLudwH6AcXs9mjDLbmcUXY5AeuU+mQZKf2hANJRVbwCT5Ukv0YIDEpG7YiBLj3DwddcWb5Obv1bugk1olLbA5k+bBgMHZdA4meoAi5EBqoRk89QwcaW7xJz9ubu+2bDeopcMkpDft3XB0Vzlq8XsAZS7QhLJi7RLnd9IlmEKB6BfG13AH3OBNGGHteRIESj4zKvJpmc0Fw4M/4Bv9fe21mk1TXU+6r29NmsNQnaotVXYJdT9VFq57l00Hhq9L5KCkNfAFmsN8HJQyEIRuEUz8KA4t85cblAlPo7er5DGF+kjuUiymJgnmw36VZzijCQCc8R1CNqs X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c34e37d-b663-4127-ba50-08d96b6d2846 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:02.4441 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pbRv5Z/IjwqLAbTLQgVa4akoWNuinpX+XvmVWx6b7MhjvaV9wg8Cg+7hJySC5CFU0aVu2L0LxCmY7sk9ZR9PTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB8359 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211807_447287_15D1853B X-CRM114-Status: GOOD ( 22.91 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Currently, the RISC-V kernel provides arch specific hooks (i.e. struct riscv_ipi_ops) to register IPI handling methods. The stats gathering of IPIs is also arch specific in the RISC-V kernel. Other architectures (such as ARM, ARM64, and MIPS) have moved away from custom arch specific IPI handling methods. Currently, these architectures have Linux irqchip drivers providing a range of Linux IRQ numbers to be used as IPIs and IPI triggering is done using generic IPI APIs. This approach allows architectures to treat IPIs as normal Linux IRQs and IPI stats gathering is done by the generic Linux IRQ subsystem. We extend the RISC-V IPI handling as-per above approach so that arch specific IPI handling methods (struct riscv_ipi_ops) can be removed and the IPI handling is totally contained within Linux irqchip drivers. Signed-off-by: Anup Patel --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/sbi.h | 2 + arch/riscv/include/asm/smp.h | 34 +++-- arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/cpu-hotplug.c | 2 + arch/riscv/kernel/irq.c | 1 + arch/riscv/kernel/sbi-ipi.c | 215 ++++++++++++++++++++++++++++++ arch/riscv/kernel/sbi.c | 21 --- arch/riscv/kernel/smp.c | 163 +++++++++++----------- arch/riscv/kernel/smpboot.c | 4 +- drivers/clocksource/timer-clint.c | 23 ---- drivers/irqchip/irq-riscv-intc.c | 55 ++++---- 12 files changed, 350 insertions(+), 172 deletions(-) create mode 100644 arch/riscv/kernel/sbi-ipi.c diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index ab66daadff42..179a14d9e241 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -50,6 +50,7 @@ config RISCV select GENERIC_EARLY_IOREMAP select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO select GENERIC_IOREMAP + select GENERIC_IRQ_IPI select GENERIC_IRQ_MULTI_HANDLER select GENERIC_IRQ_SHOW select GENERIC_LIB_DEVMEM_IS_ALLOWED diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 289621da4a2a..a992faeded7e 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -106,6 +106,7 @@ struct sbiret { }; void sbi_init(void); +void sbi_ipi_init(void); struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, @@ -175,6 +176,7 @@ static inline unsigned long sbi_mk_version(unsigned long major, int sbi_err_map_linux_errno(int err); #else /* CONFIG_RISCV_SBI */ static inline int sbi_remote_fence_i(const unsigned long *hart_mask) { return -1; } +static inline void sbi_ipi_init(void) { } static inline void sbi_init(void) {} #endif /* CONFIG_RISCV_SBI */ #endif /* _ASM_RISCV_SBI_H */ diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h index a7d2811f3536..6bdaab122ffa 100644 --- a/arch/riscv/include/asm/smp.h +++ b/arch/riscv/include/asm/smp.h @@ -15,11 +15,6 @@ struct seq_file; extern unsigned long boot_cpu_hartid; -struct riscv_ipi_ops { - void (*ipi_inject)(const struct cpumask *target); - void (*ipi_clear)(void); -}; - #ifdef CONFIG_SMP /* * Mapping between linux logical cpu index and hartid. @@ -33,9 +28,6 @@ void show_ipi_stats(struct seq_file *p, int prec); /* SMP initialization hook for setup_arch */ void __init setup_smp(void); -/* Called from C code, this handles an IPI. */ -void handle_IPI(struct pt_regs *regs); - /* Hook for the generic smp_call_function_many() routine. */ void arch_send_call_function_ipi_mask(struct cpumask *mask); @@ -45,11 +37,17 @@ void arch_send_call_function_single_ipi(int cpu); int riscv_hartid_to_cpuid(int hartid); void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out); -/* Set custom IPI operations */ -void riscv_set_ipi_ops(const struct riscv_ipi_ops *ops); +/* Enable IPI for CPU hotplug */ +void riscv_ipi_enable(void); + +/* Disable IPI for CPU hotplug */ +void riscv_ipi_disable(void); -/* Clear IPI for current CPU */ -void riscv_clear_ipi(void); +/* Setup IPI for boot CPU */ +void riscv_ipi_setup(void); + +/* Set the IPI interrupt numbers for arch (called by irqchip drivers) */ +void riscv_ipi_set_virq_range(int virq, int nr_irqs); /* Secondary hart entry */ asmlinkage void smp_callin(void); @@ -92,11 +90,19 @@ static inline void riscv_cpuid_to_hartid_mask(const struct cpumask *in, cpumask_set_cpu(boot_cpu_hartid, out); } -static inline void riscv_set_ipi_ops(const struct riscv_ipi_ops *ops) +static inline void riscv_ipi_enable(void) +{ +} + +static inline void riscv_ipi_disable(void) +{ +} + +static inline void riscv_ipi_setup(void) { } -static inline void riscv_clear_ipi(void) +static inline void riscv_ipi_set_virq_range(int virq, int nr) { } diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile index 3397ddac1a30..38b555edb2ee 100644 --- a/arch/riscv/kernel/Makefile +++ b/arch/riscv/kernel/Makefile @@ -54,6 +54,7 @@ obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o obj-$(CONFIG_RISCV_SBI) += sbi.o +obj-$(CONFIG_RISCV_SBI) += sbi-ipi.o ifeq ($(CONFIG_RISCV_SBI), y) obj-$(CONFIG_SMP) += cpu_ops_sbi.o endif diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c index df84e0c13db1..0f662b0113f3 100644 --- a/arch/riscv/kernel/cpu-hotplug.c +++ b/arch/riscv/kernel/cpu-hotplug.c @@ -13,6 +13,7 @@ #include #include #include +#include void cpu_stop(void); void arch_cpu_idle_dead(void) @@ -47,6 +48,7 @@ int __cpu_disable(void) remove_cpu_topology(cpu); set_cpu_online(cpu, false); + riscv_ipi_disable(); irq_migrate_all_off_this_cpu(); return ret; diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c index 7207fa08d78f..2817900a63e8 100644 --- a/arch/riscv/kernel/irq.c +++ b/arch/riscv/kernel/irq.c @@ -21,4 +21,5 @@ void __init init_IRQ(void) irqchip_init(); if (!handle_arch_irq) panic("No interrupt controller found."); + riscv_ipi_setup(); } diff --git a/arch/riscv/kernel/sbi-ipi.c b/arch/riscv/kernel/sbi-ipi.c new file mode 100644 index 000000000000..dc284ad3551c --- /dev/null +++ b/arch/riscv/kernel/sbi-ipi.c @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * SBI based IPI support. + * + * Copyright (c) 2021 Western Digital Corporation or its affiliates. + */ + +#define pr_fmt(fmt) "riscv-sbi-ipi: " fmt +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int intc_parent_irq __ro_after_init; +static struct irq_domain *sbi_ipi_domain __ro_after_init; +static DEFINE_PER_CPU(unsigned long, sbi_ipi_bits); + +static void sbi_ipi_dummy(struct irq_data *d) +{ +} + +static void sbi_ipi_send_mask(struct irq_data *d, const struct cpumask *mask) +{ + int cpu; + struct cpumask hartid_mask; + + /* Barrier before doing atomic bit update to IPI bits */ + smp_mb__before_atomic(); + for_each_cpu(cpu, mask) + set_bit(d->hwirq, per_cpu_ptr(&sbi_ipi_bits, cpu)); + /* Barrier after doing atomic bit update to IPI bits */ + smp_mb__after_atomic(); + + riscv_cpuid_to_hartid_mask(mask, &hartid_mask); + + sbi_send_ipi(cpumask_bits(&hartid_mask)); +} + +static struct irq_chip sbi_ipi_chip = { + .name = "RISC-V SBI IPI", + .irq_mask = sbi_ipi_dummy, + .irq_unmask = sbi_ipi_dummy, + .ipi_send_mask = sbi_ipi_send_mask, +}; + +static int sbi_ipi_domain_map(struct irq_domain *d, unsigned int irq, + irq_hw_number_t hwirq) +{ + irq_set_percpu_devid(irq); + irq_domain_set_info(d, irq, hwirq, &sbi_ipi_chip, d->host_data, + handle_percpu_devid_irq, NULL, NULL); + + return 0; +} + +static int sbi_ipi_domain_alloc(struct irq_domain *d, unsigned int virq, + unsigned int nr_irqs, void *arg) +{ + int i, ret; + irq_hw_number_t hwirq; + unsigned int type = IRQ_TYPE_NONE; + struct irq_fwspec *fwspec = arg; + + ret = irq_domain_translate_onecell(d, fwspec, &hwirq, &type); + if (ret) + return ret; + + for (i = 0; i < nr_irqs; i++) { + ret = sbi_ipi_domain_map(d, virq + i, hwirq + i); + if (ret) + return ret; + } + + return 0; +} + +static const struct irq_domain_ops sbi_ipi_domain_ops = { + .translate = irq_domain_translate_onecell, + .alloc = sbi_ipi_domain_alloc, + .free = irq_domain_free_irqs_top, +}; + +static void sbi_ipi_handle_irq(struct irq_desc *desc) +{ + int err; + struct irq_chip *chip = irq_desc_get_chip(desc); + unsigned long irqs, *bits = this_cpu_ptr(&sbi_ipi_bits); + irq_hw_number_t hwirq; + + chained_irq_enter(chip, desc); + + while (true) { + csr_clear(CSR_IP, IE_SIE); + + /* Order bit clearing and data access. */ + mb(); + + irqs = xchg(bits, 0); + if (!irqs) + goto done; + + for_each_set_bit(hwirq, &irqs, BITS_PER_LONG) { + err = generic_handle_domain_irq(sbi_ipi_domain, + hwirq); + if (unlikely(err)) + pr_warn_ratelimited( + "can't find mapping for hwirq %lu\n", + hwirq); + } + } + +done: + chained_irq_exit(chip, desc); +} + +static int sbi_ipi_dying_cpu(unsigned int cpu) +{ + disable_percpu_irq(intc_parent_irq); + return 0; +} + +static int sbi_ipi_starting_cpu(unsigned int cpu) +{ + enable_percpu_irq(intc_parent_irq, + irq_get_trigger_type(intc_parent_irq)); + return 0; +} + +static int __init sbi_ipi_set_virq(void) +{ + int virq; + struct irq_fwspec ipi = { + .fwnode = sbi_ipi_domain->fwnode, + .param_count = 1, + .param[0] = 0, + }; + + virq = __irq_domain_alloc_irqs(sbi_ipi_domain, -1, BITS_PER_LONG, + NUMA_NO_NODE, &ipi, + false, NULL); + if (virq <= 0) { + pr_err("unable to alloc IRQs from SBI IPI IRQ domain\n"); + return -ENOMEM; + } + + riscv_ipi_set_virq_range(virq, BITS_PER_LONG); + + return 0; +} + +static int __init sbi_ipi_domain_init(struct irq_domain *domain) +{ + struct irq_fwspec swi = { + .fwnode = domain->fwnode, + .param_count = 1, + .param[0] = RV_IRQ_SOFT, + }; + + intc_parent_irq = __irq_domain_alloc_irqs(domain, -1, 1, + NUMA_NO_NODE, &swi, + false, NULL); + if (intc_parent_irq <= 0) { + pr_err("unable to alloc IRQ from INTC IRQ domain\n"); + return -ENOMEM; + } + + irq_set_chained_handler(intc_parent_irq, sbi_ipi_handle_irq); + + sbi_ipi_domain = irq_domain_add_linear(NULL, BITS_PER_LONG, + &sbi_ipi_domain_ops, NULL); + if (!sbi_ipi_domain) { + pr_err("unable to add SBI IPI IRQ domain\n"); + return -ENOMEM; + } + + cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, + "irqchip/riscv/sbi-ipi:starting", + sbi_ipi_starting_cpu, sbi_ipi_dying_cpu); + + return sbi_ipi_set_virq(); +} + +void __init sbi_ipi_init(void) +{ + struct irq_domain *domain = NULL; + struct device_node *cpu, *child; + + for_each_of_cpu_node(cpu) { + child = of_get_compatible_child(cpu, "riscv,cpu-intc"); + if (!child) { + pr_err("failed to find INTC node [%pOF]\n", cpu); + return; + } + + domain = irq_find_host(child); + of_node_put(child); + if (domain) + break; + } + if (!domain) { + pr_err("can't find INTC IRQ domain\n"); + return; + } + + if (sbi_ipi_domain_init(domain)) + pr_err("failed to register IPI domain\n"); + else + pr_info("registered IPI domain\n"); +} diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c index 8aeca26198f2..372aa7e181d5 100644 --- a/arch/riscv/kernel/sbi.c +++ b/arch/riscv/kernel/sbi.c @@ -589,25 +589,6 @@ long sbi_get_mimpid(void) return __sbi_base_ecall(SBI_EXT_BASE_GET_MIMPID); } -static void sbi_send_cpumask_ipi(const struct cpumask *target) -{ - struct cpumask hartid_mask; - - riscv_cpuid_to_hartid_mask(target, &hartid_mask); - - sbi_send_ipi(cpumask_bits(&hartid_mask)); -} - -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_clear = sbi_ipi_clear -}; - void __init sbi_init(void) { int ret; @@ -654,6 +635,4 @@ void __init sbi_init(void) __sbi_send_ipi = __sbi_send_ipi_v01; __sbi_rfence = __sbi_rfence_v01; } - - riscv_set_ipi_ops(&sbi_ipi_ops); } diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 547dc508f7d1..6c9873b7d60e 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -41,11 +42,9 @@ void __init smp_setup_processor_id(void) cpuid_to_hartid_map(0) = boot_cpu_hartid; } -/* A collection of single bit ipi messages. */ -static struct { - unsigned long stats[IPI_MAX] ____cacheline_aligned; - unsigned long bits ____cacheline_aligned; -} ipi_data[NR_CPUS] __cacheline_aligned; +static int ipi_virq_base __ro_after_init; +static int nr_ipi __ro_after_init = IPI_MAX; +static struct irq_desc *ipi_desc[IPI_MAX] __read_mostly; int riscv_hartid_to_cpuid(int hartid) { @@ -87,46 +86,14 @@ static void ipi_stop(void) wait_for_interrupt(); } -static const struct riscv_ipi_ops *ipi_ops __ro_after_init; - -void riscv_set_ipi_ops(const struct riscv_ipi_ops *ops) -{ - ipi_ops = ops; -} -EXPORT_SYMBOL_GPL(riscv_set_ipi_ops); - -void riscv_clear_ipi(void) -{ - if (ipi_ops && ipi_ops->ipi_clear) - ipi_ops->ipi_clear(); -} -EXPORT_SYMBOL_GPL(riscv_clear_ipi); - static void send_ipi_mask(const struct cpumask *mask, enum ipi_message_type op) { - int cpu; - - smp_mb__before_atomic(); - for_each_cpu(cpu, mask) - set_bit(op, &ipi_data[cpu].bits); - smp_mb__after_atomic(); - - if (ipi_ops && ipi_ops->ipi_inject) - ipi_ops->ipi_inject(mask); - else - pr_warn("SMP: IPI inject method not available\n"); + __ipi_send_mask(ipi_desc[op], mask); } static void send_ipi_single(int cpu, enum ipi_message_type op) { - smp_mb__before_atomic(); - set_bit(op, &ipi_data[cpu].bits); - smp_mb__after_atomic(); - - if (ipi_ops && ipi_ops->ipi_inject) - ipi_ops->ipi_inject(cpumask_of(cpu)); - else - pr_warn("SMP: IPI inject method not available\n"); + __ipi_send_mask(ipi_desc[op], cpumask_of(cpu)); } #ifdef CONFIG_IRQ_WORK @@ -136,62 +103,96 @@ void arch_irq_work_raise(void) } #endif -void handle_IPI(struct pt_regs *regs) +static irqreturn_t handle_IPI(int irq, void *data) { - struct pt_regs *old_regs = set_irq_regs(regs); - unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits; - unsigned long *stats = ipi_data[smp_processor_id()].stats; + int ipi = irq - ipi_virq_base; + + switch (ipi) { + case IPI_RESCHEDULE: + scheduler_ipi(); + break; + case IPI_CALL_FUNC: + generic_smp_call_function_interrupt(); + break; + case IPI_CPU_STOP: + ipi_stop(); + break; + case IPI_IRQ_WORK: + irq_work_run(); + break; +#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST + case IPI_TIMER: + tick_receive_broadcast(); + break; +#endif + default: + pr_warn("CPU%d: unhandled IPI%d\n", smp_processor_id(), ipi); + break; + }; + + return IRQ_HANDLED; +} - irq_enter(); +void riscv_ipi_enable(void) +{ + int i; - riscv_clear_ipi(); + if (WARN_ON_ONCE(!ipi_virq_base)) + return; - while (true) { - unsigned long ops; + for (i = 0; i < nr_ipi; i++) + enable_percpu_irq(ipi_virq_base + i, 0); +} - /* Order bit clearing and data access. */ - mb(); +void riscv_ipi_disable(void) +{ + int i; - ops = xchg(pending_ipis, 0); - if (ops == 0) - goto done; + if (WARN_ON_ONCE(!ipi_virq_base)) + return; - if (ops & (1 << IPI_RESCHEDULE)) { - stats[IPI_RESCHEDULE]++; - scheduler_ipi(); - } + for (i = 0; i < nr_ipi; i++) + disable_percpu_irq(ipi_virq_base + i); +} - if (ops & (1 << IPI_CALL_FUNC)) { - stats[IPI_CALL_FUNC]++; - generic_smp_call_function_interrupt(); - } +void riscv_ipi_setup(void) +{ + int i, err; - if (ops & (1 << IPI_CPU_STOP)) { - stats[IPI_CPU_STOP]++; - ipi_stop(); - } + /* SBI based IPIs is our last option */ + if (!ipi_virq_base) + sbi_ipi_init(); - if (ops & (1 << IPI_IRQ_WORK)) { - stats[IPI_IRQ_WORK]++; - irq_work_run(); - } + /* If still don't have IPIs then do nothing */ + if (!ipi_virq_base) { + pr_info("SMP: IPIs not available\n"); + return; + } -#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST - if (ops & (1 << IPI_TIMER)) { - stats[IPI_TIMER]++; - tick_receive_broadcast(); - } -#endif - BUG_ON((ops >> IPI_MAX) != 0); + /* Request IPIs */ + for (i = 0; i < nr_ipi; i++) { + err = request_percpu_irq(ipi_virq_base + i, handle_IPI, + "IPI", &ipi_virq_base); + WARN_ON(err); - /* Order data access and bit testing. */ - mb(); + ipi_desc[i] = irq_to_desc(ipi_virq_base + i); + irq_set_status_flags(ipi_virq_base + i, IRQ_HIDDEN); } -done: - irq_exit(); - set_irq_regs(old_regs); + /* Enabled IPIs for boot CPU immediately */ + riscv_ipi_enable(); +} + +void riscv_ipi_set_virq_range(int virq, int nr) +{ + if (WARN_ON(ipi_virq_base)) + return; + + WARN_ON(nr < IPI_MAX); + nr_ipi = min(nr, IPI_MAX); + ipi_virq_base = virq; } +EXPORT_SYMBOL_GPL(riscv_ipi_set_virq_range); static const char * const ipi_names[] = { [IPI_RESCHEDULE] = "Rescheduling interrupts", @@ -209,7 +210,7 @@ void show_ipi_stats(struct seq_file *p, int prec) seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >= 4 ? " " : ""); for_each_online_cpu(cpu) - seq_printf(p, "%10lu ", ipi_data[cpu].stats[i]); + seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu)); seq_printf(p, " %s\n", ipi_names[i]); } } diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index bd82375db51a..a64b5e194e1e 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -159,12 +159,12 @@ asmlinkage __visible void smp_callin(void) struct mm_struct *mm = &init_mm; unsigned int curr_cpuid = smp_processor_id(); - riscv_clear_ipi(); - /* All kernel threads share the same mm context. */ mmgrab(mm); current->active_mm = mm; + riscv_ipi_enable(); + notify_cpu_starting(curr_cpuid); numa_add_cpu(curr_cpuid); update_siblings_masks(curr_cpuid); diff --git a/drivers/clocksource/timer-clint.c b/drivers/clocksource/timer-clint.c index 6cfe2ab73eb0..3b68ed53fe4a 100644 --- a/drivers/clocksource/timer-clint.c +++ b/drivers/clocksource/timer-clint.c @@ -30,7 +30,6 @@ #define CLINT_TIMER_VAL_OFF 0xbff8 /* CLINT manages IPI and Timer for RISC-V M-mode */ -static u32 __iomem *clint_ipi_base; static u64 __iomem *clint_timer_cmp; static u64 __iomem *clint_timer_val; static unsigned long clint_timer_freq; @@ -41,24 +40,6 @@ u64 __iomem *clint_time_val; EXPORT_SYMBOL(clint_time_val); #endif -static void clint_send_ipi(const struct cpumask *target) -{ - unsigned int cpu; - - for_each_cpu(cpu, target) - writel(1, clint_ipi_base + cpuid_to_hartid_map(cpu)); -} - -static void clint_clear_ipi(void) -{ - writel(0, clint_ipi_base + cpuid_to_hartid_map(smp_processor_id())); -} - -static struct riscv_ipi_ops clint_ipi_ops = { - .ipi_inject = clint_send_ipi, - .ipi_clear = clint_clear_ipi, -}; - #ifdef CONFIG_64BIT #define clint_get_cycles() readq_relaxed(clint_timer_val) #else @@ -189,7 +170,6 @@ static int __init clint_timer_init_dt(struct device_node *np) return -ENODEV; } - clint_ipi_base = base + CLINT_IPI_OFF; clint_timer_cmp = base + CLINT_TIMER_CMP_OFF; clint_timer_val = base + CLINT_TIMER_VAL_OFF; clint_timer_freq = riscv_timebase; @@ -228,9 +208,6 @@ static int __init clint_timer_init_dt(struct device_node *np) goto fail_free_irq; } - riscv_set_ipi_ops(&clint_ipi_ops); - clint_clear_ipi(); - return 0; fail_free_irq: diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c index 8017f6d32d52..65d9c5b0ddb8 100644 --- a/drivers/irqchip/irq-riscv-intc.c +++ b/drivers/irqchip/irq-riscv-intc.c @@ -26,20 +26,7 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) if (unlikely(cause >= BITS_PER_LONG)) panic("unexpected interrupt cause"); - switch (cause) { -#ifdef CONFIG_SMP - case RV_IRQ_SOFT: - /* - * We only use software interrupts to pass IPIs, so if a - * non-SMP system gets one, then we don't know what to do. - */ - handle_IPI(regs); - break; -#endif - default: - handle_domain_irq(intc_domain, cause, regs); - break; - } + handle_domain_irq(intc_domain, cause, regs); } /* @@ -59,18 +46,6 @@ static void riscv_intc_irq_unmask(struct irq_data *d) csr_set(CSR_IE, BIT(d->hwirq)); } -static int riscv_intc_cpu_starting(unsigned int cpu) -{ - csr_set(CSR_IE, BIT(RV_IRQ_SOFT)); - return 0; -} - -static int riscv_intc_cpu_dying(unsigned int cpu) -{ - csr_clear(CSR_IE, BIT(RV_IRQ_SOFT)); - return 0; -} - static struct irq_chip riscv_intc_chip = { .name = "RISC-V INTC", .irq_mask = riscv_intc_irq_mask, @@ -87,9 +62,32 @@ static int riscv_intc_domain_map(struct irq_domain *d, unsigned int irq, return 0; } +static int riscv_intc_domain_alloc(struct irq_domain *domain, + unsigned int virq, unsigned int nr_irqs, + void *arg) +{ + int i, ret; + irq_hw_number_t hwirq; + unsigned int type = IRQ_TYPE_NONE; + struct irq_fwspec *fwspec = arg; + + ret = irq_domain_translate_onecell(domain, fwspec, &hwirq, &type); + if (ret) + return ret; + + for (i = 0; i < nr_irqs; i++) { + ret = riscv_intc_domain_map(domain, virq + i, hwirq + i); + if (ret) + return ret; + } + + return 0; +} + static const struct irq_domain_ops riscv_intc_domain_ops = { .map = riscv_intc_domain_map, .xlate = irq_domain_xlate_onecell, + .alloc = riscv_intc_domain_alloc }; static int __init riscv_intc_init(struct device_node *node, @@ -125,11 +123,6 @@ static int __init riscv_intc_init(struct device_node *node, return rc; } - cpuhp_setup_state(CPUHP_AP_IRQ_RISCV_STARTING, - "irqchip/riscv/intc:starting", - riscv_intc_cpu_starting, - riscv_intc_cpu_dying); - pr_info("%d local interrupts mapped\n", BITS_PER_LONG); return 0; From patchwork Mon Aug 30 04:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464517 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 060FEC4320A for ; Mon, 30 Aug 2021 04:18:45 +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 BC8DC60F8F for ; Mon, 30 Aug 2021 04:18:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BC8DC60F8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E/9v5YZX4I7Ip+3UyYGDh+7ZNXNQRHYodAtPvvYiCkY=; b=C152zAFlU94f46 oy8SvdYJddshmpU5lDVjiGzGbFQkzyQWUle4Gc/00a97sz/Zr9DnNhWQrWRLNkfFiPNe5tgpR7Uz4 ACN5dZFUgtJYxIV6WaTh9+Wyt9nXfOJu3KpOxHqaTheMXRMXGCTpBa+0ph8D83uXG6od3dSOE9M0M kD34r6YC6pNN6B0XoMPJFXcN8rPNnZndEC6Km2TEikY9d0ybw0/2VWUBwq2/3s6j5DZxJsho6nSKB 5dPE5eRKNstRlTgmzcKAucWU+odPHbp/sgbylczmXowZpZMpKvFqr5fQqUKCgjZbtJumbnzPK/H4I sRuPdz5t9z6S0oVIxZXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkU-00GOQe-Dn; Mon, 30 Aug 2021 04:18:18 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkL-00GOOn-HY for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297087; x=1661833087; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=UACASCCu4bZVbM9KnCDapGebG+fpRzurqhRW9zyjqrc=; b=bYqrsHBzabptqzUunL5/KRYB+eNO7Exk0pwPMYwEr1QhAw21M1989K7I w23p9ySkyY3oBfWT63FPXpBnEnwsHKM9H+bCmUep/21aXcQ9NG/Dc/yFp +50IYUL5oHda4NtFB2GJmjoOORV2a5eQiOFAqrw4XpkjspZNRkzlTfFsP 4w2it9HViO6paVeYnPCYrF9gNuLB89ij6QMeFQr98NXdj+JJfGlAiixrp 3+aU2oqf6NzQYxgsUbw5YKHoyRgDmJFMP++dNaM4EH/lUSQaKCZKC2tEG oUjSu1EIMO2RbvoFtD3f74F3HJtBvKNe6fPX5jRzwA7zLJAtlt55S74ru Q==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="178734032" Received: from mail-mw2nam10lp2100.outbound.protection.outlook.com (HELO NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.100]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:06 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cs7q/zxv6PF74cOFlS5KtDtClfWW2gv+kDuamguYhHYTNIveVjutUvFYoO///WA3R9oSvOdHha9pZy98gNK3OoZVirC4ShaFc4Mt4V2v3engwF+RaHmgetLNjkaoaf0VRSOcR3m85Zs3hj1UPXHOFWVWfy7LodNpJqvgGDwzRVYtgwSsszASTQd081ZQKLejVSQgWSWEFDRvsBv4wcIczVfBerZ3zc5SmrG/XDsscX56cwTLI4n8Ls1ZyxaLtzoIjmdegScC4LTkkvY7anxRAsvShiQPJ7CvXvtl/Si0+2SBxZ4MKDYC9vscdoLGp59BHnw/M/nHh9f2e65rQyYEpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mf6W397BRew9EELVUGZ9YLSC1OfSExrKtD+7YgpPVww=; b=lQOmXvMNDGV/yRXa0g4FHXcEb8I3UTZW+fVZFtxGqMxCSmcRYAN2biI1gbsrgcWR3ITAjTdyaG70wH7R7t1+Yiv1vtPgd69jNt3MFKPbvZK8fEyYjF6R+17UwgazfdYcZwfg/HNHEuuJ/yIfzEo74AFGYZRjIT9KoxkOpl7/8jqfW4rXkcQUYab9uTawT+hKQ5nR92W1VLGJgReIk3w+XJfHDjsMkfHMVmQCOtBijMEQ2KaDID2w6P9vBeQgZENnwmQQ1YeLKSV9YBpqzEvCpGET8X9e2IxEfBPeDgUS3Izoa+btRhy7kQEy7O3XhRg5FQwyb9y2tm5SmwzphomURg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mf6W397BRew9EELVUGZ9YLSC1OfSExrKtD+7YgpPVww=; b=A+qRcnNop+FkqaAo/AkqRZP045Fw/qoN6jNsSqAq2N5m38PcON3Sy5Kwrm8ax3h/5fcrc/TYgiB5Qm63xRv34d9EnpaLl6uqoqFk3orDfeIdXV8CFe1uMu/dMfRQGueSPyy75v2L06cjJKOVykYbXhFIFeZmOFdkXSwuFeCHq7Q= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB7823.namprd04.prod.outlook.com (2603:10b6:a03:300::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Mon, 30 Aug 2021 04:18:06 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:06 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [RFC PATCH v3 03/11] RISC-V: Allow marking IPIs as suitable for remote FENCEs Date: Mon, 30 Aug 2021 09:47:21 +0530 Message-Id: <20210830041729.237252-4-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8ae5a01-d052-45b7-263b-08d96b6d2acd X-MS-TrafficTypeDiagnostic: SJ0PR04MB7823: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mggJEJsD8FliCMVS/+FEgDwv+ABIGz391fZheJW9eZ5cfa47ZL7cKWSkWwszfg24gAzPSNLIsz3oe6Dn4pzNywIrTTLwF77LH+dudyCk1YMOuxWLvAs8z9n+lZrh6T1aq4PQg7VhungG3RdGMP/HNNQKtzgP49O5e+qVzRwVlxNARtgTJ+mFx3T0A9T9poUfp4pLd6rj3qsEq5budgzykVzCh34kalltALf2KDCuDnt38yeJdBFZ5fyo03xgIxnT3XrAxVK3IudDbW4J6X/G8PtsyVx3q1OeoVOmviuPDAQOYQbrWON4U/Gy0focyBy+O6fah9XtSjcKQ/1megjQWdps5B7c4bCGsla3cFhpjpSv7/kj5HVSgjNuLPu4kzirH2XJ9cR+rkZR5/yvsK0WgzJDW82pFAA/STGNEjdAlKKbMdVd5ia+URCrLCvNTZWy4OGbXnV8tSpWkoqNWmL4nHBgxfZBmfdEWDxAgOEHgW8sJejF/xl6OZucVDg03zbvklanAJfgLRTHQ8/PsQKOupfPFz/897MkM3wlHFJMqrFEXgYZp8GLAfCqNtcfXOOhH+S2pwwEVq7wtOg2yIYqSIE3LebOWLwrQJ3IkdmSIaUsf6x3hja4QYwgAqC0sMp03oWy2+CXt/gatOzAU+an/V+ks3uKINvM+JGrwwdugEtvlrZ2RDGtjJYLigDLRM0CcPHXjoBciOMxQKkXMXTXyw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(396003)(39860400002)(376002)(346002)(478600001)(66946007)(26005)(66556008)(2906002)(316002)(8936002)(52116002)(5660300002)(6666004)(55016002)(66476007)(1076003)(44832011)(36756003)(8676002)(956004)(7696005)(2616005)(54906003)(86362001)(7416002)(110136005)(83380400001)(186003)(38100700002)(8886007)(4326008)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /xUxnHaoPO6rsX6cKiS/gdf4PPEbCQIuw34vvGNoiRQrhWEVoKPB2exyTB3VKqJbxqGom3OeurzIGrCCI2RgHqyIMiBauqtJ81WtDmHE7D5ZnvtrUUmQVH+2FXYqNtt2CINhzYDHrllGTWFjnYmpc4Wwk7JwqEa7N08bIRgSxLD9Y37JGDPYsqz/g79L+0FZcRa89+QJRYzAlOnUFSmfaQl7NqD5EUXIKO9nnLT78NAXNq2JDKI9ywhhNjufv7VMGNn75lpHjkvxTGnCLhM1694Xs7US80TpJ6OoQHxljFSEgXfCAvkcJuL0TqCb9vqtKjcTvsahd+ekvAUn1Ax6Y04EKxMbqxYDiBH3FMovvak4eIinIG6Nqz5PhJHtiMbM4C7CZhzY6rAaCY+9cmPEknTIf5mluRXR6ssaA0Qg4sAzBBHO3bVAdYBpUyrfrWocQMZmiznhXb0+C+WHDVSyf5L/sv9EQTmvfBqvew0p8X9Hglapy9LtXxU2qwglu5vlW8IciBwmu9SPKwBCOwDeQ84x7MulQalrbx34sG7LrUEkxCtJsLsSF66JigD1mRKVslPb/WDR2aN5LjraDF8kmUsItUn5ZmnHUxFPmBfYqbfDHx4gJAkXFUe+hTueSrxmr37tGdeR1JlO5S1dtnn9AOQ7whh76xK9KoAWy/NcKr998kIv9x5EFgvF0KzvHBR2f4saCCae8TBvnpDDR6R5ggULaLEuAslSnn6girqarfW59p8RsyD5Oj127QceAM4t1dnEddqt3MgBYBtrx8d77DUmNAGsWyJe/cdYPbuwhI82uaJEO7x42XP4pqgKuQyHKpsZkRjD0lYp/0jTMfWexQZSHWW8BoFyNsBWdC1U23kFxP2HqP7cgF8RltBzcdc52jkhxobzZXmSZBmYXh1bF1BajmTTM1fUtkMesS6mM6V3wvNz+CGE/hxSrEqleIMwCER0BE7cW5/81uuXXTN5jbKto+Rll5maJwzqtcthNwtjb31samMIshT6PYaup6gCujnZOYvoLF4UHqIqikeAe5vbQpAQyCWnMAYoaqdKYD7/exCm7nxXP+oDQ8F6jBvfcvQFTl61UKwKOCHmKqXL9jfcfC1PjYrb62MrNu4O+eGiuWwpPeWI3a1KFL0tmU1kSj83RP48lKk7GYHT1689OCVMFJxGvjeTYFiA0PJiLL67rrGviV4OKALhWAyHYebz2gvnPD3aD0yW/vqf3biAirAoyYstrBqGeEeV6ekBGnorAZXkBblyZArPvNMxrAfMg7dQ+/FqKseb54t9lIGN7kuq+GhaN+BBLN4C6Nb3oSonRFu/vpQ5pV7xZkXL6r2s X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8ae5a01-d052-45b7-263b-08d96b6d2acd X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:06.7054 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s9b4LtHt29aaCsCUMLnZxF3tNwaAk964Pa5CFa7t0hn2JQZvSM6cshexP47tIYFSP0h+60lsesi2W4LwVv5c4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7823 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211809_622416_039DA037 X-CRM114-Status: GOOD ( 16.87 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org To do remote FENCEs (i.e. remote TLB flushes) using IPI calls on the RISC-V kernel, we need hardware mechanism to directly inject IPI from the RISC-V kernel instead of using SBI calls. The upcoming ACLINT [M|S]SWI devices and AIA IMSIC devices allow direct IPI injection from the RISC-V kernel. To support this, we extend the riscv_ipi_set_virq_range() function so that irqchip drivers can mark IPIs as suitable for remote FENCEs. Signed-off-by: Anup Patel --- arch/riscv/include/asm/smp.h | 18 ++++++++++++++++-- arch/riscv/kernel/sbi-ipi.c | 2 +- arch/riscv/kernel/smp.c | 9 ++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h index 6bdaab122ffa..f4856c911335 100644 --- a/arch/riscv/include/asm/smp.h +++ b/arch/riscv/include/asm/smp.h @@ -16,6 +16,9 @@ struct seq_file; extern unsigned long boot_cpu_hartid; #ifdef CONFIG_SMP + +#include + /* * Mapping between linux logical cpu index and hartid. */ @@ -47,7 +50,12 @@ void riscv_ipi_disable(void); void riscv_ipi_setup(void); /* Set the IPI interrupt numbers for arch (called by irqchip drivers) */ -void riscv_ipi_set_virq_range(int virq, int nr_irqs); +void riscv_ipi_set_virq_range(int virq, int nr_irqs, bool use_for_rfence); + +/* Check if we can use IPIs for remote FENCEs */ +DECLARE_STATIC_KEY_FALSE(riscv_ipi_for_rfence); +#define riscv_use_ipi_for_rfence() \ + static_branch_unlikely(&riscv_ipi_for_rfence) /* Secondary hart entry */ asmlinkage void smp_callin(void); @@ -102,10 +110,16 @@ static inline void riscv_ipi_setup(void) { } -static inline void riscv_ipi_set_virq_range(int virq, int nr) +static inline void riscv_ipi_set_virq_range(int virq, int nr, + bool use_for_rfence) { } +static inline bool riscv_use_ipi_for_rfence(void) +{ + return false; +} + #endif /* CONFIG_SMP */ #if defined(CONFIG_HOTPLUG_CPU) && (CONFIG_SMP) diff --git a/arch/riscv/kernel/sbi-ipi.c b/arch/riscv/kernel/sbi-ipi.c index dc284ad3551c..c65daf50ff1f 100644 --- a/arch/riscv/kernel/sbi-ipi.c +++ b/arch/riscv/kernel/sbi-ipi.c @@ -149,7 +149,7 @@ static int __init sbi_ipi_set_virq(void) return -ENOMEM; } - riscv_ipi_set_virq_range(virq, BITS_PER_LONG); + riscv_ipi_set_virq_range(virq, BITS_PER_LONG, false); return 0; } diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 6c9873b7d60e..a8ce7a0556ab 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -183,7 +183,10 @@ void riscv_ipi_setup(void) riscv_ipi_enable(); } -void riscv_ipi_set_virq_range(int virq, int nr) +DEFINE_STATIC_KEY_FALSE(riscv_ipi_for_rfence); +EXPORT_SYMBOL_GPL(riscv_ipi_for_rfence); + +void riscv_ipi_set_virq_range(int virq, int nr, bool use_for_rfence) { if (WARN_ON(ipi_virq_base)) return; @@ -191,6 +194,10 @@ void riscv_ipi_set_virq_range(int virq, int nr) WARN_ON(nr < IPI_MAX); nr_ipi = min(nr, IPI_MAX); ipi_virq_base = virq; + if (use_for_rfence) + static_branch_enable(&riscv_ipi_for_rfence); + else + static_branch_disable(&riscv_ipi_for_rfence); } EXPORT_SYMBOL_GPL(riscv_ipi_set_virq_range); From patchwork Mon Aug 30 04:17:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464529 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 6E945C4320A for ; Mon, 30 Aug 2021 04:18:48 +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 3AF7260F6C for ; Mon, 30 Aug 2021 04:18:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3AF7260F6C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XJ3P5PHnj+tyjJHD3JBJiSJD/xdOYdAhw6CzJ1nr56o=; b=L2GScb/hoVnk3V 34/Cex83RrhOloyqiSWOo1fFnLzXPO4RK4nd6EKp6PyR2VveSRk1Ye4EETKk8Q/HsfodFzaDxffWK 2QcGlNaS8hRQoWJeZ93z5S56jI12bs1dMtI8s2jqUxKBoL/qffmuGVJAU6sdcfllCOSGD222dgmcA wQ4ozV+vyGzH1T5bsIth3J7AcA+pLQi+PH1p0Y0RTusSDd+yijm4Wohsa1Yh9MJVlv6TK5Zewr4FA u+BUcZvHbPLyCQIDkOlUTTmxGL99L00/8y++NpHAsZQGCEPXxBlKCV9dHHZ2xS+mDqN92/K+ZnBdg nYFic6rNS/bMJewD7ODg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkW-00GOQt-7q; Mon, 30 Aug 2021 04:18:20 +0000 Received: from esa5.hgst.iphmx.com ([216.71.153.144]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkO-00GOPR-Dm for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297090; x=1661833090; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=UJUjAKryG57iCnWsRWwXKtNHMbhtu6evH99PaKTVGFg=; b=pAKOGJ9l+hQfXwl54mK/H3CQHbBjkyj1D/ek28SLuZM9544d/6mdQDRz Po6yeDsyMEFHPRxMfpp8rAaLlutBuuiMIew5CShu+wz2OAvk5vwceHjnh WBbl5RNG47BRHC9gRUUTzLJQVPDsvxBjtM0PPOTWx9MZgFv9GvNNRkR+m bk3MM8mboVPfn86F+4YkWis6zb0qmHGpA+hPTTGwM81Maa1aPPp5puTlF RBYJUCLIBUySbPH6AKW1IiVl4ikSk1jpaD1+QaFoQhqu4EJahgdxWHb8r YOTlrepjKqQk1pwX6mFFtsmVBjf+PIi/QXPI3N1DNG5DLYfo5NcLN4wxA Q==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="178734036" Received: from mail-mw2nam10lp2102.outbound.protection.outlook.com (HELO NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.102]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:10 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NCaww6P+RFI8xmKaBUU+TcPVt0zz0IMtCw9PvNC1HCmvukoKt/hEaa0CucA9Hf2tAjE4P4UXvbyVgAHk7ZOfsgXxy8zK6fvnG+5TeqtuksuMpG5eL13RgajkECxdvYsuH1ShReiiz+h3fNYlEPPYeD1ZDg5cJGa0kllcAYJx47bqs+S1tOCPibawdXgocN2lAgnMhMuE6f7b4M8nVwG37Ejbj7EaDSAmW2dEvb+Ll1teSxJhsKs6KB9m4QVG5AbYwvUEeCqDfQ8sgVpOEg9iildLP+kir9P/1+y4Cm7Lr03XQlruD5WqrLviIgYt4WcqqRag073+/x5Us5B5kfOKwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pqtLldnDlFw12xq5GioL7eNPoH/2m1O8s3JJ53kbu/w=; b=Qvwge/DBY5u9aDg5HCbRYP797081/G3g+8NKRPG38IMrdUGbo/ZVhuJSG+Ebj3KSTcD8f/AvgYre11uAR7WZi6pcGvFfEA0szecgUisEiAPdJbImJF252daVBAhRjNqAA1VD7pgz6xf/NYQLc/pD87V4YXEO1F5Hl24nfFwDYD0u3uC6voByrE6DNQt02KzyLyFGuxCSN3Q46Nc9btxq2vLsj3S4V6Pcl3TAGn9SxICri0OyXmXBuDbRp2/V93UsSLQndxJJEfk0eg4EAVqTglKxCbXlEIfJgrV7Yh52sxuz77LTZ84syPb3OSXgaTkwDeozsmjIy7Fjb1H3DloymQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pqtLldnDlFw12xq5GioL7eNPoH/2m1O8s3JJ53kbu/w=; b=Xcjb52u9FCxeLEBp90IN3eNRh71AY1nHSqzz9HTaw9cfdrKzTlZ02bgcxtgnzTgbPWs9/w6xdVtMQhPxC2J2xJCDjCFanRghnsm0BxUPiz6LYZDvhrvGYT6eranLs5UCqFuUgbruxANyo3tUa7nMI0Bg5mxtogr2V262YKEb4i8= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB7823.namprd04.prod.outlook.com (2603:10b6:a03:300::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Mon, 30 Aug 2021 04:18:10 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:10 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [RFC PATCH v3 04/11] RISC-V: Use IPIs for remote TLB flush when possible Date: Mon, 30 Aug 2021 09:47:22 +0530 Message-Id: <20210830041729.237252-5-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4daa3ffa-9a0d-4243-1a74-08d96b6d2d5a X-MS-TrafficTypeDiagnostic: SJ0PR04MB7823: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pnQXKgXl+vEh0Z7i174G542aVFscB24ApRxOxnzfTeFXc1xS9orrCvrYu1JppG7chvEfwWzUjM3fsO69EvzkSN1ODLzzqRcWCDzZb0FH21wDh8h4abwxfTBOa4piSvB4AzWIl0OrZakv+W3vgvxS6YfQHRGBR3WrK+MKe5q7eyWfVQ+itfP/du+/t5v9LX+YTcWCRyBB8NesAXWLf0XLPsPA94gafMUTDvipI5QxNbdQsqJHUeXnXvmdgcx6K5rG2R45uklYDc3jsYVOX/NMj+84KytQRlvDsEEuVbtvUNwexJNRH7v9WMfG7FJs7g2lqjgDnd+Dg5wwiakdF/3A8HAxW3vkstatlsTF6cRJm2zPFSjcgYRGlPc62Z2f7hwB9RlI+1aR6v0fMxQSPAr/lvn7kxxzLaoQvpvLsSVxcIj4Tp4Wf4RiJgLZUO37x4lZrnkMQbIISn8uDbkD1/1Fg0ZpucbqniSTgB3dAZr06be/TS8dDePVuS0YstxQ5VSYoCrD8th1HIKWPOL9jb5dwZ5LK4dcyzL+Oe0a55epLX2bihVRb/skIRVASnChDRB1eZjNJseTfhKVeOBAfgm4MtxpUtBAEyw/lWQo0YZrFHDkcD0a3zNzk78Lrhhv8Hsn/AGf6DsJQyQiebFTwEsGCJgfW0Jh0WzEwzAJ75fJOQuWfnCV/d9CXitKtVeL6VIpkzomEFsqAAEJl9LtgWE7Pg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(396003)(39860400002)(376002)(346002)(478600001)(66946007)(26005)(66556008)(2906002)(316002)(8936002)(52116002)(5660300002)(6666004)(55016002)(66476007)(1076003)(44832011)(36756003)(8676002)(956004)(7696005)(2616005)(54906003)(86362001)(7416002)(110136005)(83380400001)(186003)(38100700002)(8886007)(4326008)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fB7sE3+MSoRDm6bwJf2YUNzaa9xm5bcSO2o8VDjqo2Z1UYLai8Gfbh87SI5Ie+ou+7jRj3IwAkGM13dL+KUAAH5DqqUYmfLl6Gchr8nLJmJIRjgvaO2qFUoGNWKyxX09JHQRenoCSBHpKqPvqm/PYgHKnsLgg76YxQTVcS8sqicUxvPr3ocSPtQKAPORJNHLVhiQvfYsy3knUcSKosOeZ6WGiiOie6hThmdqWDoIN7ZHvQtcXsKkPnV5oiYrKOEMEaI7m9pHcJhvMnry2BrF4/Zm1cp65lQi1zEuisJa28O+tkawAuikAubhPJyahA3zX5gYnjJr5F1eHdI9wT8XRhtRZAowJ7SEjOBg/OXQIW3Q94CzDyX26Ba/9RPlOdcv4ENS4GWLLiDYVsjJXfllriKGjDzO/sNztC2A1Hp4NGUsZn1pmsxoEPLUab2G8vbwHTEAJLgjhqh9Tm7Y68OO8L8HnX01X6KH6mvBkRHgPHueGd7YaoxtzxdjSTOI3McDH4QubvbZIqYgfF/syphf4lmnfjobQ/ng/M2ei38lC3EUhy2rQhZgTkmNuZnJBURhhucPsMzjWTQpUSf7QIHPf1ZuzdWKVle71+n41yhbp40TclmqEAL1vhBI8bJvhhVjaAw8Vh2mxyzqgombzJMA4gr7+X78mLIAnF3a+GjoAgiPEPC90I16DnbMhuDCE+e8lrI3liRTpeW7htGs+67+9xcUWgqWrMMYBywXmvAaNMKrjQx0seOdWTfqCeMtw2WBSIYGtZEPEK/H2j9V/brLChYBAXzrmCvgSaG/ilDeSmzogyFuvH1Vo58++OfNPTKK8LP9oikLi86UUg3vPSoFPn4KsleS/pz1Ci1LyFfb2s/SLxTyh+FAleYKfgMPPwemuF9tJtTkTr7X5eAZc9n9b3KPGU4v48HMHapF41Mcl+vQo3QhKvCTuA9vba/C/4l1/bLOgyQS3kwePkBtzB/3lbDPPCIlL2RfPqR95jC0EwOCGQdeLwBF4YVMjiDxZ+gFT56zf1so18KRaMCb9UYROyAliD1AqrOnTAanQjraBaK5dGHeY7C0esFFIviwEH/ZlzlPyuITwYsjHrOKr8KwwKkvG3cozrGqXL/lCT3Qknfle5MMAeHfVSU+NF3c+pmH83Ib0cCf9DCceaNOhEYFQ0hLVN6k8pK76Gmw6jd2P6A2kaLHmnh4MIBdk7ENBNEUzD37L6/+fFUrqYRdZfFRRbcPRaqt0/IFCMZEMRghCP4VYXtA+IUTE5fOZDbnAbrKHKRzqu4GSXNp1kfQFRnOMeYTRY81GzbDZQmcZ74fithYGMIqEFf9gjwaK60EdnC2 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4daa3ffa-9a0d-4243-1a74-08d96b6d2d5a X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:10.7845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y9t7R2SMHWQUJZCPF70cZOEEeXQbBtbs4yfiPCpl9ajv/T0VQS3zMUdYVz3AOuzuac8NmZjVTmqW+K/5sTT3rg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7823 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211812_536322_C877E4F3 X-CRM114-Status: GOOD ( 15.59 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org If IPI calls are injected using SBI IPI calls then remote TLB flush using SBI RFENCE calls is much faster because using IPIs for remote TLB flush would still endup as SBI IPI calls with extra processing on kernel side. It is now possible to have specialized hardware (such as RISC-V AIA and RISC-V ACLINT) which allows S-mode software to directly inject IPIs without any assistance from M-mode runtime firmware. This patch extends remote TLB flush functions to use IPIs whenever underlying IPI operations are suitable for remote FENCEs. Signed-off-by: Anup Patel --- arch/riscv/mm/tlbflush.c | 91 +++++++++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 19 deletions(-) diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index 64f8201237c2..f96f02ed29ef 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -23,13 +23,60 @@ static inline void local_flush_tlb_page_asid(unsigned long addr, : "memory"); } +static inline void local_flush_tlb_range(unsigned long start, + unsigned long size, unsigned long stride) +{ + if (size <= stride) + local_flush_tlb_page(start); + else + local_flush_tlb_all(); +} + +static inline void local_flush_tlb_range_asid(unsigned long start, + unsigned long size, unsigned long stride, unsigned long asid) +{ + if (size <= stride) + local_flush_tlb_page_asid(start, asid); + else + local_flush_tlb_all_asid(asid); +} + +static void __ipi_flush_tlb_all(void *info) +{ + local_flush_tlb_all(); +} + void flush_tlb_all(void) { - sbi_remote_sfence_vma(NULL, 0, -1); + if (riscv_use_ipi_for_rfence()) + on_each_cpu(__ipi_flush_tlb_all, NULL, 1); + else + sbi_remote_sfence_vma(NULL, 0, -1); +} + +struct flush_tlb_range_data { + unsigned long asid; + unsigned long start; + unsigned long size; + unsigned long stride; +}; + +static void __ipi_flush_tlb_range_asid(void *info) +{ + struct flush_tlb_range_data *d = info; + + local_flush_tlb_range_asid(d->start, d->size, d->stride, d->asid); +} + +static void __ipi_flush_tlb_range(void *info) +{ + struct flush_tlb_range_data *d = info; + + local_flush_tlb_range(d->start, d->size, d->stride); } -static void __sbi_tlb_flush_range(struct mm_struct *mm, unsigned long start, - unsigned long size, unsigned long stride) +static void __flush_tlb_range(struct mm_struct *mm, unsigned long start, + unsigned long size, unsigned long stride) { struct cpumask *cmask = mm_cpumask(mm); struct cpumask hmask; @@ -46,23 +93,29 @@ static void __sbi_tlb_flush_range(struct mm_struct *mm, unsigned long start, unsigned long asid = atomic_long_read(&mm->context.id); if (broadcast) { - riscv_cpuid_to_hartid_mask(cmask, &hmask); - sbi_remote_sfence_vma_asid(cpumask_bits(&hmask), - start, size, asid); - } else if (size <= stride) { - local_flush_tlb_page_asid(start, asid); + if (riscv_use_ipi_for_rfence()) { + on_each_cpu(__ipi_flush_tlb_range_asid, + cmask, 1); + } else { + riscv_cpuid_to_hartid_mask(cmask, &hmask); + sbi_remote_sfence_vma_asid( + cpumask_bits(&hmask), + start, size, asid); + } } else { - local_flush_tlb_all_asid(asid); + local_flush_tlb_range_asid(start, size, stride, asid); } } else { if (broadcast) { - riscv_cpuid_to_hartid_mask(cmask, &hmask); - sbi_remote_sfence_vma(cpumask_bits(&hmask), - start, size); - } else if (size <= stride) { - local_flush_tlb_page(start); + if (riscv_use_ipi_for_rfence()) { + on_each_cpu(__ipi_flush_tlb_range, cmask, 1); + } else { + riscv_cpuid_to_hartid_mask(cmask, &hmask); + sbi_remote_sfence_vma(cpumask_bits(&hmask), + start, size); + } } else { - local_flush_tlb_all(); + local_flush_tlb_range(start, size, stride); } } @@ -71,23 +124,23 @@ static void __sbi_tlb_flush_range(struct mm_struct *mm, unsigned long start, void flush_tlb_mm(struct mm_struct *mm) { - __sbi_tlb_flush_range(mm, 0, -1, PAGE_SIZE); + __flush_tlb_range(mm, 0, -1, PAGE_SIZE); } void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) { - __sbi_tlb_flush_range(vma->vm_mm, addr, PAGE_SIZE, PAGE_SIZE); + __flush_tlb_range(vma->vm_mm, addr, PAGE_SIZE, PAGE_SIZE); } void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { - __sbi_tlb_flush_range(vma->vm_mm, start, end - start, PAGE_SIZE); + __flush_tlb_range(vma->vm_mm, start, end - start, PAGE_SIZE); } #ifdef CONFIG_TRANSPARENT_HUGEPAGE void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { - __sbi_tlb_flush_range(vma->vm_mm, start, end - start, PMD_SIZE); + __flush_tlb_range(vma->vm_mm, start, end - start, PMD_SIZE); } #endif From patchwork Mon Aug 30 04:17:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464523 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=-22.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,MSGID_FROM_MTA_HEADER, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 792BDC25AE9 for ; Mon, 30 Aug 2021 04:18:46 +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 4BBC960F5C for ; Mon, 30 Aug 2021 04:18:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4BBC960F5C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VY8OoZAbjidrnhLJhCG65D4rmXciUUwDdkxTXX4zxZU=; b=xMemJiGkyz7VFI rnC1brtEjSjP7iG4VHKg6CZYFR59ykpZyjKCMsadBrPGlr7tBB53mRVWO48+1ZPMD5XsbblyveEaz 0NF3pmf6TDRbXz3ZzwibBLSdQG0BdOEwrVBnSQN7DV6wPn5Ao7MylK8a/D+Zxk/XEpQdZSGJFBn6L XrLM//yL7VeDGfcpDI0XKf9duy1l3hbxynrTUt7vklM7XVPGzvPU37JkOHbDyWnYqnQepNeK3XRxe Q705/3JlKWuTsEFoesson6r8tFaUwDMddMOOFFhlV2jVXvk3FPGDKWcktyBE4rlk+Zc16e8xU4mc1 ayKPHyELjJqJ8thWzQSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkb-00GOSk-64; Mon, 30 Aug 2021 04:18:25 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkW-00GOQq-6k for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297100; x=1661833100; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=M+d6WuhqdtGbJNlIOlqoTJqcoUdAtvCI2JyYrvh6f0Q=; b=Ga90qmsKOHe6SeCcpwjamyVvisS/n0/YB/Z//CDZPjvxdwBeT2mBb7qU R+/q/K2a3G/GHRkieq5asRNrbXyRcMlt9Ru+Um2RUC2kf7RNnpE6//N9m 8KDEmbUKzpZ7cgFELVjeiMGIc7teJm6vKm1vB39Cl182on2Y8NOK2xVsi SAskVxX6IH12fpwNxFuk6SHkgbcqArTqTM6p4nado3zBKHLWHIGdyQfGl DM5rfgFOkuLtcRAswNbhWv9GD3rFBnwa8eNqvXpCOy/qnjzX5LVc44JsG dFMz1C+++FG8Ch0sm13d4PwB7r48CglVK80lpe1e7aygZM5QNnDQuPic8 g==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="179285373" Received: from mail-bn7nam10lp2103.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.103]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:18 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TAQGrTTTCAkfCMlC9opSYaEOkA94IkZQ3/BBBrm7tBQj3FQcm0cVtVcQ59alUwQtmM61Du2+AARieMRljgNcinUHR/pcdBN+zocLUgBylMu6odPDkEnFLDuAFOIl55B2pBBj/d76E18amTCgmxvXVkmaiZWxUViSlTOx8inetC+mOR17KcFYmZ6gf8CSZAzo/A/ZfTtHCq/mkjW9yfEZsuM08RpFPhl/wGypkr1/0AnXwg/NEn21F5VBBoMOQcH/Mu7ZMwOEo6G28uLXLWfOqbejUdt3LVgZwVrECVjDWhWiPQLcmtsn1QduB1MO8WanX22TSjYknzBc+HyyL1yuzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sNo5Z4uBCY/aL7hdgAW7RN1Sc7UnI7LX5yYKW5Kyg+c=; b=ehEE9RqIl69fKhCoZup5V+gT3d0VQRDO/YI7ohnL6OXMKCjREvSv0ZlrN4b/qVCIPk64B66QdTWjX4XwiI9MfNSoUWdMqWuNGpwwVGd7FjfAY+eI0dLh4oY2lma3sCzEWDLgGnZXXuu0ZV+DsDqb3LZVDpzdNhtMaGScoFTJRBEMGw+92K4ily4OF15pBhpuFBM/ppkXd7rgif+CfNphKQOCRbAvoDxUtMsQ+jFWP+V35euUFwjcfhKBv0EyQnK40LqfP+YnCq9s8hS6fYbWXIMZ9S4AWfzE2BY76j0VVAV3HgJRwEzYeGug5oG5qcOUOFq894x1oDWiQq7Hq1uAtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sNo5Z4uBCY/aL7hdgAW7RN1Sc7UnI7LX5yYKW5Kyg+c=; b=tfXd5ja3mLas51hWFd8pdrmDeYDtZYyl7UeUVGYIiTHViqFny0zKwaCMd6p8OThF92x2BTAaaZHEG5BEeAe4L1wVLvAeA4YuZDjf6bT8yLUVcsseETIsLv5izQPAsbLUy2edih/RgYHCHNnIe7jEXjboRVV7iKgkjau3e3caBO8= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB8273.namprd04.prod.outlook.com (2603:10b6:a03:3e4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Mon, 30 Aug 2021 04:18:15 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:15 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Bin Meng Subject: [RFC PATCH v3 05/11] dt-bindings: interrupt-controller: Add ACLINT MSWI and SSWI bindings Date: Mon, 30 Aug 2021 09:47:23 +0530 Message-Id: <20210830041729.237252-6-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d07f3c08-3338-4d49-d492-08d96b6d2fec X-MS-TrafficTypeDiagnostic: SJ0PR04MB8273: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QMD+hUWtURVnIRDqMaqZKnE6wsMoGKVHqPmslMHEhcYMFIBmNyTp94Edy24RqM0IBEKf65lGEamecyJoUkiBgr1u7KqORpceDaLQgFmY6SxPahhQav+ygS3dCavxIXVKlPiHKjs517blSOcN5hGE9R+Ljxi4jmYcoB4tAUd2p4hivKtefHQlVHWBd1q/NBGYKsS79j5eJrCwABZ1n3EQgnmIyBLRs5C6XLYg9/ORYbctXCCy9hsa+o6GJri3QWORWVZMnf9w1FqGxWWcPLmLfOJvn02rJM2JUt7UeO/ZJfe8YzWolcnu6go1dc8KpgGbRcjM2CpakTBz0lLdCcBfRKdBUY6LnBe42URYRVEOCgBgJV361AkoS5PdT3FbrfBWorrG2kUxDjNB4gfvgMLzmraXRFcyXmIQ5JiGhPd1VtCKIY6h3kQoXmzYzTYSLV85Xnqw+x39u/jsCucDhoknWXkuZLG+zWZGx7PVGK/RumICcbmw/PNTIsRnPqIJjazHkLvIt/egsjOpPgg/z+2kL7+KCJSoV+L/ngibqJVF/Ts1H/ORd5mqJDoPwq87CsvXgdOl7JbnTOaKdIwN6eSZBvVETIGEe8ozxjjqI1fzJ8uLji21/bwqRMUnpnggTDSOUrLd7uPveK/XxfeZO9Aj87PnxD1Y1ljvzcE111WxiIOwtTbRoKMhdPiSjWei69z5PZ8Ah0ogY0Cub8fHPzTUHziMecPHmWIbWzCM3zs2ymczKSCf7C7m+2mkIUr4cQit5cLAiEiddVbAIGJYh+BSEdV2dvme6Wi3WS+p+cB66reiBLZiIbddsRfqEUFNHVRp X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(2616005)(6666004)(966005)(186003)(110136005)(86362001)(316002)(66476007)(66556008)(956004)(26005)(54906003)(7416002)(36756003)(8886007)(66946007)(1076003)(44832011)(55016002)(4326008)(5660300002)(478600001)(8676002)(8936002)(38100700002)(52116002)(7696005)(2906002)(38350700002)(473944003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fBy0vkYC8nxGf6DltTPgnSXaMOdDvfskMrGdYeNuADS94fVdZ3ILIOk0iU1A5908UaJMtTzRsHEHNYIP9FTUnLEHPFxKAO7tCaGJT5exFi/gBFC4sJPJXAHIJDV8T0E91uD+cdlQukSuweHFjXC4jcK5LnjPcjbVhKWXcnCTi6Z/cTnIFP+h+k+4DNjaPRs6ZueDCPZdQlz1ehxpmziqsUBE8FQO2LSm6ZeXi4ABmMUAwsX/5e4xjMmhhet3C2aziR3w+D80P570AJ7F7/cox8VMXop4PddUwNn9LmNOSBpBRziUmuCzRcadbayagyBpcdxyakQWxBRf9ei+W+mx4FCi1lnbngB4ExzC7dlBDMdaVdDnfHW8SEMa2B2iypAs9b9ejBL1q52dlNlLFq0X//4lQdaJ+2JPuA6GPViJNFIUwP8NDoPIe1wcBSv52PqvNu1BawiAfglGNgfBZROCw3nZnoJFYktBELp8kgnQgl/vU7hl27y/Yhothz0WB3G1K9lEj22JINUgqrjYIRvMRTuhYNv0cDvBjZiw1XAX/tYLm8GKhwaBNTHKzUprCuw8xWyDjSW2gQIUjaPoAWL+KBiEAQOxS/bkrNk6l7re+12hyxn+AQKtgwf/GnmBoCcuslvMAFebOvSgEXFhCmH3hsPECpnG1mnqQwT937Qi8++9af/pHZxqtVNWGcsulaBoKWUtbP72rbBtHutCl+7rvZzARA0AvU4nu1RLvnTgrD1KOkuwDJBQ4IqeTSisd3kom/krX28VQWCUhbwp5VO/UF1EaB6NdTw8ITME4Fjx5HTLj4B1+Y2LxywvfuShmATlcVlRLhIqjpB5kdS3xxM+Qyqju36UBqx4QZa2Qno23Tlm0tUp4/ebHZyEf1XKFqAFzAg3709tWXrIQN/18aw16wy/LzRZYXlYgL+EKT9qpNs3UDlAz6xKsn7D88NxXD22D6SelEyDcPRsbWtfdvAUQUzPfxtBX52fFx4ZT5mUD4YvKPug6tYA17SmNhMOJunFAmgTpN6lY240zpIZJl7+UITswBFaLxnm/9HJlEfdinlDYeCB1ZvS6TCAzBl/vX5zLdHfqoPE+mO+520BH/EzmmU56fRIAADJcNRjYd8zj2x3HNr2XAHFkWR/QsEA1rXWKaJqNQykoXF2lU/WZlrOAwUD2FV2X0kR4wzTTznypgIeVN0HrvTx3WvSYOxat+cJPL/twzdxV8dNLbLmJcHyMW5hNJRz32elDEH+W16aHB6D7U2dVtDd1RuIzdZqhIS3Ilm20AypSsmtn8kgPvrdDk6TfSd4rgk+xXzb1byEmDM/Jh1Yyz5ey8Z1tE9EIXtu X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: d07f3c08-3338-4d49-d492-08d96b6d2fec X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:15.2638 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wpwXnTC65TTXPBPa4CqnwDoikJOxELaBSotBkXKGiDCmlrgaFPBdsUMtille9k+NoNpOh+B6Ec7NSki/+PeZTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB8273 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211820_353727_5EDC9A81 X-CRM114-Status: GOOD ( 17.73 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org We add DT bindings documentation for the ACLINT MSWI and SSWI devices found on RISC-V SOCs. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- .../riscv,aclint-swi.yaml | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml b/Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml new file mode 100644 index 000000000000..68563259ae24 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml @@ -0,0 +1,95 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/riscv,aclint-swi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RISC-V ACLINT Software Interrupt Devices + +maintainers: + - Anup Patel + +description: + RISC-V SOCs include an implementation of the M-level software interrupt + (MSWI) device and the S-level software interrupt (SSWI) device defined + in the RISC-V Advanced Core Local Interruptor (ACLINT) specification. + + The ACLINT MSWI and SSWI devices are documented in the RISC-V ACLINT + specification located at + https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc. + + The ACLINT MSWI and SSWI devices directly connect to the M-level and + S-level software interrupt lines of various HARTs (or CPUs) respectively + so the RISC-V per-HART (or per-CPU) local interrupt controller is the + parent interrupt controller for the ACLINT MSWI and SSWI devices. + +allOf: + - $ref: /schemas/interrupt-controller.yaml# + +properties: + compatible: + oneOf: + - items: + - enum: + - riscv,aclint-mswi + + - items: + - enum: + - riscv,aclint-sswi + + description: + For ACLINT MSWI devices, it should be "riscv,aclint-mswi" OR + ",-aclint-mswi". + For ACLINT SSWI devices, it should be "riscv,aclint-sswi" OR + ",-aclint-sswi". + + reg: + maxItems: 1 + + "#interrupt-cells": + const: 0 + + interrupts-extended: + minItems: 1 + maxItems: 4095 + + interrupt-controller: true + +additionalProperties: false + +required: + - compatible + - reg + - interrupts-extended + - interrupt-controller + - "#interrupt-cells" + +examples: + - | + // Example 1 (RISC-V MSWI device used by Linux RISC-V NoMMU kernel): + + interrupt-controller@2000000 { + compatible = "riscv,aclint-mswi"; + interrupts-extended = <&cpu1intc 3>, + <&cpu2intc 3>, + <&cpu3intc 3>, + <&cpu4intc 3>; + reg = <0x2000000 0x4000>; + interrupt-controller; + #interrupt-cells = <0>; + }; + + - | + // Example 2 (RISC-V SSWI device used by Linux RISC-V MMU kernel): + + interrupt-controller@2100000 { + compatible = "riscv,aclint-sswi"; + interrupts-extended = <&cpu1intc 1>, + <&cpu2intc 1>, + <&cpu3intc 1>, + <&cpu4intc 1>; + reg = <0x2100000 0x4000>; + interrupt-controller; + #interrupt-cells = <0>; + }; +... From patchwork Mon Aug 30 04:17:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464525 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 EA8E8C19F37 for ; Mon, 30 Aug 2021 04:18:46 +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 B663360F8F for ; Mon, 30 Aug 2021 04:18:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B663360F8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ic4FqOceM9dHA4r6cS3KHVnwErwzdt54BFA+L1YrlqQ=; b=jMStzSuCdxb/F0 4wZ3vI8t6vvrCYcug1ycZwscz6ORLAH2NYrcTojPt2GWzDy8wdNYv7H5IpoDOWxQvYmcKQ6IXroFm KSVdrpkeLUO23saKWvIMuTIGX/6XaPrRpkS7X4tiR45vAGvYo7AKutceBJRINtNMcHQUUAnOmTAvc bd+wFWtmXL7xymtRnrI5INIWjpheXC6vPFznaLWYd9pL8nTsIS6jJsoOgYpG9nApiGkjsP4DCEfMC DDy0kqGYHTkSQfiF687CxJXPIeKEusoRI1cPEQjF2N8Kh4n5fCBHMuWAs3+PAGTuQ6dlVgWBJxKeg MXZj1uVSa8Amx/64UTGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkf-00GOU9-01; Mon, 30 Aug 2021 04:18:29 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYka-00GORj-7k for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297104; x=1661833104; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=C9/elSbr5yehmxx7fr0kbidIpXGbyfdwnuv+2zhvAaQ=; b=RWoltD21KUaIFqPgRJ/mj5DPjb9wWBCd0/WQl4dRx3+7vWqbeVyotPBf ZGvVbOHYVixxStjR91ZhhBPD9KSe8JYuQDSRmyp9MsUU0Mhf+49uXE8tZ tMgF/Y9lHy/PT1guQryJdMlORUJm7RyiL2nVl060sjEh+Sn5So3yeUkOs x5gQ4bH3CfrYYhzZGFnnZoQTkTEwoxwHUOaMhm+0JFNGFTLKPi3FtOjMS vhiwtVJO1Z6fiSgqQ5paxCdnyILPVy9SIRZUg/HbsAQSNvUuxMGFrapLY lUkYplTpTbidcVcFI6HHyTexI0voLxLnR/PhgoBezknnfWu6EV4ro5oyJ g==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="177841324" Received: from mail-bn8nam12lp2172.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.172]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:20 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TOJv7T8E/s9LDUY1/333Oe1OX5QtySHnvKvWHga9xRfBptGF1LwrtlYOlxihDH+ccgBbA0FTVwSWOksrcaWWN14Nbud1A4A6kdNH9qevyJEJIZHRWojt9wuakst/qAc3tQDPGQQyVvE7pc3RnG1QYSH6SSg6hafl/NIoXiENjOm/gYI0z5WxwTzkktGUtO5YRjaytil6BP7sJZd+PFN2ZOztxJlhtwjlddI1odrup4UN6aOHgkan0fPp9Vn8dpUeizTM85roa/GrGrpWxm6V2ZqD3DRQ2h+IaynmDFJoKG1TvaAP0rFI8rwnMTEVV2yIbk0FRvUO08gS78ysqB8xAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRy5w8eBGhfSZgy6uQ9PYs00ukcfzSjzb5Mo08PuMjE=; b=ZBFb9+JrWZ8nXt9cwwTYTJ9wU9l07DB7HrpcA6q0Jc7ZF0SYrAwCH2vqPBO5/QWtZONzGGtJUYt7IEZiscwVkNvbwDsDPktv9lCVFN/lWtoKU5gaFURO47yomhHsGQc8JX/AEJ+M97wXDG0eFbWpBoKJRvL0egXn1QHmqHMBA1MIaIlMcJqIx5+AierpzE5vNPVbt3snMUyLFdfjMGqxKx518DHK890v+9io51puSdK08nGMnXMMeynflNED95ngGRY6MZgOodnH5nDq07BCQ8U+vouPgNDJG/V6DvRtxSXQLO7g0737dF+v8gGV09H1GyhPhySVazqacBe123SPMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRy5w8eBGhfSZgy6uQ9PYs00ukcfzSjzb5Mo08PuMjE=; b=KZPCuwGVfnnQmLxD4/EC4MBoiyZ9CzLnqK/UeyX/gQMfWteGiEQovHyaNz5Am0cNfM8o8pDoBWfHJGgAG9yTPJZW+R3DHAtzM/0Z8voF5dkegTutInjr/01cOhylaGgtm/YNIBl9tZtJI7D7BD/JVquT+42ecMEkWC/dhArY6+A= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB7870.namprd04.prod.outlook.com (2603:10b6:a03:37e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18; Mon, 30 Aug 2021 04:18:19 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:19 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [RFC PATCH v3 06/11] dt-bindings: timer: Update SiFive CLINT bindings for IPI support Date: Mon, 30 Aug 2021 09:47:24 +0530 Message-Id: <20210830041729.237252-7-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e7b9bd03-85e4-4786-a1ee-08d96b6d3279 X-MS-TrafficTypeDiagnostic: SJ0PR04MB7870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IAgKJ7wU4VlmmdHmct2SZ4ilH8/6didw6qyPTWNiidaKVSWKZI+IJ8Z25KzFemD2uTnRqptZ78uJE7X82rj0in5cG0/rAHxOJxJfmsqxwE+ROofDClRxbQLDMQd709txau3IGhAe+aD8he+LYSi7ZqjkKX+0xzNU/5FawvX8U/BU1jwhmHM8MXhdpL5o9pOuEp6BekBqCEAfXguBffnUjBOOygxq3s4fxZVhDdnZB62QMclp+rf1p4raxHjo+TfEJJ5KVo0L7kgbxC+8byX1wj3c5RbbRliHhSE2d1u3fH/07bjunYukFa2OHDdMm0dXyqpZj5fwHLHacH+mwcnk61NBjLnwuKDalQe7Xtuh2MCDwgZeDRRMWWvMyr9emwlqTXC1bSnxHewFLfIi1RFW9A4wBCOVIlw4iVmKf9xVdidI046EyMi3n0loDMSOkcOFhTj4uljoRNQOIxReisHppmttWO2yAByzdMFj60DGv49IoMEduRyo2zDYAs+LNuUPR+LajYXMBV0OhL6p6mLAqSNvbYEWp8ZkJyQXJB/dh2rQRSlR0CIkomfSSr/2R1qshb7sJGlfwh4b/Afc9vF3nXSvVgGJjXrurvpEfwos7nh8YL659twuRObMNoD9hZzF/NqMAubqkbDok1bhQcwRgXnLKRdEnpyvFCnSMzLtEsnX9QESJOIezF1Mkrt1q18eqQV9y5Ecibti4z2H2M5hnYVeIoZpseeV5EF1yO2Kr3o= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(6029001)(4636009)(39860400002)(376002)(346002)(396003)(366004)(136003)(55016002)(110136005)(66556008)(66476007)(54906003)(8936002)(7696005)(52116002)(956004)(316002)(66946007)(2616005)(44832011)(8676002)(6666004)(2906002)(8886007)(83380400001)(5660300002)(186003)(86362001)(478600001)(7416002)(4326008)(38350700002)(38100700002)(26005)(36756003)(1076003)(473944003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aIkr+qo01DZPhMi3IKpD1uoZtSSbnepa4vqpQctoEVHuLs1eUbQPGAmDvyPED9Wga/OKpNqCG4mEo5e1s3TZdW9GrFT8+R/4uh4+RlshiBChpSu4RQ843rUFTU4nOLT6+wjNkK+RA7pDR7UdktUTRRRCnu+PkGgSoyrsv7SMJxCSJfB7wbpVdLp6Hd8llU0N3Yoyh5dl078QOtLFxPKuxFx0OoKTS7+2Szd6QEBdkoryLceCrSIslMV88jOoT3xjT2Ujnt0emflh/oh7MRNQEeaMt29oPO4ux+71gdVUfTH0JYK4I8FRTsL0SaeY4wTrSz+sYK+fV53tCg/cTtSVF4fNI+YS07OnoWihJ19mG4WiOyMlq3h2Ts9Bc6IH6JXB9/XAf/2LNaJGAEZfTVmhITYnoceN+C8qr9mal4KofxyRfDukvIz4GS0FqOD3aErzDsf99udSfMmtGfKAerpZ1+9RirPSejwx596c6f/etnCGiWlqcR8Gi8aFHKtkR9aHuVt7ftauADOQHTpG01EP+5tc9joxVM2QTsFaPggRs2sVdO0Ur9qvROHUd3x7Lq/bB1MelLgyWXDGXBTTDe5ByuIOUlIIbQxzrz3LbRdnXYnSfOip3PZOkxkTObeozj+Vh6glY9yJuIxNHx2/R5l0uN4smlQpdbkM54fMU8qghLgtIcVbqyYde4ovPmPGbiHOcC55MHPficBLVQ/lZSiBHX1893gyGytgEpaui2n2QtVTNN5jAc+Gso1vNKX2gKxDOR1uLZiEYJHJE26s1HkIWhgnxbylVFhcExZYD845E7vrEwIMUY/2fEjMnjv6rl7Tk0FQiNreUgywy+6ZVDLDSUrm6+Fb0u8h/1x62FXPfvzZXH5FWRCW7yenbZk2M5tk0okybsexPxx2gJRoykQ6KXFl1BokZoHS0oQ1jKvjBbmjr5Lm9BotuOFI+JdVoNuHyH5Ao5icm+RRpCz1PD4CgqE9JDKsV7Bjup6DuM1Onvm5H0ZPFS+MzgvGst5daH6mevLWYMKcvdAw2gO1Q/qPi1RMcR41U+AkUS4ifCRlr1dBEZS2ltsg9elGpOFDkmW4xm386uPUzwSRLRrpcHXmoSVfQEfRqrkn77V2XLQxam/PkZmXVTZK33EIkEunjmdjfLL/zEWGuKvKwPL+bhPQF+HAR2fvQfx2dC2OD+g0lZSEbIYJZswiHzRXygHmvEFVs2FKMKHPMHkZPEVw5bj7zZ33smkDGpbG2g9X8OOOOEdsuZeQ6zNWSSJUFlLw0Q9+/1dWY7mleAX6m/eOwthsF8N34CqPd9bSFqi806CtQQCxSOkvf0jwmZZmkZh/2z55 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7b9bd03-85e4-4786-a1ee-08d96b6d3279 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:19.5380 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9AgkEjRa9J5qdJiLGarNYsgnygSbDaMGImKtKQO0uVUzZEMYOZJlOPuI+evPdN7RjBYCK732m18L44ZemlrzGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7870 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211824_384144_AF63D798 X-CRM114-Status: GOOD ( 12.33 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The Linux RISC-V now treats IPIs as regular per-CPU IRQs. This means we have to create a IPI interrupt domain to use CLINT IPI functionality hence requiring a "interrupt-controller" and "#interrupt-cells" DT property in CLINT DT nodes. Impact of this CLINT DT bindings change only affects Linux RISC-V NoMMU kernel and has no effect of existing M-mode runtime firmwares (i.e. OpenSBI). Signed-off-by: Anup Patel --- .../bindings/timer/sifive,clint.yaml | 20 ++++++++++++++----- arch/riscv/boot/dts/canaan/k210.dtsi | 2 ++ .../boot/dts/microchip/microchip-mpfs.dtsi | 2 ++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/timer/sifive,clint.yaml b/Documentation/devicetree/bindings/timer/sifive,clint.yaml index a35952f48742..9c8ef9f4094f 100644 --- a/Documentation/devicetree/bindings/timer/sifive,clint.yaml +++ b/Documentation/devicetree/bindings/timer/sifive,clint.yaml @@ -43,6 +43,12 @@ properties: interrupts-extended: minItems: 1 + maxItems: 4095 + + "#interrupt-cells": + const: 0 + + interrupt-controller: true additionalProperties: false @@ -50,15 +56,19 @@ required: - compatible - reg - interrupts-extended + - interrupt-controller + - "#interrupt-cells" examples: - | timer@2000000 { compatible = "sifive,fu540-c000-clint", "sifive,clint0"; - interrupts-extended = <&cpu1intc 3 &cpu1intc 7 - &cpu2intc 3 &cpu2intc 7 - &cpu3intc 3 &cpu3intc 7 - &cpu4intc 3 &cpu4intc 7>; - reg = <0x2000000 0x10000>; + interrupts-extended = <&cpu1intc 3>, <&cpu1intc 7>, + <&cpu2intc 3>, <&cpu2intc 7>, + <&cpu3intc 3>, <&cpu3intc 7>, + <&cpu4intc 3>, <&cpu4intc 7>; + reg = <0x2000000 0x10000>; + interrupt-controller; + #interrupt-cells = <0>; }; ... diff --git a/arch/riscv/boot/dts/canaan/k210.dtsi b/arch/riscv/boot/dts/canaan/k210.dtsi index 5e8ca8142482..67dcda1efadb 100644 --- a/arch/riscv/boot/dts/canaan/k210.dtsi +++ b/arch/riscv/boot/dts/canaan/k210.dtsi @@ -105,6 +105,8 @@ clint0: timer@2000000 { reg = <0x2000000 0xC000>; interrupts-extended = <&cpu0_intc 3 &cpu0_intc 7 &cpu1_intc 3 &cpu1_intc 7>; + #interrupt-cells = <0>; + interrupt-controller; }; plic0: interrupt-controller@c000000 { diff --git a/arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi b/arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi index b9819570a7d1..67fb41439f20 100644 --- a/arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi +++ b/arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi @@ -168,6 +168,8 @@ &cpu1_intc 3 &cpu1_intc 7 &cpu2_intc 3 &cpu2_intc 7 &cpu3_intc 3 &cpu3_intc 7 &cpu4_intc 3 &cpu4_intc 7>; + #interrupt-cells = <0>; + interrupt-controller; }; plic: interrupt-controller@c000000 { From patchwork Mon Aug 30 04:17:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464533 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 7D492C43214 for ; Mon, 30 Aug 2021 04:18:57 +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 4EA2660F57 for ; Mon, 30 Aug 2021 04:18:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4EA2660F57 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cfvlw3HuzUIcNAkHAbbWxSYXItgYfSMJu8BvKO9MKG4=; b=oJhVABORMDCCpF gM+Hl1VvmxUPBQQY7Kh28xVPXsbJCcOOdFbSTYla2Uym8Qsr7dMngqz2rvhbrcP4Y3FXRIbn0hAgl ZxAvgru1q6Zo11Btz8+8pfkhZvuBYgqhaAosNyG7w7wxZLfmX9wBOJ1WX859mQB2x2zkCP9jc3vKB cd2gpaGSNyuBG5yWakIYHC61q/dbG2J1HkVna1G0wmfD5xycVLVIb3rmmC8B9wukHn4ktZN2BSx02 4vIU6dfWQaGotIgHW4taCw+70P9FvEKpsrHy4OXvXMyx8xaXLCoFMLgJ7i45UiQuIzNt4iIM1Y+hz Ozrv5u/+3QQSSl1qGBrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkj-00GOWH-2H; Mon, 30 Aug 2021 04:18:33 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkd-00GOTB-6W for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297107; x=1661833107; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=MnAyQ1HiHgbLpHJ4fcLV2lkJX2VNxilW1qn/1yH1N6w=; b=BwsUwZIhpK3r2Sx7EdyIs53mvnQ3wMf+xYopH7xFRkbRuniXUTtOaoEV Kxax7xuG6ysBUc+MzRm0hOKAcTr9w9wpFp4CFxQsgtPAlllRyzGvAdYHZ ba9NiqKLcc82QS5B92fDc0Y7+i/LYApl6h2Uk8/dUdrItoQH6+T61T2JY AjjhzvHQWueXooveDtRYnhFvkDRY9/t+XHJl+S/c1bu4g8BZOo/vSRXsH wKtLbmX2A7ZEobOQhovfH4ADOj7sPWEU9G2WKDHEzWYcJQ7XAZRphNLC5 s7XsfhmlYALb5eOy+EOHlv1oOCpSK8lgozyinH+E9UrjhkWuuHcjPyLvX w==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="177841336" Received: from mail-bn8nam12lp2168.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.168]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:24 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cGm1TpNxrrEa97rvGtwOSWTExs/gCWiaA5rRgGgAdhEw0uQ7MqpIbDbtLQpLBu6YCw2M1RvU1108yHo4of3Lf3UpDGhtaXYGRhzZSDTk0uVpmiGFBq78NYcVKqrjkfjBzVjGhIE4nsentHu4ka85FMiHCfFQJOPqnpp5gyqtzh6n22E+oEmPGMs+s5A/nS2HRGkCiOn5k0ku91JwbaAZOvK0Hso95TBw8+D1IRLG74o+7ul4EEBP+pb0DNvJ+cZinB2+4cfY0/P/kJLb76PVur9oVJNmlR234iw1WobQyzf3NrGs4IIEU0XkFMr75MWliUojKXijXJZYU6VeRQXBOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g4BiG3zHdqnY/mJM8drY3TNEtZLaRqBEhgasukGuwbw=; b=VUaL/XVz6xecsc1MaYC549bp+ijMwfD0FHiI7vT53yoXkZUQcAiaCDzHsqSagZOhYtTuxrGUShdO8iE58Jfs6NneRnRcqTLCH3QS3s0ZVVj2dDWRq25JAmnJWc9hpNbVqC+VxJrqHYxr1O6Q8TvIm7EY6XlmiDb5IxP80RR2UGwoMRtli7dhAU/BS1gzdvLoTkvAB6criMGKAwk5aVt7GGmS+3qY9OyZ3xesVteF7+IPR5i1PK1o4e/DmquN8Ppa0oKzaBYlVo7GfyZJBANtEESHsGYEUPT62w+nIlNrg7CsBSBCABRxDQ1Mtk8KaMkcjgFGtbxy6dXCyAnz1P6/VQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g4BiG3zHdqnY/mJM8drY3TNEtZLaRqBEhgasukGuwbw=; b=zsdNcX8bWKp6h1CQYOrLqMJl2Z9Y+z2AthULbeFUd9xXH4do5Rb41plxD56gJlkkvKgEAmZ0HyuI74b1L5EH8o1saIvw8v0wc9VSGRbnZD0mtdmTkH13YGWzg976jDsdDDfsBG01/rxRoWRthCFEcydYDwW6c8bwJx1dseLYuD0= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB7870.namprd04.prod.outlook.com (2603:10b6:a03:37e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18; Mon, 30 Aug 2021 04:18:23 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:23 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [RFC PATCH v3 07/11] irqchip: Add ACLINT software interrupt driver Date: Mon, 30 Aug 2021 09:47:25 +0530 Message-Id: <20210830041729.237252-8-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a307f43-4be3-4043-7f8e-08d96b6d3507 X-MS-TrafficTypeDiagnostic: SJ0PR04MB7870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u9t0OKpMXRlwkjTQnFexHNMa45OCm5d8Cc/aRg50fFvZ3bbcQ2f/HQJr2tayObMI4wvpl/RUesmJTiWkE0oh5evX9tAVgYhcDnc9PaX4qKua3ag00bv4OToKOqJF1UFOLDrRakIziwO4GM/PVvyMw5XjeyMx5et7koH0Zs7co30YsSZUSYJewKQvW7fYUKLXvadrsW8/EnWgyzLn5vauXJoDLCTMlyFxPApk1pkppwTBmNUHftei+mq98Y+456FQvon2x308IKP1EjHxJC7GpRfwtHFPXrQu4dU2mHYt7gOT4H1CA/pFmTSK/JftxT/m35q5kTO6tNCJS/ZOBJ0RmUFzs2x+lBFBL387psQRDyXl2EzA7DIU8PFso33tjYBmrzjyxz5QXK3LWfxxYBTvrU3Gqs3Nzkk7JAI6LCILnPB0KgRKmg39c6AUQWUbzIodqlDbK2kR1YzMKbC4g6A88eOTel/MzNVzmtrMU8DNpIk0t7trVPE2zn+S1U1t4TOXiR2nI5WNp4RvDUjixEOXAAsquzSPnTno6bbrp7/P75RNCZMFXX+0ttVCVx77arpBgGXtbDO1dAd+8zeNJc1R2ev5NrOY1BArDKlx3xWy3ZeduEwcIVXkmCjRX2NqWErZp8BGUC96NE/tNM+DHuWTClvMvptv9odWgMBVZfidEgMH3VbH80s/G9Dk/Tlog1ctn2s9qlaAIsYdHTjEsFmXYg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(396003)(366004)(136003)(55016002)(110136005)(66556008)(66476007)(54906003)(8936002)(7696005)(52116002)(956004)(316002)(66946007)(2616005)(44832011)(8676002)(6666004)(2906002)(8886007)(83380400001)(5660300002)(186003)(86362001)(478600001)(7416002)(4326008)(38350700002)(38100700002)(26005)(36756003)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KlJVAmHe4IDZDpIzcHsEaHnViABhLhiaexc67XDDNRunYMQfB/0j36OGECo/yWPlOKwSNA+mgK4UTNXqykpTyALAEoCANaK6AO8TT7VKcb2we6uwmhYSS3Mz3ZKSzh+vf72kwjTcfc/TKHcjlfaMyxDsjhzeSleq9SZYP01fKQJdtnWLhTs7Y1TPEhBUKQ4XSsS1hFkPMkUmcBKaJWOeHGlxI3TvvJyI68O25ceeum9hA7fX9kApVfCadfiDLw0SctRKhbaxbxLOkI2ugY/mB8ZTbCZrub76w1rjbp2A+7F6l34kwtm6Fv7HsT0htlnp987N4klBMw40C+3E/2DQTIXGrrfh2QMUUSwgIe2ZL3jvqNIjdkN3JfVRMkyE3ZbB5JKHiVNYK9e3RWJ5dttaIAhVis+yUbfNmeUYWvOHBgqNE5BhTgKjbu73OzGUPSRwqE/mzqEPo5gajfPlnuKfITLsqg7wQA/M6cLXi9fjisIFlru0gLNx84Fpws477EiXuZhTKeWQf95nMfbekfO4+IUn8qOmoGKIavjT6n6q3/jwZKYNPcsHL8BVhni993VlL7pytfqc8EfOzxIV52PFVzUHT2/Bs5JEUJWDPzOKN723uLhADe6DLWmUVlQtO1sd9fkhZeH6iw56gfAoRWpEENtZ7TKJGEhunkygEMEyNTMcWRq5mACw1W/wKIdr7iorldQPVcRjdRD5TMg2ay9zQlQld7oOJhTb4Te5YKg98FFjNrKAAbB+h29jQpefkyBpXnV4F/ma59lsP/ZBTjIb8ZloiKBAfiG/iNcZ7HT2kY3jaEq0NdsI/0qXRtiS6WeFF3wbtubsAMEqbNnFRceDfHxeuWeoObk5c8ORLztS1/S2WJ/G2m51JCs7ZnhQlo9K1s7/5Hp8kz9UTPKA6gy9BzbvSDSHaii0qCg10vAq/uwnPmwb16QGe5a4bGoU9a05BPi9qI0H2s2bvKUMgG0y6CA4pJpa9xoYj5UHZCWMXcxQ0zP46m4h3ze6OGwI+laz6GVIUzsFAtvg8Iu4vDlHBXzprJLGnEFSpMp6C0hUdDDzYdfcFaIFW+bATB4QeVYpGEXYY1vce+6rdzahyX/iwGyH8nB7g8tPw5iwUiTgL3D5U5dL85GouIN32kUM50S+zJAuUgDOkTiSyiDaWorb7DIY/V83kXfuy6DeoJn7tef+FWQps3XwaE+HAREoNJOJMOisebtfyuxhO77/IMnRXMnYqvfU/BXUFANm2ZFCV163NmyOThmdPzQuVgJYguwiGCbwKZ1IoTxESIgn04/X3q71RFb+5+5feMor4dIZstvrKJ9as7pWPdJ99ZFs7Qzr X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a307f43-4be3-4043-7f8e-08d96b6d3507 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:23.6619 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 11pfm2flX8yPxDlJ/jeZqVZptyiT5NMM2fgQcO4HafpGq+pyYo3IlbRDvu+rsyh1AUYSBgL0yRta1KVywA/5lQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7870 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211827_416439_EAE7C52B X-CRM114-Status: GOOD ( 26.65 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The RISC-V ACLINT defines MSWI and SSWI devices for M-mode and S-mode software interrupts respectively. We add irqchip driver which provide IPI operations based on ACLINT [M|S]SWI devices to the Linux RISC-V kernel. Signed-off-by: Anup Patel --- drivers/irqchip/Kconfig | 9 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-riscv-aclint-swi.c | 265 +++++++++++++++++++++++++ 3 files changed, 275 insertions(+) create mode 100644 drivers/irqchip/irq-riscv-aclint-swi.c diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 4d5924e9f766..4e7458c551c7 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -508,6 +508,15 @@ config RISCV_INTC If you don't know what to do here, say Y. +config RISCV_ACLINT_SWI + bool "RISC-V Advanced Core Local Interruptor Software Interrupts" + depends on RISCV + help + This enables support for software interrupts using the Advanced + Core Local Interruptor (ACLINT) found in RISC-V systems. The + RISC-V ACLINT provides devices for inter-process interrupt and + timer functionality. + config SIFIVE_PLIC bool "SiFive Platform-Level Interrupt Controller" depends on RISCV diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index f88cbf36a9d2..81306d560972 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -97,6 +97,7 @@ obj-$(CONFIG_QCOM_PDC) += qcom-pdc.o obj-$(CONFIG_CSKY_MPINTC) += irq-csky-mpintc.o obj-$(CONFIG_CSKY_APB_INTC) += irq-csky-apb-intc.o obj-$(CONFIG_RISCV_INTC) += irq-riscv-intc.o +obj-$(CONFIG_RISCV_ACLINT_SWI) += irq-riscv-aclint-swi.o obj-$(CONFIG_SIFIVE_PLIC) += irq-sifive-plic.o obj-$(CONFIG_IMX_IRQSTEER) += irq-imx-irqsteer.o obj-$(CONFIG_IMX_INTMUX) += irq-imx-intmux.o diff --git a/drivers/irqchip/irq-riscv-aclint-swi.c b/drivers/irqchip/irq-riscv-aclint-swi.c new file mode 100644 index 000000000000..c61987d2f823 --- /dev/null +++ b/drivers/irqchip/irq-riscv-aclint-swi.c @@ -0,0 +1,265 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2021 Western Digital Corporation or its affiliates. + */ + +#define pr_fmt(fmt) "aclint-swi: " fmt +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct aclint_swi { + void __iomem *sip_reg; + unsigned long bits; +}; + +static int aclint_swi_parent_irq __ro_after_init; +static struct irq_domain *aclint_swi_domain __ro_after_init; +static DEFINE_PER_CPU(struct aclint_swi, aclint_swis); + +static void aclint_swi_dummy(struct irq_data *d) +{ +} + +static void aclint_swi_send_mask(struct irq_data *d, + const struct cpumask *mask) +{ + int cpu; + struct aclint_swi *swi; + + /* Barrier before doing atomic bit update to IPI bits */ + smp_mb__before_atomic(); + + for_each_cpu(cpu, mask) { + swi = per_cpu_ptr(&aclint_swis, cpu); + set_bit(d->hwirq, &swi->bits); + writel(1, swi->sip_reg); + } + + /* Barrier after doing atomic bit update to IPI bits */ + smp_mb__after_atomic(); +} + +static struct irq_chip aclint_swi_chip = { + .name = "RISC-V ACLINT SWI", + .irq_mask = aclint_swi_dummy, + .irq_unmask = aclint_swi_dummy, + .ipi_send_mask = aclint_swi_send_mask, +}; + +static int aclint_swi_domain_map(struct irq_domain *d, unsigned int irq, + irq_hw_number_t hwirq) +{ + irq_set_percpu_devid(irq); + irq_domain_set_info(d, irq, hwirq, &aclint_swi_chip, d->host_data, + handle_percpu_devid_irq, NULL, NULL); + + return 0; +} + +static int aclint_swi_domain_alloc(struct irq_domain *d, unsigned int virq, + unsigned int nr_irqs, void *arg) +{ + int i, ret; + irq_hw_number_t hwirq; + unsigned int type = IRQ_TYPE_NONE; + struct irq_fwspec *fwspec = arg; + + ret = irq_domain_translate_onecell(d, fwspec, &hwirq, &type); + if (ret) + return ret; + + for (i = 0; i < nr_irqs; i++) { + ret = aclint_swi_domain_map(d, virq + i, hwirq + i); + if (ret) + return ret; + } + + return 0; +} + +static const struct irq_domain_ops aclint_swi_domain_ops = { + .translate = irq_domain_translate_onecell, + .alloc = aclint_swi_domain_alloc, + .free = irq_domain_free_irqs_top, +}; + +static void aclint_swi_handle_irq(struct irq_desc *desc) +{ + int err; + unsigned long irqs; + irq_hw_number_t hwirq; + struct irq_chip *chip = irq_desc_get_chip(desc); + struct aclint_swi *swi = this_cpu_ptr(&aclint_swis); + + chained_irq_enter(chip, desc); + + while (true) { +#ifdef CONFIG_RISCV_M_MODE + writel(0, swi->sip_reg); +#else + csr_clear(CSR_IP, IE_SIE); +#endif + + /* Order bit clearing and data access. */ + mb(); + + irqs = xchg(&swi->bits, 0); + if (!irqs) + goto done; + + for_each_set_bit(hwirq, &irqs, BITS_PER_LONG) { + err = generic_handle_domain_irq(aclint_swi_domain, + hwirq); + if (unlikely(err)) + pr_warn_ratelimited( + "can't find mapping for hwirq %lu\n", + hwirq); + } + } + +done: + chained_irq_exit(chip, desc); +} + +static int aclint_swi_dying_cpu(unsigned int cpu) +{ + disable_percpu_irq(aclint_swi_parent_irq); + return 0; +} + +static int aclint_swi_starting_cpu(unsigned int cpu) +{ + enable_percpu_irq(aclint_swi_parent_irq, + irq_get_trigger_type(aclint_swi_parent_irq)); + return 0; +} + +static int __init aclint_swi_domain_init(struct device_node *node) +{ + int virq; + struct irq_fwspec ipi; + + /* + * We can have multiple ACLINT SWI devices but we only need + * one IRQ domain for providing per-HART (or per-CPU) IPIs. + */ + if (aclint_swi_domain) + return 0; + + aclint_swi_domain = irq_domain_add_linear(node, BITS_PER_LONG, + &aclint_swi_domain_ops, NULL); + if (!aclint_swi_domain) { + pr_err("unable to add ACLINT SWI IRQ domain\n"); + return -ENOMEM; + } + + ipi.fwnode = aclint_swi_domain->fwnode; + ipi.param_count = 1; + ipi.param[0] = 0; + virq = __irq_domain_alloc_irqs(aclint_swi_domain, -1, BITS_PER_LONG, + NUMA_NO_NODE, &ipi, + false, NULL); + if (virq <= 0) { + pr_err("unable to alloc IRQs from ACLINT SWI IRQ domain\n"); + return -ENOMEM; + } + + riscv_ipi_set_virq_range(virq, BITS_PER_LONG, true); + + return 0; +} + +static int __init aclint_swi_init(struct device_node *node, + struct device_node *parent) +{ + int rc; + void __iomem *base; + struct aclint_swi *swi; + u32 i, nr_irqs, nr_cpus = 0; + + /* Map the registers */ + base = of_iomap(node, 0); + if (!base) { + pr_err("%pOFP: could not map registers\n", node); + return -ENODEV; + } + + /* Iterarte over each target CPU connected with this ACLINT */ + nr_irqs = of_irq_count(node); + for (i = 0; i < nr_irqs; i++) { + struct of_phandle_args parent; + int cpu, hartid; + + if (of_irq_parse_one(node, i, &parent)) { + pr_err("%pOFP: failed to parse irq %d.\n", + node, i); + continue; + } + + if (parent.args[0] != RV_IRQ_SOFT) { + pr_err("%pOFP: invalid irq %d (hwirq %d)\n", + node, i, parent.args[0]); + continue; + } + + hartid = riscv_of_parent_hartid(parent.np); + if (hartid < 0) { + pr_warn("failed to parse hart ID for irq %d.\n", i); + continue; + } + + cpu = riscv_hartid_to_cpuid(hartid); + if (cpu < 0) { + pr_warn("Invalid cpuid for irq %d\n", i); + continue; + } + + /* Find parent domain and register chained handler */ + if (!aclint_swi_parent_irq && irq_find_host(parent.np)) { + aclint_swi_parent_irq = irq_of_parse_and_map(node, i); + if (aclint_swi_parent_irq) { + irq_set_chained_handler(aclint_swi_parent_irq, + aclint_swi_handle_irq); + cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, + "irqchip/riscv/aclint-swi:starting", + aclint_swi_starting_cpu, + aclint_swi_dying_cpu); + } + } + + swi = per_cpu_ptr(&aclint_swis, cpu); + swi->sip_reg = base + i * sizeof(u32); + writel(0, swi->sip_reg); + + nr_cpus++; + } + + /* Create the IPI domain for ACLINT SWI device */ + rc = aclint_swi_domain_init(node); + if (rc) + return rc; + + /* Announce the ACLINT SWI device */ + pr_info("%pOFP: providing IPIs for %d CPUs\n", node, nr_cpus); + + return 0; +} + +#ifdef CONFIG_RISCV_M_MODE +IRQCHIP_DECLARE(riscv_aclint_swi, "riscv,clint0", aclint_swi_init); +IRQCHIP_DECLARE(riscv_aclint_swi1, "sifive,clint0", aclint_swi_init); +IRQCHIP_DECLARE(riscv_aclint_swi2, "riscv,aclint-mswi", aclint_swi_init); +#else +IRQCHIP_DECLARE(riscv_aclint_swi, "riscv,aclint-sswi", aclint_swi_init); +#endif From patchwork Mon Aug 30 04:17:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464531 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 B3382C4320E for ; Mon, 30 Aug 2021 04:18:56 +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 84E1C60F6C for ; Mon, 30 Aug 2021 04:18:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 84E1C60F6C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u34ZkbS0Uh7Y0gK9n/tHy11gNwhFHeO6LA37EsxCGLw=; b=M8VWPntFLIaMDQ bqTsE91bZF2Yp7zo3lppDJM+BCUzmFWfjEwffOHY0Tv/BP+x0AO/7fq+RsSVmNiEhR+Sx6xGHSxFM lvN8Mq3deyh8t+B3jEXfxRvyiytzNlE5CqvantDtOtk0vGk1jWqrAplZUqBcNePksX+xNcDgFBolP Uyk0kdIaxRjKXXKLS+QVPUDgiN8tkz1+/JegDCeSL8STFCsb4PWk3gB4c182xugHkQGHeOBmNq+El Ro40aGaiPS0+7JHloZduRQTAHnyVfvCHZZ9Eh4JS1sbQR/lHkuuw/MIoid77CM+qU/4GbY78b4LJZ Oi7RVIvbh1N7x79iG4kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkn-00GOYW-2p; Mon, 30 Aug 2021 04:18:37 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkh-00GOVH-Iq for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297111; x=1661833111; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=A0RiadUwWBnN6qLQ6baUXXxCN+i01fbrXSIW3KEH9u4=; b=PYZ3fWRNwMQGC0Za+ZPwwLiJ1442TEjVAIEYU/fIXJPLL7fKU37+8Rvs xk6TvsGTaPkNNLW88nW7SOcpzkh1zrjHMFE+0moU1tIACx62efYH3eV7l Rk6s+SZll4fwysp6dMUPLkxawU/no6DZDfQRAQUtYUH8dp4XQB6rle4W1 OO6rUEqkPagkUwL1uMDVbB1X6/kcfixOuoCk8cHacCbogTQ/FwAREASm3 26mv3UR3I+mvJrnvX4v50RJhJnMsWUagibcYoGveCrNOV35bdiMrhe/5v mQMXpjdbJtzCW36y6Ijlza39Ay7SQ29OgfwnZ4EnQu5b5FPS9rjvVYfd8 A==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="177841344" Received: from mail-bn8nam12lp2168.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.168]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:29 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fUGI1i10X1BMUjREGThwhm9qm/r8d1W2XkhYEKLawk8HWwAmnXnm+dV9u+xr3nQlwzy///qyC1GwWcI305NmAC5bfhkT/JLMMeMaj5J14+HcqR9Jb5ksh9ChcVoc2hsgnkUBPH6tKuohbTv906HuaPJl34W177ULiJIt1TyRhT7nTrljE2tMZQFkyMWv/PeTyAChzw9m/o2cU3XfUL+uVzlj2tSfdixFRdEZ/NmsySAI9fkvJhRFkiWl1CeA3meBJdadi5qZZTAa/myrA1GPqhd1W9zsKgbUPnM79MX/MBVO7aK0OHEgiDL0Up7k2NZVtf+plApawEkAh1gT504cOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QIiEX1BGg/RPcL4NTR0Io5dK6z9osq7SQaNwyA2Tmeg=; b=eVjnioVrMfDya6SwM4EiJS1uF0Dg/V11qZfd2c9iL1sx0WTtH3Hbdht+KGADQ3vcKRVHsfxpmfIDrH+igJcWq+5xQfUQJWC/unBxJJ6pooUcGqL3aFKHSQ/2RX4lVLsOnxuqHRrI7WAdoZeTqG88XEQmXuW/Y6TS2oW2Zp/V+bFdCZWa/xRjTKPQJTZ9rHsAwJeAqC16XEnMkzIm1ApXRkOIJh6GSeXDyAbSNO8Px1hsRu6PD7sxSjBXvtzuU9gumslz5Jk/BQvMUL0okdQ9oJ96nNzr1YLv+syZN76PIKv7bd+5DpiN2sSVfFSsGslb2eTLm7HlR68qn9rJIxihvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QIiEX1BGg/RPcL4NTR0Io5dK6z9osq7SQaNwyA2Tmeg=; b=yj4/q9VyAnhjRR1V32RDHpWFzggHXNnjzIlkm0ube5S6hhWnkBdlkYQvt6JbTtmT19K55aaRzy9zMcosOc1R2Bzqb1Ydd3b8rtgk6DpwO2sCaIDKuIo3lZ1TO6sCpMm6zLzhAOvGZIeRXEwg7lv02mu2nAYLlbOGKqf0IrX7+qM= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB7870.namprd04.prod.outlook.com (2603:10b6:a03:37e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18; Mon, 30 Aug 2021 04:18:28 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:28 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Bin Meng Subject: [RFC PATCH v3 08/11] RISC-V: Select ACLINT SWI driver for virt machine Date: Mon, 30 Aug 2021 09:47:26 +0530 Message-Id: <20210830041729.237252-9-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b176fd73-5e3e-4077-5d29-08d96b6d3795 X-MS-TrafficTypeDiagnostic: SJ0PR04MB7870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XJd2jrA6oCdps8mZdbeychFGo1XbVGs0eiqX1i8brr6rdMYxich3zxPtn+aVu0z41vQ23sZCDiBWC98y/Yn4PBU1tAJ9izz5mSv4H/K+xsbz5xy509ziBTOvm//EdtkjhC0+SH6f84cz/lRaZ1smw6VcfeSGDLHSc5Qfwi5eRlUKkPAdYKfToCuO/EOQKpFEwpnLEV5Be3HgxXIIm0yWlsjis2JgQ8IvB8YI86TPllDHwblWXIVk1/9VxBjm2rHgMSRA2gyHf8vl3s4PBXoHrVx9KORmq43UaVXeQxHn4feyLAWlQmjvwPjFyDP+pn1C3i5Jvzx6HZ6ulqewMqDsAAcOGQ8iEH7fvScpjSQY8u/5z8HL90DAznVBVgIf8ZYKqnFccAknLe0N0W5z3h9nTB1Er8bfNDLVEYq1+0VqkJoctW9Xerf3iAvzHO5cbN4pDjF+N/Ludkxa//Dct1O9GF/zQDtfkjZ5YgJ6Xzj6F8y5r0CEXLjg/37gBImLbEWj4HdRLhZedFPVBLmexF80FHi/G1y/8CkQInrTsmt/oBAMC4QCEeeN0RgUIewHKaE3fZezJCuDdCMib1/lkCCpdMw1LP37E1+6Em9yes++IBZeXGOLNCLWr84vqc46/FNLnLKZ9XkU6BtQhKUr2Tz0Lnu5yFwfqU9rBbqBqvRs1z7bw0ijC829NR8URzzRznUe X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(396003)(366004)(136003)(55016002)(110136005)(66556008)(66476007)(54906003)(8936002)(7696005)(52116002)(956004)(316002)(66946007)(2616005)(44832011)(8676002)(2906002)(8886007)(5660300002)(186003)(86362001)(478600001)(7416002)(4326008)(38350700002)(38100700002)(26005)(4744005)(36756003)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Vnvf2BJqoTbMNCQWhPIlxU60WQCriDqDvc38cI+DDDua9oAGUkkEsHRENH4XAKjTeqkaFaNEr8+9U4fB22/PJc/3pPo3nUb4D6rx3khkwJyAq5JoXx2PW//5f7v2184ObnpYtg0EQBc/W//ROSoER6GtrI07v/XMK2X4pI37S+3FyWgrGaXg6GJPUevK+19hk8rGKAnpavrHZCfxEW9OVuMPIBDqmNIy62oLnG4c5HgKv5V20b6kTC6f2bKe9TLDZoh/hVN0THPPY/IdMSO7HM+eLa/WxxFIBl3XUeE4MaDKT6De3JPLeZloRMG+t0Ggt4iUAtGj0FCMKbnr3PQ0WKScj+i+WXduDnKqkZzYZIsiJRrS+57/EMSkz0iYhFKZXkncuEepBQPhH0JWmyuoej0JabKATNBYmkksEuO27vdmw7tWzuJ4VsfaYPtkzTXT1fWSXelmLAiUox1JPscvP3cFbUxbSSJiFOiuRGODawr/zOpfUHKqrZT2DqDySGACrw/SevY+LD4YtuuaRJD00YWQjdxn6XvOfHSOre9shg16kzBLA+dct6cb0VNdz+k7iO2wf95YauPygQs+/FcFXucvxNrgdWdtkSG+h3EL1X6rjnLg/Nj2Jx+nASNfvLegm5XvBd1wicjwKSPDgkqD5BtdrsfhoeKwfyEaVg6wOUe/wQ1prl+56UK0kPN9DUYqVYNJw+L58Fp/6McKvvjS+h5mi0+W1rbJSfeDRTX9XVy87MtgEMU+vdiuHJlFQmGnPhAWLweK34HUowcYHruXUmbtLc9nugehV0ZZQuj74afoMZK2T6rwQT2us/fKsILF6qzUlA7jWW6DgW2+7Z6MYC2Ku8dBDSQmWZhqwSWP+rFjf+8qH8g0Y5Giqb2o95/j+XlEoBl2tIFJMLo4Bk7gMEL2b8m5yr5B8Ut4EjdTAjgfqfzHiuLVt4zOQRncXVyeD2L87RCfnKQRpKtHHZyzLwqepMlWa3jx+nx3028ur3kIglnYSuCPHy230Q3qHHAQqFDZgDwx7Vn0GnpdAqLxtogp6ASgkIohbkoTGhXutS8CWE9H3BxVCpHMapuB1ZUXc4H7IuUoRZgniY7DHcSHZj84yv+dQx5daar8Js0eVV3m3uMgajUflOoPXE7B11fF/Yx7YYl054hTr6KvoS8whFD5o+Pr01dLDvkKajOKdx9H3JibDuVYJNEVSZGoWofk74YKwGUqlTsxkJCXSWioSGBLnbXB/Eqqqxr+QGO4ShKkR3viTR/LHEkNM4TjFnHhzm5DBE3T7VapqFTBjJbaVyptbCzbK9UJELSnlR47wzDb3RW4ZFnm+54+a2Btzj7T X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: b176fd73-5e3e-4077-5d29-08d96b6d3795 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:28.1611 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9PJ6JJ9blRM8DFM0r62QRPx/DyTnVB3x79aQ6zaTbBedBkwoZTZEzYKpTYZn3IaiiuGTCN6WLLEffExXILlZow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB7870 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211831_726625_19D5D65A X-CRM114-Status: GOOD ( 10.64 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The QEMU virt machine has provision to emulate ACLINT SWI device for supervisor-mode so let's select corresponding driver from SOC_VIRT kconfig option. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- arch/riscv/Kconfig.socs | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs index 30676ebb16eb..651da2ed93bc 100644 --- a/arch/riscv/Kconfig.socs +++ b/arch/riscv/Kconfig.socs @@ -28,6 +28,7 @@ config SOC_VIRT select GOLDFISH select RTC_DRV_GOLDFISH if RTC_CLASS select SIFIVE_PLIC + select RISCV_ACLINT_SWI help This enables support for QEMU Virt Machine. From patchwork Mon Aug 30 04:17:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464537 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=-22.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,MSGID_FROM_MTA_HEADER, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 63D55C4320A for ; Mon, 30 Aug 2021 04:19:02 +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 2D53D60F5C for ; Mon, 30 Aug 2021 04:19:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D53D60F5C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hlOcuK5Nml2yKFBeqnZoXHCFNGR4ZSupWQLdlE2wtMo=; b=Ok7NQAk09Il3Gz ax2AzcZHUV9DnWRGdaeuxNz1OB3+0LaHumgCOEo5Cp0H/N0KC1RXsF9/axVuFuXAv0C18vG1PIXyU N/zoNFie8L9oFvnaP7Kv9dzJUWKmPmPTX+SaSSMwJARjJyr9pdCQLr48fsKzdA9GBi5Ka9bNxiKxi XTMOIQ1YaeBgsoO9SQcRstRlLXwpe8P83l24GyAUf+VmrlHIGIbfTmr6B4TqU+g5HMlFLygHH5ToK o7tHGmwHwAyTBDsOPQhQ9bwJ3+nnOHDfon8mngTkTFge/OWmiBpiasLWHJrHwuZH41D2VCdA1QWs/ fWNdI1Az2mcoI6JTsp3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYks-00GOcA-9t; Mon, 30 Aug 2021 04:18:42 +0000 Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkm-00GOXt-UW for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297116; x=1661833116; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=JiJChEtiazg7PmlZ9SxLm4HpyxFIb1Rgcy/ImlBAkGk=; b=qPGfvA5O6otnf2lwjR3hQiLnD5c2cBNBYzYcBYEyNk4yZBlYfsaQTnV/ kgHxt5slgLnQjCKtoKY5kB268aITMv9fxtyQCXw16arN+etqb7ZW6rmL3 j0h9z2UjoeUV5uWuzEN+NgmScgocfGeq5tVqWBDQwBFRGMCNxNY+NpvWS S3anb4zWwNEuGH3W09mZ9FL+hbVNNFl9ujKAHLZ9gJMng3QiSGYJY2XHM Hg8+NlSef+rdPpci8WOVOvx0bF3fy3ZylpOKC/JzitprmznOcYDALRVtR cjWhZ6IJbZ0CF9jmzl9zDuWjsusoDYp6i3QCennYCKQRM+hx7JTzFH+7Y Q==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="282519965" Received: from mail-bn7nam10lp2101.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.101]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:33 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XOEcS/+c8/B7cr02LVvEkm9VVW/29l6WVBQHMhjd2sXgzdxTB5KMjfhCOJvIB5+azqMXEzIHKt7bVbwqYhGurqnLKnpROhCce5QlMElcdakhrFmJkBNPTLGfVzyqInAuaioSZC0DbDR34PLwhTeQsOySOareO2s88g9mxKAsL1mof11EWVPMfSnxF8gIDMyDkCT6aplb1Q+tvH1bcXm7Rl64ewMuBMlBfc/HX3YamMHGf6XyHpnLvdBWHHTLwVFvXgzaOaXl9OQvd5EyaQbsYLKPUjkzi7ukYQTACs9hsFep5X1Ii7HIQ7LclGvUuVBjqP+HzS9DdloogK9ZAev6lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6IS46CVB+KKHtfsLQ6z4JkvIjwuUhP4tVuZzo7zdbAg=; b=ELiO+aFwz90ICsHKUAIAMLHaz5+AtNJPOLSgnnNVWA8JnMZ08bP8/FBp3NKp32k+xeMbg4GxaYbwMpwurrB2EASCrF7LlAyQjvAtMrUpqqe5hZCqgzFTOfQ7C82HoswmiH+68VUXr01unzuXVs6tS/zOuc1sQuOegDmy5znIDbNUDmOahPGwBm6JmxSStc80aVDAM8EZpfrmQ64mdtDg+WP27Rv4qrYBo10R7D8r1L13AaSCIuGpfZhh4jdZrJj7nrEptKzByO/DKyQ3GE+khoZ+TVqI41KdopzQCoEqiBjY+z/PUf00AIOSCbmbXR5WwC05Qwo7XCZmLhnrKKNmRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6IS46CVB+KKHtfsLQ6z4JkvIjwuUhP4tVuZzo7zdbAg=; b=qk4dy5uajr1Pnz3Kal0VaPmkstafywTqc/tN5unNYTu6QnaiDkX08agjblKTLYivn/0lEuMGDEF70UeW4W1LAqfhwzugSyIC/UiXl5FxMRXo3aiVCMHcPFIN69kCIvCnNC0DAjSFOpA80JYkDzdXtG2rwmsDK+kEG29rijUSB08= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB8273.namprd04.prod.outlook.com (2603:10b6:a03:3e4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Mon, 30 Aug 2021 04:18:32 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:32 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Bin Meng Subject: [RFC PATCH v3 09/11] dt-bindings: timer: Add ACLINT MTIMER bindings Date: Mon, 30 Aug 2021 09:47:27 +0530 Message-Id: <20210830041729.237252-10-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 508bcfaa-508e-440a-c102-08d96b6d3a48 X-MS-TrafficTypeDiagnostic: SJ0PR04MB8273: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GqOfYtlGVIrVWG+SSjTLHbuF0K3BGC/ADNs2AEmCabYqNvHxuwy2vsHbKIxoQkK2+fSkKx8oRGFyz4hVyZI9eYlEHOZiiCE43yml7puXoSlir2pamsxX0ieWz5x3hAjCU98pXqjg63pWw5F5057bBwTZXATscCFFuhX6cuDEJL6XTJY/UAIxAwIck0c3FJbT10b0S1gsJQsfJHQ3KZsTVI2VmEUlyVVFGVB95u14b/pINWfHgJORzB6QDNDXwN/83/0Xq3uK4b22FfZip1mw6WdYB9RCUPGV0UazFNCIipe2XkfRDbAvyoLqYPQBd1B9FobeTEg2ndm7JlRHRlwOR1F8mlEDJlpZfaOpOXxjRYWMzR5rcReknkF4fIWMN7acKpzRg8r0lcDvxBJ4xVkzr3W7wi+23xszTUkZrOB+4VCTr/V6uuKhGRqudJAm7mCKVsPH7PUSzG188U2t5O3Rr+ak4tAoKzdSVLAJXFWS/mUmlm8+3AI1zAmZDOCQlqIt+IiO+VSLDV+DLbHFcNmTZ0RHI7QiExyKVk1if5gcpe/8jqRxVCjg+iKF0kXl7hJaJDi6dd+dlwCWkYQcYVunV/GKLt9JzYLNpGvgONovt/8Tgm00z1An3Sssv2wfPFfw+ilGWtrdYyeG32GR/8wxid8dBu2LFqSxMj28Qg5tC1tPzjTg8HkmxyKdfqd2TlzEnvkBGT3BUOvIF1rzM7CZ9dpWNP6CFusPRLJJUr6jSkH+IpApsXNX3Dj698a/1K3SC4Py5otvMKBKw1PuiEJi9po3jRpOg54kcViosk6MRagWF6cLwgjLpNkisqfovdas X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(2616005)(966005)(186003)(110136005)(86362001)(316002)(66476007)(66556008)(956004)(26005)(54906003)(7416002)(36756003)(8886007)(66946007)(1076003)(44832011)(55016002)(4326008)(5660300002)(478600001)(83380400001)(8676002)(8936002)(38100700002)(52116002)(7696005)(2906002)(38350700002)(473944003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MHfv1FZoZN093pkoPxIPw2TSGQcqdXcsV9LjAkzXXAWFymvSSN6ALZDvRNY4+/HH/4cdTmUQQPHeWwydDYT9ONTmv0t7Yads5d8ddlnXgPOEhpLpo/EoMPpOs563NZcqcT7Y8oHAazjlYzOos/adoLmxDqRnlFoBFCIP0obcqXBp9+m8vXekJmrUj9vpkn7X5zHiTUBA4SxI65RwelHCrujUmM8EmLyVJ5734ZznKvqS+2hvFu8EUNb6c4T1viutpCqi1j1HcJCvBEcZwszzhRvrGw8M0+mtk4dcwkSnGdv6WZW4XTjXUBAfT6q6WtwfvxK/fsNIchVZPFl9UphWUmmXpcREH2shW1NhfiagJulmFuL6b3tVWLk6tKUGPpabtf8GiSK58lZue+rD+N442PnFqhgGzzCMv+rOJpVavzMTRbIpvD637xWjgYDMlUg39Qhheg1KYN3fZgdLvfZdat+KEb2bl523avSXKv57uqdZ1a/i45ffPyXf7i7XISGma9AjjiV3C35B4C9KC+oCIwaq972J57VWidUpl3N+atKgZrDJTtoOxC4b+yItE63qO70u8Zot4F91xgNEBK39jojZ61eYo/CfbYPmaRzW2s8oLyXnug10Ho0PEWAyJVzSa/XKc7KJ+OG00aDiIOPZD/kxIU4UpLhbm8QJlU18rO0LAYk0ih7DDwtod10l1QnNcvyFjm3xDAI5McaLecpvHhOdYZQixELt/EtFpHAPA3duc6ZbSSVK5ZiH1F/WFWrX9KGM5Lf5lANXnVzzLPr1eN8bnnNS0yCc6uCRwilst5Sn8x3g6s4zm+jTnUWdWLLgVU8M82H/6aa7wiJliAa2S73gn0+3EnL1ti9ZKdNZ2SPb+gYinGjt09EFqf+u2eMRw8QyuvtwnCOzwAOOk+uHEO8uEtjL0r8n9S7V2FNMB90GDnOBERKAyYm5wet4yG9REd/eOU7m9r2On66ycf7DwXT6YK8LRQqDp282CWXz7YZWHaFdT4xNHsm/ZH8gfN6igRBlL4oHqqOt7cSiM7yJDLNv+QLRZYGYd5E3Fx8Vtn8n9Nop9Q+tqjA8BbZvQMOKgzM9cgLB1yd0vrL82UPJvpCAhMIyJeVJ3RzAqv2huSKrVr+QpFGGP6iWB/Uq9TDQv550BlZ0e7n6FaanQxKD3zREPQXVUY0imfNBW0abPNIa9m0UM5lB0Jak9BTK03c/Q4PID+ugD6mc2QGGN8aF017Fz6QzuQ7Z3ftF9tmhkg+Vs8F87sqUaFlcmPiLglHGkCnX0LxpgaDwzs2a9eJElqyOXS3TElcXmARm/0XG81474J0M5Bm54ZusreM+MMrf X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 508bcfaa-508e-440a-c102-08d96b6d3a48 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:32.6733 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: P/OFSKoAf3PjXsJpmzsfCPa96DrI8uJUzcNQSrLV/6dtF6ILuNa/37lFnfVEcacKLpLwmAUJHM5JEnOzrsn3Ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB8273 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211837_097037_5DB3AFB9 X-CRM114-Status: GOOD ( 16.72 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org We add DT bindings documentation for the ACLINT MTIMER device found on RISC-V SOCs. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- .../bindings/timer/riscv,aclint-mtimer.yaml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/riscv,aclint-mtimer.yaml diff --git a/Documentation/devicetree/bindings/timer/riscv,aclint-mtimer.yaml b/Documentation/devicetree/bindings/timer/riscv,aclint-mtimer.yaml new file mode 100644 index 000000000000..b0b2ee6c761c --- /dev/null +++ b/Documentation/devicetree/bindings/timer/riscv,aclint-mtimer.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/riscv,aclint-mtimer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RISC-V ACLINT M-level Timer + +maintainers: + - Anup Patel + +description: + RISC-V SOCs include an implementation of the M-level timer (MTIMER) defined + in the RISC-V Advanced Core Local Interruptor (ACLINT) specification. The + ACLINT MTIMER device is documented in the RISC-V ACLINT specification found + at https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc. + + The ACLINT MTIMER device directly connects to the M-level timer interrupt + lines of various HARTs (or CPUs) so the RISC-V per-HART (or per-CPU) local + interrupt controller is the parent interrupt controller for the ACLINT + MTIMER device. + + The clock frequency of ACLINT is specified via "timebase-frequency" DT + property of "/cpus" DT node. The "timebase-frequency" DT property is + described in Documentation/devicetree/bindings/riscv/cpus.yaml + +properties: + compatible: + enum: + - riscv,aclint-mtimer + + description: + Should be "riscv,aclint-mtimer" or ",-aclint-mtimer". + + reg: + description: | + Specifies base physical address(s) of the MTIME register and MTIMECMPx + registers. The 1st region is the MTIME register base and size. The 2nd + region is the MTIMECMPx registers base and size. + minItems: 2 + maxItems: 2 + + interrupts-extended: + minItems: 1 + maxItems: 4095 + + mtimer,no-64bit-mmio: + type: boolean + description: If present, the timer does not support 64-bit MMIO accesses + for both MTIME and MTIMECMP registers. + +additionalProperties: false + +required: + - compatible + - reg + - interrupts-extended + +examples: + - | + timer@2000000 { + compatible = "riscv,aclint-mtimer"; + reg = <0x2000000 0x8>, + <0x2004000 0x7ff8>; + interrupts-extended = <&cpu1intc 7>, + <&cpu2intc 7>, + <&cpu3intc 7>, + <&cpu4intc 7>; + }; +... From patchwork Mon Aug 30 04:17:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464539 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 53435C432BE for ; Mon, 30 Aug 2021 04:19:05 +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 272F260F57 for ; Mon, 30 Aug 2021 04:19:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 272F260F57 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yXZPDOF/dMSIo0lTKPkjXL9Gaj0BHtVupxsEinkqs/M=; b=ZW7hl5DjHeQbQd rJ7U+ee7rN5DiIiCNHyHHBlfJzakHwf52f/6ov6iaHAri5RF6OhSxQTrKoBqXTp1touCpdlnS6U0u q2mpuRFbHTrp1CW1MVMTdw0//9jxex0n8r5lDYm9mvzlpVh6IIMY8L1hWedUfeiSdpjrfMbORAAwr XBg7Rdr/6YDpvFe2pyXZzO7dHYuZa+5ZzX8r9q73/a5uCiiysqGO5G6agO0KvqPbwW849mVjY00Vo KpqzV1CObQKK/Cngr1CuXX45mzYSRF5aAiQN17nfswx/L48qLFnH+wMBGtC8Pp/UaN+0XYZiaSoM4 F2JGFAL7j9KbdZ27gCUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkx-00GOg2-2I; Mon, 30 Aug 2021 04:18:47 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYkq-00GOar-Jw for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297120; x=1661833120; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=qFRmYs/4BD2hScoaVVYovknXknU/kqFGlTmH1SyVsZE=; b=Y0ouP/gcIBvQgB2W9kEfaPzxOV9USWFSULECAQD3S8Zj3gYctsQs6CKH 2Ig40TxxFl/PAmMG6cqm4oHSg04wg09lmzN3q/j7v0RSfMq1sbV9fxw59 9KoW7Wq7CVvb+CpiOIIzZhdrzPVHRQLkUDbO8ivcocMXjmWUTedR1pMN8 o5e7MxaW96AVWEAGoxn3910OoClGKWs0N936ZXrIWOfuk0sBIiJGFcRxu mNUpjrNIlsN+V0sh+l0ei+4BvVrns8fg5g9bIm3vdT633zkihc3JD5M0I EcqH2znNwRFArDQvwoqHVpbN9gkrmChp4tqujCcBNPbsk7ExFWcpKXnMJ w==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="179285393" Received: from mail-bn7nam10lp2108.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.108]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:38 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oqdu79URI9jFsiMGPldo25iWEB6ORifRi+9paRgaV/GPMaVoSQcatgmCg9A1Af+1YFw7phd/W9U9eEfTk5YfnSMNmZ/ji6W8aXQYxjYiHG3gTDPxijRAVROPTdQfcZO2vDPtCklKN7x+8zaq+7Wcw/oB+ZUkq9Y6XP1v7/t+g6RHAHj4dRFctGUZX3MzWWZSQwwfmVFnc+F/4QEapfMCNuchlBZ6Nc8y3eRvtdm0vfFvIleslo0P+HQKLFY6zNmXQmS/i76AOf7Gw5dIfwpzFBYCs74qhhrqppC8wFoZcz7/1Mk3QRPSYW9CQSsEZwdro7suBfYRjsdo2pdBIRXSqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GhWB+D4BHG4ApZjKys8Lk83eb1ti7LYTVRKk6NkHG8c=; b=EYVuRQrQxK6RNEf44z39X5wFkSsjvfE9mfoB69Ik1A+aNmJJTDr0lFBE9/a5vaKsZlGw7uWtl9iEmubJl1UjSgwxE2Jap8pvBoKfp3h4JVJw4c0AHFhtI8mypSnZsDesg4A0UBkKsgRewHNjugREw2r/2Gigy9usXLLX4mYtUVpnIwUs98e+mMzsTCeg2exxVMxCRFv9/c+IxHcDlbBhBs9oLReaG9kNcB66UQwMC9Gr8GPtA7VrE9ygx6Ld/FWE2imwBsWneTvCURD74Ue6mfgA7VcGbciKxgdyp2aKGz+UTQaviZ965fLkfIKhQSeHXxc0VLBYAzIE+v/Lbdeg1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GhWB+D4BHG4ApZjKys8Lk83eb1ti7LYTVRKk6NkHG8c=; b=Px5Y49c4Ls0mEvNo/B1ex0knftXuiU4M7pVrGVeEj+cCKnbLmb+Dk/p2wvGizl7vyVvxLJLKjhu8eoXihe8iBaAh1ruWFVqkecKHhJb0/LjKSRrTWUsHQEUxnmkZGg9bVewIK3iB/ZBiJRZvcd9NgSHMERT+vCuBxs6WEdM2uc0= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB8273.namprd04.prod.outlook.com (2603:10b6:a03:3e4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Mon, 30 Aug 2021 04:18:37 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:37 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Bin Meng Subject: [RFC PATCH v3 10/11] clocksource: clint: Add support for ACLINT MTIMER device Date: Mon, 30 Aug 2021 09:47:28 +0530 Message-Id: <20210830041729.237252-11-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0605e583-14cd-4b08-f873-08d96b6d3d15 X-MS-TrafficTypeDiagnostic: SJ0PR04MB8273: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:785; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y4jeQ/khCEY0z58CEKhWIgeF+bbnKilCH32PnruiDZ+Eoae+pa/sNR5+FgMUKi5L6u0d3do6U/EnFS03lFig/p47hfhwxJdXPj3BjERwO1s83JUfKfEKHB7Xn+6Bxg5vSkxA6666sorXcj5vig3/E7ajR1+PsJcQSeHCU20w0wR/sJ4BFsALIvWlV/zu8fXyGP9izmyvRWpRhiJhXXqxY2EZabKNMlWDELyO+gSvXI39K4EKUK0+CC1V1Qj+tvA1DheRyR3z3vnRyC8ABLriR+E4UUf3zuTVkCpquimEKzNHadWC9qPIDqD2/VbS8ZY5cK0OlrPrcM8DxaFBqA77aadv6fNioldXrSnnb6FU3Irav6dlCHzuoDYrvJlYRschet7IqacIWQ7D+4wXDEM0zh/wT+uytGOzLW1AcWkkNWBOJp+6xaHhn3qPZ6Tnwz4/DueD7U7szxfQqlJxX0lx56Lrdyoz7DzP5qXNqNh5gYWuJCt5Cps1Jk1nIy53ssR4TfCR3odUABTLC8cjweFIgdc+MNHi5lFog0d4RphmP0j20KXNB6AkvwnCIk29RZ12q41so4NrYesoFrFhonglYEjAgxYFYOk9BcwRf1iWpJPwCVDkFdN1/eEWOjMRxM6OsWVMLJPHsr0MgSKnOMvDlBakZzYXWhZ2VY6lEVji+oCHePdQPgeLUf+LWBa3QSa21Ga0XpwBXkxGbnqlVAYxVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(136003)(346002)(396003)(366004)(2616005)(6666004)(186003)(110136005)(86362001)(316002)(66476007)(66556008)(956004)(26005)(54906003)(7416002)(36756003)(8886007)(66946007)(1076003)(44832011)(55016002)(4326008)(5660300002)(478600001)(83380400001)(8676002)(8936002)(38100700002)(52116002)(7696005)(2906002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y2DLnsmCICGWW+kRIo8K17d2stKPZh2Gtpr17TjKfjMd0n2vkOugk61z70XpHvFWx8VojmlafFR2EYPSzSTPkDg6qj38k+5w8m5699uZ4/uzxJ7pgBDvnEg68SOx+8IhHhDFx+QpYe9Tc+XS1r3IrIzqO/VoNn/nTixlsvW/zbRPyPM53e4om4aEKYbvnyHAgG3jlfdxPacBtukJF/9IDnCeAUj8lbLEVOeVXzoxROJbrgIsb10IONGgDXitNHOBVoqP0csXmymqdL/d2fC5pAtiZEFvje24202zitv02ARpkQxaPeB7XChLCQXd3bh/lpnk5HKmzmpJgJ3rtYFl1gbBzjS7QP0IV7H4QYVAxATNn87noNpb4oaBOvPCqdImccw6oQmvgvPdtCk/SGeXmkfmwqkoxosv4uwukZfRAU1AolnYwDvC1WUOdHwG1VVDKfYZqXNxQxLsUNCoS3VPOa+QWWGd1uLY9zwY3CNs62shGWyd21Y0BaMOw3BCjxbzTVlfxYD2NcvcIYhV1KqcR/7PKjQF2hRxznPvue79TkDA8WZGH72tH9XCS11rx/Q7tenfi2P90/zHTxLuu8dYK5uwFRV7iZCLS22jNQolbOCUf0NUrpO8F5O9GfQ9255P+30zKM2D4Dwo+K/qzxObeTTGz5N6RPa8CUprtbW8x3sHEaHenhKsAYNykr/c9//oh11iyDAhKciIaxoDOiqN1+UoDwG1shPFQa977A4x8PQ7BXJvYeaFCQds4QdXgyyhkdtIkaEwtxKpjdBuyGgRpySlpFzl1eZuIRrmLxKcNWuJl5zsfcTk5nevssP6+LnwHbFoGFVSIxjJ3OXUjxlCvmqz/kKMKZSIpceTelVm5ByYDVa/3Ayu/yl9YmyLm4ilMW2pJ1DLyHke14F5DTJ7hfQ0uydt0JGS6i1OHgem0H7zecjVaLgMqk5Q/FqSCqAv20fHzzf3Xw3dOSMzF8/vJPahbQF0wKkOe7/as4U4OEhuKmLlsWEh3TrBxBFwms/uL6JTHlZdj12rZ+PABAFteZBZqE/Q7JBDukYTuF+2gdZZ/L1WHATP/XYJnzNuRrY/Z81FHCbjGrtsy/72CtP4HAIWZv8Cn72Z/bwOK5MxADSyIaf8im8x1VPf1S6ymqghNm/IcCI+r+XgV7K5qYh3gFpS0ZZuLJbYfT+LT6u7juJrZAfiREr5JszEW+Y6x3XK/sNlKhHPw9nvZJaEjategHqfs3EW830KqNJmBFwaYOArsVzvW+NxZV0e9VwfURV5QuW4wDWSlAyL56CruiM9Q5gpfw8IGjMTSmE+U5N2t3JwWKafOIf2ns5v8KPVYJmm X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0605e583-14cd-4b08-f873-08d96b6d3d15 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:37.1526 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gkg8TUG0JqgjjFHIQHVwPVnXgV77LzCdUCfLWevKF05VIYUnISc0L1oMPBR7Da9vpNjwmyHwuAR7biI+1Zt8RQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB8273 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211840_775309_212FDB73 X-CRM114-Status: GOOD ( 21.24 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The RISC-V ACLINT specification is a modular specification and the ACLINT MTIMER device is backward compatible with the M-mode timer functionality of the CLINT device. This patch extends the CLINT timer driver to support both CLINT device and ACLINT MTIMER device. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- drivers/clocksource/timer-clint.c | 46 +++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/drivers/clocksource/timer-clint.c b/drivers/clocksource/timer-clint.c index 3b68ed53fe4a..10bbaf1bcf04 100644 --- a/drivers/clocksource/timer-clint.c +++ b/drivers/clocksource/timer-clint.c @@ -2,8 +2,16 @@ /* * Copyright (C) 2020 Western Digital Corporation or its affiliates. * - * Most of the M-mode (i.e. NoMMU) RISC-V systems usually have a - * CLINT MMIO timer device. + * Most of the M-mode (i.e. NoMMU) RISC-V systems usually have a CLINT + * MMIO device which is a composite device capable of injecting M-mode + * software interrupts and M-mode timer interrupts. + * + * The RISC-V ACLINT specification is modular in nature and defines + * separate devices for M-mode software interrupt (MSWI), M-mode timer + * (MTIMER) and S-mode software interrupt (SSWI). + * + * This is a common timer driver for the CLINT device and the ACLINT + * MTIMER device. */ #define pr_fmt(fmt) "clint: " fmt @@ -21,8 +29,11 @@ #include #include -#ifndef CONFIG_RISCV_M_MODE +#ifdef CONFIG_RISCV_M_MODE #include + +u64 __iomem *clint_time_val; +EXPORT_SYMBOL(clint_time_val); #endif #define CLINT_IPI_OFF 0 @@ -35,11 +46,6 @@ static u64 __iomem *clint_timer_val; static unsigned long clint_timer_freq; static unsigned int clint_timer_irq; -#ifdef CONFIG_RISCV_M_MODE -u64 __iomem *clint_time_val; -EXPORT_SYMBOL(clint_time_val); -#endif - #ifdef CONFIG_64BIT #define clint_get_cycles() readq_relaxed(clint_timer_val) #else @@ -129,7 +135,8 @@ static int __init clint_timer_init_dt(struct device_node *np) { int rc; u32 i, nr_irqs; - void __iomem *base; + void __iomem *base = NULL; + void __iomem *base1 = NULL; struct of_phandle_args oirq; /* @@ -170,8 +177,19 @@ static int __init clint_timer_init_dt(struct device_node *np) return -ENODEV; } - clint_timer_cmp = base + CLINT_TIMER_CMP_OFF; - clint_timer_val = base + CLINT_TIMER_VAL_OFF; + if (of_device_is_compatible(np, "riscv,aclint-mtimer")) { + clint_timer_val = base; + base1 = of_iomap(np, 1); + if (!base1) { + rc = -ENODEV; + pr_err("%pOFP: could not map registers\n", np); + goto fail_iounmap; + } + clint_timer_cmp = base1; + } else { + clint_timer_cmp = base + CLINT_TIMER_CMP_OFF; + clint_timer_val = base + CLINT_TIMER_VAL_OFF; + } clint_timer_freq = riscv_timebase; #ifdef CONFIG_RISCV_M_MODE @@ -213,9 +231,13 @@ static int __init clint_timer_init_dt(struct device_node *np) fail_free_irq: free_irq(clint_timer_irq, &clint_clock_event); fail_iounmap: - iounmap(base); + if (base1) + iounmap(base1); + if (base) + iounmap(base); return rc; } TIMER_OF_DECLARE(clint_timer, "riscv,clint0", clint_timer_init_dt); TIMER_OF_DECLARE(clint_timer1, "sifive,clint0", clint_timer_init_dt); +TIMER_OF_DECLARE(clint_timer2, "riscv,aclint-mtimer", clint_timer_init_dt); From patchwork Mon Aug 30 04:17:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12464535 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 5A803C432BE for ; Mon, 30 Aug 2021 04:19:01 +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 2024760F5C for ; Mon, 30 Aug 2021 04:19:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2024760F5C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sha7Nhxif41aHJFpwziD8Lpb7eZe7h1Z06HntniqIeE=; b=xTnKRBmY2f92Yk BXWyUZXsEtnYUXoHkfu2/Vbj6LO/oIQG3CFsaKdHkeDWp6dT+HYKx+aiC1sQ5iChR8n5sJ95VyK2s /SrH7lzhrHBd2NIM5hSajFQ06EiVVhdGJlQfE+HLNsL1FOR2zhAyla1WB8GFI9LVplHq9pil5pcBa CoRSPcC/w3+E8hDi0gl6Mbtx+FX459CFNxi/A0CdC4R3++v27RZ3BogsBGTV4C9VOOXlCUelIQxcn jM08oY7T601NAdhBq+d6z+Cx6KxbZFtJ4SVMtm7jOll/rk/g8DzD1LPdA5nbSzqwnOLY265S3Dbhm CoxbWqY1fkV6KtQL/4Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYl1-00GOif-VB; Mon, 30 Aug 2021 04:18:52 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKYku-00GOdu-CA for linux-riscv@lists.infradead.org; Mon, 30 Aug 2021 04:18:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1630297124; x=1661833124; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=+BkjlPEF23L6zhrbrR9PEaNEFAEa8eGcZuvBLehJCx4=; b=Gz5ccZhS4D+rNnKGUu2VaEmmV5b4RJuXxGzxlZKkYcEDayajoo70DeYM IgebbVHEcA33zp6hjdLwqnJTz2zNbc7f4UMCrfXbV/zF5cyxkLTW3RihL XgdKHHRir59GDYDQPAKLSbhcw6jWT/mw2vbKx8lYTcmokrb8SVwbfeXLm ng8mWI/DEsHJPHandTnFC/GqvoOUjdRc0xFXPqyuCAiS4Dq1oWGb0FBRw cMWW2QVW3FGJ02GrUjXXnWd9koW+4LKtl6DWpCz5+JwcJKN0CC69EXYOc hQ7ITXwYXfciMaC9wYm8Z+h9aWTrOIgqwN1R7QxX5NXZZBPJ+79hXH0z4 w==; X-IronPort-AV: E=Sophos;i="5.84,362,1620662400"; d="scan'208";a="179285400" Received: from mail-mw2nam08lp2177.outbound.protection.outlook.com (HELO NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.177]) by ob1.hgst.iphmx.com with ESMTP; 30 Aug 2021 12:18:43 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bq+wnlAil8VAPGj2QSwo2TXlY4IMPSGeRLTqe4AvvHzaoCFO2cXnMcPwO18+YE/uIh5FZ+4Fu+OeB0Qv6djsZgmtSkrUr7PQD7M3MQFnln4Y5rOBBxc6rGR7560r77yvBLNq4DQIts87TC3vlG5mZEh/ENB2S0lAlDJ+a7f5Nex2WPGqxwjsZIBa0oC5L38QmOCD3rA20uzpZzdBJ8FCctMhs/TQk+IUqe6mB2JXRcmrug/3INn36CaI25gRzeEInoNkZN4E7ze3P2fYiVTTdx4szTY79YPRdm/sHQ+v/ZT7dcpCQy6nt32ib67ybwxWpoC6f1219ERPYkEAaNjC0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WAzsfWHCL8cCPULb9LWZ2UJgjKKBiK8hBgh0aPdcAP0=; b=VjKiGHzH2C42xeouf38kC1kEvioQ9OGw1YSVhd/UyiXH0kLV/J+CV57ZSGwOzLZmw95QYdGD3LCD4oDcRGaw2BpO5k59JYkrYuAzBao/Vm02XItp2fL0UhaM7YSxcuRTiZRL2I0i3zTqp2c9xSvn0rwRfx4F+UuDJpIziuIb2liqQAE87mWOABhVczodIs1pLEzpMfDhFo+Cz/QscGg6goBHcFq3gZ/GnL/Y20GowBUVyH1ZcSj5H0yLwpcAaRqUOLS0W5886auBCCwTet47qWn5zl7nR6JZz3qbiD0VGqWiqNCdja1+17N46juVMaQ6UorI8N/t+7dZ6YFHib6exQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WAzsfWHCL8cCPULb9LWZ2UJgjKKBiK8hBgh0aPdcAP0=; b=uiDANn3renouOy8sAOffCO4sp0nW9Sc6laAHk67IPh6tMIUycwrq4ErjnuJIpXnm5UtQkYf4VETPr6IyoV9QNc3YwRzGpqMkEKmf6B5Gx56cQiy7y6+rkEXHWG1KPm+JjU6R73RSZSFWfLv24H8p34GEd+KFcyf8ey/8n7+E3yU= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) by SJ0PR04MB8274.namprd04.prod.outlook.com (2603:10b6:a03:3e6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.19; Mon, 30 Aug 2021 04:18:42 +0000 Received: from SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514]) by SJ0PR04MB7821.namprd04.prod.outlook.com ([fe80::545a:34f7:53c5:6514%8]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 04:18:41 +0000 From: Anup Patel To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Daniel Lezcano , Rob Herring Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel , Bin Meng Subject: [RFC PATCH v3 11/11] MAINTAINERS: Add entry for RISC-V ACLINT drivers Date: Mon, 30 Aug 2021 09:47:29 +0530 Message-Id: <20210830041729.237252-12-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210830041729.237252-1-anup.patel@wdc.com> References: <20210830041729.237252-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) To SJ0PR04MB7821.namprd04.prod.outlook.com (2603:10b6:a03:3ac::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.179.63.14) by MA1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Mon, 30 Aug 2021 04:18:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42ae32cf-fd95-4e0e-9bee-08d96b6d3fa9 X-MS-TrafficTypeDiagnostic: SJ0PR04MB8274: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IuWjHwtEnUyWcqgIBNcPJ2nZzdX1+aaq2lX6CJJd4it4cs8fNKOBVT98PIql8Z2uMt0Fr9RjFk60SwOqEUwI68JoByAUpMTwTOUBqzqiE8xsfRGnUnOXr1gJP/Co0touQy8Ghb9sY2BEscjKhdpzCNwuDsQVhMXZ9Drim5WDVe8vzvh9c3UEQUzaG8PQQPZUtUjKqrLRUhRYAoqndCQmZ41R8/2YCOcrmrTwiJAmmoAp4t2/PEOuljIAwNfNMwC8URrYjRpc1GWQ7G5YCL6bmFQ2RyJ+u9AZ2RZ+AazWxWUx22wpreBJgPwv1hZJOLqIMcNjTE+0MV/AVq7xihfWswo3ZtO5ork5+7HE6DZ/8U5NoGl6JQTEad3LEpy6ZIRPQGnaNj4NEHYWQ2Tk1kVcwHmlQWMaDhD74iJQIkYNrisdbLkruq+JqZhVs9lQBDwyapvT+NkZGiHzob5yTXdf4LP4fJpI/gEW5Y1Rz+EW0H9PJvpabmX+r4UkRrGkZ3UsdbqgOZ6VkDdMcssuS7dPM6uAEEBfDQPfkvqOzu1sLRxtSYf14GA0vrIYpXR2nbaLwEJOQi+i1Yh3aKnMi7rdzZ9DUzhZDH3pV4aTU8h3518dEFBd2if/k/il4Y1PE2POnrBOxmviYzlBHQCVwfKRlvQXESV9I8DBe0keSftztEHeRNW9IVhj3wmNfCEinUhe01B5CzzIXUchsdyvB7CFSg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR04MB7821.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(376002)(366004)(39860400002)(396003)(66556008)(38350700002)(2616005)(478600001)(86362001)(66476007)(38100700002)(52116002)(66946007)(7416002)(7696005)(6666004)(316002)(956004)(186003)(55016002)(4744005)(36756003)(54906003)(8886007)(110136005)(4326008)(8936002)(8676002)(26005)(1076003)(5660300002)(44832011)(2906002)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1LcQd+AghlLmCWHO8a1m+gDbjPQcZwvx22tFIr4vNyKZLUOctygnWrksVYei5aqso7GGu3aj5zZ3sWHaWyKaNyEwR6fgGVUm1DkSHkAqw/hp9WrAojgIa2pl6lj6oMMzjLTZ7rcqPC9RZFUbjVNWTc/gfuMoP8H4JihQOh89SG598kyhuIX/0HEgZroot73tUh47bRwH8cMpRexGTZX2+zOOThNsb+Z+ybtzLjsXfSINprWzOlmVudSEky0LDEER8llYO6k751GDKsXll0Bgl9MSn+AQUrq5UNpeD/QQgHRhwe1pQmpBqu7POidMr2SJRVIEYVWWWCaVpH82fOTlLJlUpq0DwkHbE6KvKZciMBVqIcl4kQXmQ2hYMgnK1ufzhf9QiIUCSdhO/9ePhRzFX43G+AktzDHmY2j6b3ha0T+iiBlu1mY4tcIRlf26RKy24D6muYz0lt/n89qroYMuL73TgfWhhT35ptMrR6vCKRLp0jwPlqil5yaKUnDYKkAqQoRk6MQMD7r4uM65Tr27ct4P6FOznn5flAe0KvsYHAPmrIx8uo/CVrJkJfAN9cIVb56qZKmQV/qWHdmIf/C6rW+kL1WDYzL3LYLIeejWBgC5uhYBhOtezBGAY1XsSG49wcMwaWDQu/kHvjMzLmZcLnW6pW9nlXf5WBpgSn7dHElwSwlLIEtKevdoBTCJ/iwcPloDZSu8upfg+TOoSFoKpLT1LpUrPScEWEn/Esu5fgja2WpMkhkN2R47zkr8XcB0bgIZvLh3wro7RMp5vEGaXzVFrXCeY4Nt0KIFMJOQSfrZqOeX9OfycQkGwZWn5kPl2J6vKvqiKn97DTeBIbhF3Q7hnlI+nG61TniVqDgG0BWPERn2n6yBelPnHWFtbi1BO/wQyYwvo1PCpAZFDchslayauHgJotY75QbXn2qrRAHvNjNA4BRsjfkjnDC66NyF3INky/6ks/6gz7nHrX8w7uY/czxOAipZFht17nTTQl55qokMwl7lJsg3zuDTSwF2xjcIPuwaBmC9cSjpUAjXv6fkkiRIbt/EwMetrSSOKBO2c9dVBwnG728TWQ8QD1cdt2uR8nRRjTApqnxok1MEGJXCleK0zqGMCkVJXU3xCGu6LTUV/v4jqxCbLMc+n9jowvUl26wRlZvo4R9EOHME9ivzfH+GuR6lpWDeINQi+Wbx10dtDabehVn4kcr0gk5U3qaR/wVUy1i0O9K1dgxJU4OpLK/YGTNnabPNbMsBk6QIdSKY346xsq1CvMGEs6LrBCjNRjInXKl5r/B+bw3+f8pwSsa0QVDKXiT+T8wFKnwERLxYTIMvgRkYklwTa2Ph X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42ae32cf-fd95-4e0e-9bee-08d96b6d3fa9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR04MB7821.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2021 04:18:41.7484 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wAeiitJ663iNTYdIoHsxFD0upbIsTPfhYtSMKHH9PxDA4mIcAu2frLjwp00VcPRanzPpOJe/WBrlop146mrMRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR04MB8274 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210829_211844_515948_AE9B3D05 X-CRM114-Status: GOOD ( 11.51 ) 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add myself as maintainer for RISC-V ACLINT drivers. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bcc97d48249f..3bc36e30ef07 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15936,6 +15936,15 @@ S: Maintained F: drivers/mtd/nand/raw/r852.c F: drivers/mtd/nand/raw/r852.h +RISC-V ACLINT DRIVERS +M: Anup Patel +L: linux-riscv@lists.infradead.org +S: Supported +F: Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml +F: Documentation/devicetree/bindings/timer/riscv,aclint-mtimer.yaml +F: drivers/clocksource/timer-clint.c +F: drivers/irqchip/irq-riscv-aclint-swi.c + RISC-V ARCHITECTURE M: Paul Walmsley M: Palmer Dabbelt