From patchwork Fri Jun 18 12:38:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331249 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=-16.9 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 A99D3C49361 for ; Fri, 18 Jun 2021 12:39:47 +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 723E1613F2 for ; Fri, 18 Jun 2021 12:39:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 723E1613F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=sAZ12OD2c9lBV8 XZXZKynHAYdzwc7Qds0rrrzjWElEan0FyQNU4HB3zyH/2v9+K2P8hCrrFaSvG0eJHPxYBCMwXAKpp nzxZWY8GGIrl4mL31HE9HaQe9ImwhkxlhMF4BiTDMBDkdD7nsaypjwxnuFWnp4fugd6HkTOd+FyBj 76s7BYPvnNqpby3A2SHIlwfrEjrwllmDceI8wjYo4RIXIkLiFaBmU2d80Ofqzl0zJPrqkUQAMH1Ql Hw6Ur2vTw9W/XC25FnPwdZ53shB1TmoUTmNdb+OHSV2dZWdlm0xvqTeg/KBYFkWstJsUplvyj+wFI 7QOFQM26L2RtTD6838JQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDmU-00E2r4-DM; Fri, 18 Jun 2021 12:39:30 +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 1luDmR-00E2q5-R9 for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39:29 +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=1624019967; x=1655555967; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=kRFIsrXRxjx8BbYZWZU/yYhgpwiiKVcT4u/SpXRbxcE=; b=KqvmWp0hYmGi/U7Pg1KqsXCYcswasfaUYeg5I6BIITFVL6W4hKnTRDwN +7M4HnnXmGxB/11qmVPI3SikQSSPbbSTzl5q2DuiqGnI4Zxc7KwekQUci 1Yo4tOlnXZyFSUgKl9dAqrKrvbdvuzFFpRY2wiV5DD32uZs5n56nxs2hk DcR4E+uak7PJ5ad8Q4A91N4uRTL3bbs/9lyF5jDzM/t1mtbl5Lmcn6XkT i4/wKQFzNw0Z6jUi9ik2P39GhWvrArOzePkPCMDpZUib5eER0275xuxEv frK4Oumi4PXniHhbi7HOE2ec+/bjdf4apXAuGwSzvsEp750swO/9NViMv A==; IronPort-SDR: fKfIWruDNXnbvpF+VD77kYeEF0sOs5obVoHVwfnVp+RoMI9f7enZ1B3N6rNC4VjFIcEjYO9ric QnEgLVdwG2i48qL953ACXJ+6qWM+qPkNYGzM3syj3brnpJuY7TUfv9chUH0X30y5j4q5gkQBaI qgt0IaUx/BkSn5ZGzQB75VdblDBr8qD+XIte+AXzQUdrXZbNAxl8s06JpWdypneT5g4EfFd2fA ECrMarcwOcTgLFIeMSJLjzDReFRs7HrNzAEbKheBso2SwkLsx+al5xZT2Dd7otfV6zrJ9+B5S1 5tQ= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779297" Received: from mail-dm6nam12lp2172.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.172]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:25 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JpTd5ML2e8DmlIKQEYg34+QJj3kom3yBX3WHsVGj2kc4RpQh7cacV8ZrH7KGgmOHpSH4VMeUkp8RstrZOHceDTHy/JdPPk77mqE86FYxAUKPuCdSx8qS81wZ20lpL7ZFwdC58wdB/1TIw/pvsVrcvz9X4Sosc9vuXg1x/aZYpk6rgIozBqlKpG0Pxy7nLhH06PinQefInBg1OFi6DWljnhagYBn4Xj5icOtSoXfywU3bFnZBXenz62SMVw2EpytNVhJkDvrbl8LpBGvAKuZdEnOpoxvIKDIHXEDawtVbdrUci1Htt/DfEiGE91ME7qIlw94X7jfdpueIFUxUFbBqGA== 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=n69QpXxbqjDwHD+cxDwOuw+K6hsbekt0YjEGGlabzdcVqJqhPRcdLZDx1blkXM3ILkhVtsBUzaCrVTRuGx9JYm0W0NmiWVl6kYuWw80OmFzVZx0EQ6RnsvPafnnWG9L7sMK/aFvxv3PlA2g/SF6DnicqMxEWyBnpy9VA3i+DrTwVe6cAmss4+EPoEO98Vz/tNohA9fwpNQ6bj7USdLPQM62N3GRwsmp2xnOREK4fkE20kj5iUMkGcElNSDS3syZGFwPv+TletC6lgHKBNhIw+QYqvIGOIHceKOvGF2VUQVeSgBZTJwECy3+7wlFZKJ8ruvLovlGIdqoxndRegdob2w== 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=z33MMpf2Wo8OyIxVATUeoigxyDSfJ7gR9dTPbK1YxhH5vn04iSlF/T4CiaHzi2w+ZKp5ex6ZMlJ//8DfVjCzT83axey1CZ3jmCj7ONXSkvBblCYfJfhkBubN/z4bp8dgh3qYKOoIwuGNDjd4eCh9ptHepgtuGijQB7JfICyYJ1w= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7857.namprd04.prod.outlook.com (2603:10b6:5:35f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:23 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39: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 , Bin Meng Subject: [RFC PATCH v2 01/11] RISC-V: Clear SIP bit only when using SBI IPI operations Date: Fri, 18 Jun 2021 18:08:41 +0530 Message-Id: <20210618123851.1344518-2-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bf2af6f-5f30-42c0-2cb8-08d9325619cc X-MS-TrafficTypeDiagnostic: CO6PR04MB7857: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f6FHTi06xrmLKF2ut0QiESx6E08DwiFEVnZbWoIeG0kXpKWXVX1r9T4CYBO3bXQHH68xnAzPur1HIWGlxujNHNa5S+GMVHGWnsZ8ESpAwnrkxbrTYdnLwluT+5s07xR6pQYwsHTER4j1zQnAQg7eGhc97vJoTx2jwD9r0Hecy5jZtMWbDUAFjgA5B4vx16W9d6dqOIkPfSTzOy/GO4PgLby1hB5Imimf5nQOUq15zD9Tto0TAt/n7NDde/bx2WAOKnS8aZxajlYbc3glwdBnGb79r7X1tkum53OmlguxEXipMauwtiuXmDVpGFx9k+WI8f1B7aM7d0dH2t7OsUXRkdJz1Qn5lQHvZPu6JMgGeirzguBcqMDAqxKsb4oP+hKzsIh26cGkuhjZbMTZHshrM+4DgBWNLAlFV9JS+TWxp3pUhuPQ7AaNh0rzus7w8DcCSadw1JxNVN5AWXgdhwAGk24xUBHvRxnUBfDlfeVvE8AII7RIW/gIcY0vlhhEC1fdk0q4advDb35zS3871upy7u1qKEgRTEQu+9wfZX3rFGonDbhOeqalZWs1RJDM7mPSkQBYCugXhimakNwlV6r7E4EJAiKL4xpzEXul5A0lc3SaFaK2FkKKxXYai3dsXy3D63w4RoJpMrNMic7Su5G0NYoxzDEqifPA744fYb+NzqI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(39850400004)(376002)(136003)(956004)(2906002)(478600001)(316002)(86362001)(52116002)(8936002)(44832011)(2616005)(8676002)(4326008)(186003)(36756003)(5660300002)(55016002)(83380400001)(6666004)(7416002)(7696005)(110136005)(66556008)(54906003)(66476007)(66946007)(8886007)(38100700002)(1076003)(38350700002)(26005)(16526019); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nDAeVYzllXE5y7U9UwyTi61T8axKcYg4aS/w7PVhKfuq+fIBcuVy/y2ZncV6V/sYtbXsxoaN3ArM4vPtF3WsGqXVjv+HluknFRfuH20S+U1yRPw/MV4mSgw4YkbFTi7E+k8ixVBVBx9E3/YFvwpIIIYffalpvpwFmL0Reij5wjzj5J2pF9RLwA+cMzu5Dn/aADauojtAMOPeVBnCw0jfpmSLF2kaDUR8GeNXekWDP4/q+ZBeXftRrsYm7V6fq/+J+42qQx85rYNTI3iSDUVjUp+7xJSXE5nkwGZhfrGi/Ucr2AgV0v6WDiDlbZrhuvVRJ/fHlkDI9ItkOrPCkBNYoK/yMGgbmRiYZiBW/DkZYOe5n4CVwIefT9W2iTgUEDXu3INrNKRq+h6ifqE7Jk66rgIZp8Ia1k25YY+7I2WNtNYfdHPNiKmwlJI/BR8uvOBcR2sNZ/lMXmWoNTX5oAXMuDWhpjrrjJ8xn84d0p2D1oLEtzy75/W66XeMt9GXDZ35kpAx2tHxyG+0I3YqneLW2RNJeYcE9UakA8ybT1cWaa74ylOZjg0520RS2MU3bb81nWhWMNLPlQSC0AxsTDiD/yVOES9DZPJelTTrbjMgDrr4Jg6iFVim6N48I+aTR4aB12zTHibBURRyes6ckY8Gq5OvTtp0aPNyl8rIdrKqaLX/XwF1WslhuQlmaPdVPE2ZFeYbYhiqk4oZRehDY6idp2DNzRyZJduQnEi64r3KzZM8zW7I4g0QOjl88o2tSApJqkcZcD30QpTABzyUaY39kSetVFa+V8l9cNsqZFiXzst4owgkfuCNhCtnKh1ec0jtdWhKNC3LB4eG7NaedxeHKA+iXjmeZ3qZR7B+LrzkcJnz8PUkctOh0EQlW2RIDkGw7/m3riuBSV5NopB/HiWKi8W/bsDkDTfILk3YzYhU+7bDNBkeU9wDZcwc4OLRVZJTShFrvOe9iVaNeE/PU08ghn96Hy/6Og8XxKPVcfoFVBu0wpNw4RuRsZ3uOnEvW0MlGnTofAAsgOJhEStJyPzLJn3m3YdY8Zlyf0TT/1anZJNEXuBnjLIzizhHZPMIE08t7ian5cf/jX9L4AXVOz8GXtBMwei7/Q4UxI2iwqevA5UOXMCmZpZDnMdvz79vX9xHhBGps06rMmoksW3Nl87FFuyT3Cgm9n/xxawrnpkxD2zZNQjkuRzIVsaint0Q8Ye9xHbsr7OStyV7VhDYLgkvTMFl7Fj1DtR1Fa1HenZl9RdgwSNtE/jRhCQ0MgEDyQjT8JZAzaWskGTeu5PyZbT/Q2fQUim36cFGpGlswU/rWzR4iQqZRn8GXM2m33wcCh5Z X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bf2af6f-5f30-42c0-2cb8-08d9325619cc X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:23.4129 (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: E5Hts8rocOxKRCwLtFVVMNGUiMTXpQS/a3Gg2K0m6EMhTJUdLCJ8PjqWo36xHeVvMLYIHyeZ+Ps58AGiunZ5eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7857 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053927_930657_9F7E85A3 X-CRM114-Status: GOOD ( 12.98 ) 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 Fri Jun 18 12:38:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331253 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=-16.9 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 4E427C48BE8 for ; Fri, 18 Jun 2021 12:39: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 105B3613EB for ; Fri, 18 Jun 2021 12:39:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 105B3613EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=7Eg+/YG4w/om39daiMjvWsH3sYsFZSSBuiulNUlgEik=; b=X1Gzul8pzvsNw8 +EI9P2IZx03JJsyhdsj5g0EIRWhbA49knPFfGlhgYJlAf+nubEWkDTC8ftGrTaS190toPWyFIo3md Kq8Gmfz+6hXz9qiSRsFfur2zg/8mJFvpqmSf7oO/8N5JripFNKSnKw+hBYK9iCxsqRJ9AbGR0/Lf1 Z6wJrV1AlPvnvw1TrTIW7P6OEXvmPfmWFZzDdO0jNt8bT4apDUsiOEmJjBK6BZy8N3r8ULaHli2jC 2LU9Qm2pln1N+jV6CVxXOQtZbuqBCjmUv9pNjdWH26USxG3IflLUykhhJAWiqajrlDcTzNxxD2q8a nGqV/qSiB/8rT2vOoHdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDmW-00E2rg-3M; Fri, 18 Jun 2021 12:39:32 +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 1luDmT-00E2q5-AK for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39:30 +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=1624019968; x=1655555968; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=g1b2/gDgHvYWATa7oEh+ICidzjQOA9pjNXMVVbcwMoQ=; b=MiRs4I14lI4pcp8jdTsMXk9s6lN6nA2mde43Xu/VY8scWduB0HEDME9l LPyZUSkkfKP0kwHQTzt9JQoM1O5AviC8p4W/eD+LqM9ssXtvGYtY72H+1 /VtZhwpNwVTMeRUSRspzqx2jV4kFVBqkBKVRvS3AHiqUaJ0Fprr9PTIR5 K9VJS9yvikUPAoR8SQqnoveJ9UUXU6AXxIJeKFdwZn1KR75nBUOXSDv8b bDwBEafKaNTgZ20qOJ3cdsJuJ2OyeAYwq59jVGARiobqUBWjtCG95PC+3 TvQo7RLGHc9HnMjq80vAOOFCNatigDewqKMDlp83JA7yXglzCX2TBzLlF g==; IronPort-SDR: hF3Rya+y+Pr4NK90rj3PhZ/tuwDd3saYajaGoM+BUgh5K2BkN/+36E6FMkIC/dyigZm/SivkwR fRDB2Kn+F2jKfargPgosowYk614yWrt0mOU1Yg24vnXeeLdaDOcGlMLZYtJoNaDEOUb/4WNa9M n3JpdCf6i7FPoCjeCKb7s5OblGkU7Nc8VIkAMeZZ0htIihvBylm1xrQZrFvdIt6/DOlh57DlO7 yG9eb4TVYdKMb82VANhojdUgmV45X1UUPwdxbDGZSXmz72ucqI/Z4PU/tbJURLFLhhVTf4A/xa mc8= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779300" Received: from mail-mw2nam12lp2047.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.47]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:28 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DSIl68JiEN+pxIQKPfMxgiRE2Uvejwqzsh2cBzEpZZE32rhQhTihwDGmAzIvSpXlcUQ8Gvw55T3YG2IGh4q+Vzx2SiqButquJsbz02om4CfUVKYXorUBkQTR8/vgt8CiJrBqGE2HMxzIPvycE0X4jL487iKQoXV6a/kyMTixEnnKLH7XYcJY/6SsACiLFrI9MjgdcB68WSV+Fcrsc3PG4kejpdj6Dt/pSmy859YNjDPxd0MvthJzknhsNP2U5yfWlyNt3/ELnnWOFKTLDRVojAw6f/BVMcy03+kYk7iGryHJ69Hr1LCfIBQs5++ua9TiAGhqOGYBSW40y2VlMDy8NA== 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=xw3ZR4ebXmD/CfNfUf3eyoqj9/uqZJYffw2EkdPNHaI=; b=glM2oPvqNCEsVrh0In3hYiRdOj6VFI2hKDyOPIztD2uNWM4bEAGNrV4gKbBMNVR1pH0mFP6J6BgSjX9JAUKqYruE/u6Ns6HXdGHSTwNoDaiPqwahbReto56Vd+W+4fFBif1Wq+yLeqTkLyOoUPlvRx4F/GjPppafRb+Hh0zyge3to8duEwnW3unevq5zSoRvl8nnh13KofnEfbnKfRQ5TlverbeJPkFhBQdWOBdTUjsbUwBMxndA6GBFDU9ctV9I3UjHZ0N1b64BgkNxfzrUGiBqXEJhXNgq+rdEUeVvRwioFT2Rxhm+a3uhmDRU3fcvdCAcUErxN9+80yeAoJR/Yw== 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=xw3ZR4ebXmD/CfNfUf3eyoqj9/uqZJYffw2EkdPNHaI=; b=a6VatJdMdfBiSQsTqDbmgv6oleH3l6B6kNiqXrX4gSRnpELoizpztATTkSRc2Dqj0LV1LWa+WIp8jSR2Y8YTiga3F7OZKVW8gOnPIXBlj1lH4OTYIwm0jpnjZ4Sj4csAZPhNMOVyAtzOmNZ2x62OEBnWo8a+PR1aCA4SZ6MnnDU= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7843.namprd04.prod.outlook.com (2603:10b6:5:35f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:27 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39:27 +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 v2 02/11] RISC-V: Use common print prefix in smp.c Date: Fri, 18 Jun 2021 18:08:42 +0530 Message-Id: <20210618123851.1344518-3-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60989b56-104b-48a7-8b6d-08d932561c62 X-MS-TrafficTypeDiagnostic: CO6PR04MB7843: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jQ3YDaljQ6pMp8+b4378tEnFMuPLg5KMvLgU14rrOyTs1r2nW4jQBQRIuNPkaejnjbvHtFNekhRspuQbIcvpBuVdHO7kLFZqFkIF3dlKj6NEherWEQAQ4R2BKob3xbzqI5FTtSz2iGoC8xB+wFzErFjtPENlJtn1YO2cpLAoIIUszIlU+ZYVxm5uTQ428K1rH31/q4duP21wWdnnoN5UC37k7UkUJRzz1L5rHZgpcG/Scvz5FtbA6n16QO6FZHAtBMaQZTtcQ3AgJeQsIHpTS0KnKf84oloRcDyJph+ZQpEWi8XDMCZJOS3aKrvOyUF/1olIG+HVzCNgQo7DvucCZ8TZX8K0kMlJqdhPay6HJGILWJX3M8WcIhV3DTZ4iBG44cvPTD/UYIgS3BYbA/x7kc0Iq2zoM54eYfc6XH/u0x1k8c7idsU4qj/24G3EcH4MSYbT00mc8f6S6a9vT5mgKz8G0rYvAbb4yid21cTtiI4QyKeyZ/xqGcu9JxEKb26lNHJw9Os1I5KCO40GfKOSzwfei4ntTsqhN/JVzJgSvTUUnKGpSwpfTwdh1cpXawVu66s84rYhS2JW9dgAZQe5phDoha1kwRX05d0w/8QXWcYl7LdwZE7CDdd7z5e79dbzAeHuTr8a6iuBn6kq5k2xW+unqu75sc+4oCylU+iXId0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(366004)(346002)(376002)(136003)(83380400001)(316002)(4326008)(16526019)(186003)(110136005)(54906003)(52116002)(26005)(55016002)(2616005)(956004)(2906002)(5660300002)(7416002)(478600001)(38100700002)(38350700002)(8676002)(66556008)(8886007)(44832011)(86362001)(8936002)(36756003)(1076003)(66476007)(66946007)(6666004)(7696005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N/QXR0sHc10NZ4Ndsr7a/5fKWKvtfrSXJMunc+WGrSjHixPxzC3ZVxOrVyDMowU+UULvq7gYQSQL0CPGflEBPf5bm3RL+aLVCWG7T+74D+LdyTCUSuyEnYXrVlUOEZ45xLBoyyacehMk88SDvy+AJKyn6LDtrrVeXj0R+DCXyjaT1VIAKI1VITyRQpH+0C5A1Nj1W/vbzPrZGYDBpVTMNuuD0n5sSLzMZ5w3MOsGsE3fR6Vr0hVPPpXXdQbS5XO0pinFs+uZ2TcX9St8tx8ngFOui//84gb5K6RODd2PgCwSpuSuKMb9qt5/GccHd1MWEJIk9aenwfKpUkevCsYBGDrJfBvT7aswZlrz8ghmOGrWcUia2tVzPMUITqIpNgeUQVMzy6+tpcK+5Z/4FPsKgqBSAngVQC+WxluwTPrcJuyUQ6Je+HCxjshoPAsmgONF4UwaXGqi3rAg1nCpEcc9fQwmJpjuwuOKOmFpnd2OOJOoOjMzV9+HJNZrafGFU0uiJu9HpZ2+1Fdf3nXgeIxsBAgRHIVj8M3V4otscQ1y9IIQ5pRKpPZS1H31Fb5093e/d/UWf4KyB4Ap4qbOlmgRitQSxPT+8NQ+G8RcrUgiJbnyVd61rGOouZ3fRnG0s3ZKdTKUZ/7yqYxL7YQaoGQRDXU7tl6oq/u4xlk03N9RFvmmCxa+6364l7Yc7Q1nhnYr143S0yKFkJMxFRnWf7qUpTNDok1U0vP8vXsWvrUj2/fbl+Ku3vSGcTGdBwrAgakhwBSvQVEvBvguxW+0SRyIj8fJTcfoKnFWxug6fgxoDx1szjWXRO6gl0evdXihHp3J2IIWxNz+RTufZP7vW/YLfCOSbPdLq79ytwEUDvi+7at6Pnoc2PpDZP7z0Ub3ciVlR9qujmRtcc5pI5eW+ZrTIKYp5Jz3BwHApBI84Rdh7qefOg39cEG3laqgKFqOa2ODH0SUCKvi1oSbW8HGUH6Qj4OffmvQf9Iv0jAvDStVcCvpUTG/d0REZuysJ1YBNG4Easf7lS+ymuBS/7+CzM0thoBmwy1Z7aziGNi0+/9GdA++T9RZuUv9vu4Pk9zgp1n2Z5kuwj9KggNAonN3uRGu6nBorIoSWUzM6uW8C9VVZGjtA+r4zCaMIfvZ/KN9vBFerViUxj6ge3dL0qHhfQJA4dHO/uuWHdtjvyea257cN1FrzCp6vhEBnUlhHit4a8wDtU/NUPE+O7FVR4O7ZOsA8RMft/ZPRfzvuKlAUF4x55BPg2pIf254zQLpMDwDaoJEv6VcMw4bbrnlnuSeC3EPu+0RW3QKQMNiB0HvPSEawAEugT9UrSijwW/Q4AiZly/+ X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60989b56-104b-48a7-8b6d-08d932561c62 X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:27.6174 (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: ZfkLvSWppim3CTat0Q1vsNesckl8ViYl80wRR7DlwGTl/e3kigucbE5/aXHt6QW3U9hVCK9syO6Fwe1FIb05zQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7843 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053929_404573_55C318F6 X-CRM114-Status: GOOD ( 11.50 ) 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 "#define pr_fmt()" in smp.c to use "riscv:" as common print prefix for all pr_xyz() statements in this file. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- arch/riscv/kernel/smp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 547dc508f7d1..eea0c9d11d9f 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -8,6 +8,7 @@ * Copyright (C) 2017 SiFive */ +#define pr_fmt(fmt) "riscv: " fmt #include #include #include @@ -114,7 +115,7 @@ static void send_ipi_mask(const struct cpumask *mask, enum ipi_message_type op) if (ipi_ops && ipi_ops->ipi_inject) ipi_ops->ipi_inject(mask); else - pr_warn("SMP: IPI inject method not available\n"); + pr_warn("IPI inject method not available\n"); } static void send_ipi_single(int cpu, enum ipi_message_type op) @@ -126,7 +127,7 @@ static void send_ipi_single(int cpu, enum ipi_message_type op) if (ipi_ops && ipi_ops->ipi_inject) ipi_ops->ipi_inject(cpumask_of(cpu)); else - pr_warn("SMP: IPI inject method not available\n"); + pr_warn("IPI inject method not available\n"); } #ifdef CONFIG_IRQ_WORK @@ -242,7 +243,7 @@ void smp_send_stop(void) cpumask_clear_cpu(smp_processor_id(), &mask); if (system_state <= SYSTEM_RUNNING) - pr_crit("SMP: stopping secondary CPUs\n"); + pr_crit("stopping secondary CPUs\n"); send_ipi_mask(&mask, IPI_CPU_STOP); } @@ -252,7 +253,7 @@ void smp_send_stop(void) udelay(1); if (num_online_cpus() > 1) - pr_warn("SMP: failed to stop secondary CPUs %*pbl\n", + pr_warn("failed to stop secondary CPUs %*pbl\n", cpumask_pr_args(cpu_online_mask)); } From patchwork Fri Jun 18 12:38:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331257 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=-16.9 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 612B1C48BDF for ; Fri, 18 Jun 2021 12:40: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 2B592613EC for ; Fri, 18 Jun 2021 12:40:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B592613EC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=hBtTY4AM/DcDe8t2nZV3/dHuAd+KxXgag0Re4Y+h5YM=; b=RK43Q3pylBgNlc SPnv4XFWSnMfJNz/n0pI0zEsRot/ZZNIqYx3O+vgw1g4bMpKV0PVdnBWg7MVxvjkJNe1ZWt832rY/ OkheHsOOUYp7HwCy6wRnEcUhL02pahqItfSQBn3XqGRw4xGIH5xnxMg+Nm7JCxKpJqxDd/k8+K/Fv w5keSwoNDnpGcDVBZBks7YdYRdJv6c7vqLVjIWjJ5mOsl2g93s/WCZ2rEUq6UIj8rZGkyXpqVXxPb pZxZtNF3+amDj87fRdkhsMemvIYGp4Qe9tAGa35o4forWQS7fHsINyrbTe+zEsUJnFl608wqiYM6q p1fwwr19NFnBWwWzsYzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDmi-00E2w6-OQ; Fri, 18 Jun 2021 12:39:44 +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 1luDma-00E2sR-Ct for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39:39 +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=1624019977; x=1655555977; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=p9SPIifpgAUMue5YIizFyxOYWdR8ULw0sXEuwEa3Ph8=; b=VVbiqqTjbUrZ2IKLMYXxTa5b0a6sGUIDd2+vq3qunHaKXvI8tUPCh5NO TvHWSAL6i7qtPqLqOo7aCkx6tzWuT6xWfP+BC5BshfioNFVniCApJBmYf xD2GTYr71wORKPg/HmnOeB33CuzMPk45Z5NWhQwnxBEyCBJJwhrbxcnuH ZzhTygc4TLd5JuysmMx0jYj2VsEvMNLoQYrAdgFBZB07Bgd0iNiY0T5Aq SRsWQ/RKQvQ/i5mpDmNrqDT417LgH3fALKTdyAfi3g1xO5j5eR+aFa8XM Peybfj5H7S7zSjJjQUsebSruavKfbn4Q0aWY0O2PGRTO+tqyYoqkl2e4n A==; IronPort-SDR: KIOtjBgiItoyzOyVC2aqmfGV9m+FcAUUbq8vD2K70VUs7YA0lADfSej5xlfl2JfobmfolXDQ1f bJVjfS1JPhuKr7wt3vFxU5PvLFXLpSmmhqPdtLHu1zE7SrgxytE0UeUyrIDfjn75czL/IDoXmm TsR4jFZwKGMu6VGSDGQLtCnoU2KiDdCNRJDDM4YDGSNU/Wz39O1lxGc8HtOfVqwH1dHJD5rKNG vouXy0A1MtD+AhQnicJnVgF0oFAjIO2fOXlR2yyaTAmCEnF3sl/tgnb7S/pu35H9hzCiD2+gW6 zEo= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="172868582" Received: from mail-mw2nam12lp2046.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.46]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:34 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aMcOySct3iB4tGzrKWCsysaCamxsjav2NNaju0qT5ANkCRIJuJYHQ6BrNL+JwQTCelWyIdz7ZK5Y+4xYjgxNTeqNI5mUtSxOPtZgnUYoPz+7ckmUow7cd8iWdtRFVmU3ZwReg9swxGxUCwZwzX8PNPm3pJsqbjvKknDp8kNd01R1FSYJIKm7fNHkwhjV1RP3WaAWSfZMPJBaevMHzOQ+EfY+8lgcufnwWZJefgsg00QO3KhZtr4yTzEtcZkxdkvaZUM22KuZYwoTtTY/6NmppiLxLyVf/NejZjdf1EynT3A6SIKBnkmya8bjcOiCE1hHWU7Tl+mRnhm2ia9tmLhcFQ== 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=VuAeCHS8L9/8UklSJl6NJXHeOBtv2CoyzvylEjctprw=; b=dl0CPS3Ol8VhypRYFfjjXTf2J1cxQwmzHgM4RrYhSeflQ/ru9IG7ug1lCQhGMsIxGi/mr3MmIydlHNZVV5vuO2+gfLuRMuwHQl9MBs72yEue6tW/Lo3CKn32vHlJQgV7N3l5lYphmP4EnMVGKQHcrvtL4rehhDEcOghTp/K9g8rTXUmGXkI1U/WGvoebVAjpmif5zb90Bxl8EJQ+8UR5uXcDM6f3G8a8osxSh+RnwtEf3nXSCmrvclXG39zxMz2IHyqyEWzdSp00YkODFpGhEYk9vwHDpyM9wbR3Au6+G5h8ud3sODs5Rnqzvpib7LMxZQNfl4EkVEyurBRjELCxzg== 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=VuAeCHS8L9/8UklSJl6NJXHeOBtv2CoyzvylEjctprw=; b=DQQgcFU1MhmDiVHD9OCgp6rvCoIPDq1494VwQoPtPPj1Rbf/2OqU66U/tMpl8JTvAIQnBQsovnTaeSLdmCT9LL7pyXs9AcPdDB55EeaGl/3oAZ76GcFhSPCg7yuxHRlIPdHPWNVQfavKNJ6RSKqXHLoTtAYJ7qhCy5N3sSkU1x0= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7843.namprd04.prod.outlook.com (2603:10b6:5:35f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:32 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39: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 Subject: [RFC PATCH v2 03/11] RISC-V: Treat IPIs as normal Linux IRQs Date: Fri, 18 Jun 2021 18:08:43 +0530 Message-Id: <20210618123851.1344518-4-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1db70b4-2124-4873-58d2-08d932561eac X-MS-TrafficTypeDiagnostic: CO6PR04MB7843: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FRGyvwEpCsk/ApmlL5WsoekrB33zILDxMOy0r8K5Bw7eAbB2ezRjuijfqa+c1wUNAlzqYg3gm1uS2+eNcXi2+KY0N3tf+I5sh7R1LnAHpYo97GWMQ0hYRIgA2H78B+1AN2b9h0Nx+sDvWEHhAS9Nz47TCGleZd5FDeRSyj5nucvLGPiJMpMVhg/PaPBy7kMGB6ntH8L1FVll/6MSsFTor/anwHx0kRyKjIHiByXmRSvlcmkzq9KhQQRpUhuBjCc9IbUa3BklP4VieEKomZoyOGokT1RVOVR9+5i8BFaTJENNrJzRUFAjthwihh8glrhFNu3F2iJ0c7bAvkEveYmR4iJpqffS95KxTl6tc9TvuYOkP1Qoyl0t1m3bGbZMcXLzVwvfYpmoeR2jRp7+8304vh0sEXrUDgy+ytqurerGmcIbEbiyGh2mnAyQycUkUu4gJYFVSgf7O6QqCaNKo68eqn/ong4FWf7WqaaSayyJH9N4TgleMWuax0AeBtXwOOmhvsE1BQQnyvZLKlfHuGxc4G+2jNKwKHCwvtkcUAq+NGc33nPHhUHzfKWhcZhVnJpcpjUGCY5U7c5u+xrhBmeE/kD03m3b/5zTu4sF1Kv/uC6Dv+4y3cutBYWzsCoM43m8WzasThdaPKuwJCUBhgN8Sg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(366004)(346002)(376002)(136003)(83380400001)(316002)(4326008)(16526019)(186003)(110136005)(54906003)(52116002)(26005)(55016002)(2616005)(956004)(2906002)(5660300002)(7416002)(30864003)(478600001)(38100700002)(38350700002)(8676002)(66556008)(8886007)(44832011)(86362001)(8936002)(36756003)(1076003)(66476007)(66946007)(6666004)(7696005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oaJuUirsQNiNJDmGMKZmQ+Gb3o9RQZ5DR461s9aZz3XLYslFCTQq2u3Ff1cwfswiKT6Wcc5oQoeZbnbFGlHYy0fZQdRHOVR/ciTu93kg9TWoT13RX3VE8Cf5RhjJsTYolBKtOc5TtH7hNXhH+xsyKSQ6J93PtclVRUimlAjY+B3v2fVWi4akC7lm77h2RG8Uffa+fU2qb3HyBdoxaxDV0I5rbii6TgABnTAYcl3YiaUYEycuy7fKjd8uK3rhP0q3zqU4p5ha2VL23mdS0lSsOJaqr6xj+t/zUuvj7GDIBHCTITtlq6uT+BR5QanEiO2n3R1Hz7Wjfo2kDQWauJVWOutfXF3Ua1pB/8BohFZIFxCaHUk+8IjddsUkm1+5aytsuuSv8QRBVfOBA1V7avYXhMBB2FaCcGqX4UdhKln148dmEjc/G1bHfAn31ZXKbZglY80RuE5AJdhPhrjRXybwLHudt7s1sz82HNAWAee9t+ExAVJVfP3fdLsGdKMxpcYTHs30w5Y3gUkR/GSz1ztvx0Ftyh2XVD6wJ0sTqr40/wRdFqgY7D2BRt1aaP7tJbQ8flK/xLLXJpz1QxAc3DQihHZcxIi2bM14vUIv+bWOyYkjv8zxWUHS03cqygbZSbwwplokqZlBBiuPPfFDsMElL9n+ItcYq1/NLXj/O71uB+6eqeBGP9sdt1VLR2y9LWuXdq2c2HpbXA8nD/o0S0RQ8BIHfSbNmW8ycTGFvTOLVxgRTE1Mv+WJOT2w1d7rcCK3In6yuhlwFPfbFwF6pV+e8/mOOLnLI9Fs/l7e+jkQ+ZSCi6ZqzeYu0k0IlJvEV82iilHaW7XPmrLDTKU6cVPe9GSqKqvNIZcPQKxzQuwI87MqmO6IOi6qINhCSH9RGnOAXN+4ClQICCzHn/EksZ6I2akTr6XAZhbnnqKTJRg8c3gqqhH4drXkXN5O+LYGoBOezPKcJoHWacBCR4lW08LILG/JgXq5BW8jR29RaPMtVZM4VqohyJehLrMIzTXd04pMBhUMH90a0sbADgSgWoSIGUUQBd5jbih+iYseBCpISwrWa/FZ+9Z45HpZK7AK2mzONCWSnwPXuq/6hY/TRfRvtMfmelgfqtPpOtusIPlLYr0fwRCSwj/Am52hrVvxUiMRLbFg5ITRAgs4BgBTTAhcLJacLi3nwkSuoPDvwRSxnxVk5JLFgBQX5z3xjlmo2OTROHD4lGHmiROFHD7PDEvmmpbijgv/ZsTG+fo/PLJatRzGshODwnm7BjsQ7oDU4ad2VIt+mQRl7cZevFQ4idw27J3mB8hLxElBKYk4s2XsuHq2ieE2tvIauWuGTNa12ARN X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1db70b4-2124-4873-58d2-08d932561eac X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:32.0828 (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: Sfe+2WCvfui3dAPIRttZI3TuklbEBke7DgHEM7sLyAGCuV+HS4Mzl/2ZC4Qjs9aV1tKinzGsxmqgS1pDWGM0sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7843 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053936_594862_D42197FD X-CRM114-Status: GOOD ( 22.88 ) 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 Linux within 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 | 223 ++++++++++++++++++++++++++++++ arch/riscv/kernel/sbi.c | 21 --- arch/riscv/kernel/smp.c | 157 ++++++++++----------- arch/riscv/kernel/smpboot.c | 4 +- drivers/clocksource/timer-clint.c | 23 --- drivers/irqchip/irq-riscv-intc.c | 55 ++++---- 12 files changed, 352 insertions(+), 172 deletions(-) create mode 100644 arch/riscv/kernel/sbi-ipi.c diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index e7137d93119a..2afc9df7176f 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 d3081e4d9600..210c783c8136 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..6cc0ea95e1af --- /dev/null +++ b/arch/riscv/kernel/sbi-ipi.c @@ -0,0 +1,223 @@ +// 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_mask_unmask(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_mask_unmask, + .irq_unmask = sbi_ipi_dummy_mask_unmask, + .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 irq; + 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); + + csr_clear(CSR_IP, IE_SIE); + + while (true) { + /* Order bit clearing and data access. */ + mb(); + + irqs = xchg(bits, 0); + if (!irqs) + goto done; + + for (hwirq = 0; hwirq < BITS_PER_LONG; hwirq++) { + if (!(BIT(hwirq) & irqs)) + continue; + + irq = irq_find_mapping(sbi_ipi_domain, hwirq); + if (unlikely(irq <= 0)) + pr_warn_ratelimited( + "can't find mapping for hwirq %lu\n", + hwirq); + else + generic_handle_irq(irq); + } + } + +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 device_node *node, + 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(node, 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, *node = NULL; + + 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); + if (domain) { + node = cpu; + break; + } + + of_node_put(child); + } + if (!domain || !node) { + pr_err("can't find INTC IRQ domain\n"); + return; + } + + if (sbi_ipi_domain_init(node, 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 eea0c9d11d9f..26d563615f53 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -42,11 +43,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) { @@ -88,46 +87,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("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("IPI inject method not available\n"); + __ipi_send_mask(ipi_desc[op], cpumask_of(cpu)); } #ifdef CONFIG_IRQ_WORK @@ -137,62 +104,90 @@ 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; + }; - irq_enter(); + return IRQ_HANDLED; +} - riscv_clear_ipi(); +void riscv_ipi_enable(void) +{ + int i; - while (true) { - unsigned long ops; + if (WARN_ON_ONCE(!ipi_virq_base)) + return; - /* Order bit clearing and data access. */ - mb(); + for (i = 0; i < nr_ipi; i++) + enable_percpu_irq(ipi_virq_base + i, 0); +} - ops = xchg(pending_ipis, 0); - if (ops == 0) - goto done; +void riscv_ipi_disable(void) +{ + int i; - if (ops & (1 << IPI_RESCHEDULE)) { - stats[IPI_RESCHEDULE]++; - scheduler_ipi(); - } + if (WARN_ON_ONCE(!ipi_virq_base)) + return; - if (ops & (1 << IPI_CALL_FUNC)) { - stats[IPI_CALL_FUNC]++; - generic_smp_call_function_interrupt(); - } + for (i = 0; i < nr_ipi; i++) + disable_percpu_irq(ipi_virq_base + i); +} - if (ops & (1 << IPI_CPU_STOP)) { - stats[IPI_CPU_STOP]++; - ipi_stop(); - } +void riscv_ipi_setup(void) +{ + int i, err; - if (ops & (1 << IPI_IRQ_WORK)) { - stats[IPI_IRQ_WORK]++; - irq_work_run(); - } + /* SBI based IPIs is our last option */ + if (!ipi_virq_base) + sbi_ipi_init(); -#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", @@ -210,7 +205,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 9a408e2942ac..b181d981a960 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 Fri Jun 18 12:38:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331255 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=-16.9 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 C1BA1C48BE8 for ; Fri, 18 Jun 2021 12:39: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 8D31F61369 for ; Fri, 18 Jun 2021 12:39:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D31F61369 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=W10CMVebZiShTgSk6nr/0hsdJlyMPj7BLNUb7Uqa+Rk=; b=bc+VGbo/qeIUkS xLIOiT7UpS2p83uGgaxgCAVSx8RkivqC+CUqs7lm09+deRx2af4wrKj3l7bjNi9IZTtbZPDpZWk8I yt3p4hyZGDF06MfSqpj8JUjJ2MrKHhvzGBAHvIw4z1zEAdyPKvkucdP1YDdOfENQhO0EMc5yPFzrS FESSbO+yry7DWZORvSyol4glK6BEVDqgBchsUxGXs+ivxQQLoP/T7Ds4m6TyQvvgoF0sTisV457+g CxddPgMsz1uMQqCs7rORoKZ7WcwVj2WY7Kdj9EX67yK9NyIzcO7u5ddHLpjavz4VVXqs5iZYxBSdZ JfcbwRjdwhybbV6Kg8Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDmf-00E2uL-2r; Fri, 18 Jun 2021 12:39:41 +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 1luDmb-00E2t8-Q7 for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39:39 +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=1624019977; x=1655555977; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=KlzjgfDDS0bfoaFpWdrpgenEz3ga6t8KJmgOBXJ5SfM=; b=gx3hQw90CZ/9qqFHSeCykZZmWSCd3Z8yw1i1LsZIGBicxOVZsldVmecz enH85jac8+4W0oHPFD9y4Hi+Y4Y2WE9Av1RD6BD8NPHqCwu6hklDVNLkr IXsB3PspRcPcj40pu6f7jtkFsLSMPV2KVXvV437MECyFxg2x1uMQFSRrl kFX71lGDtwqZCUPSvm8SCIzJ5n04rxGeOXD9n8L7CE7m0fvJl/XOw00br g2aD8qDKU3cDiMV36Ul0BWLKKJty3o2DegRqj0m1aKkulcfzMy14mDAcM jmuvSBK0JRHU0jBOwJk5zGMAcUVwbmcWPRrCbSYE+Q5A4M8Rjpl+Vaplb A==; IronPort-SDR: GbhzW0fQpN/zHwWhM3xoiEI6AKw/RYCF2v3oTA2C+iRpwH3YYhI1y2eSmToCu/pEcqAcanqMav Wv1iPvNUm7b0Koc6mOMNESIJbJlWnU+62y6zI+M2yZUPmYAxUZC6ZMOjYa+rwXxoXBhenzdgAI 7UJi1LWTgunUjj34sdlJxxu2gXPTXYJwLho82ZP8sqimq6Ct1G5s6ewhabiLbnmsixhA80GEu0 +kP14q7k7HSUDXF7ArCBYvTFwKM3FDG7+2FuH3A/R7byrvnNEFrLfSFK4ya7Pu/eqyQrFXWQl/ vi0= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779308" Received: from mail-mw2nam12lp2040.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.40]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:36 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ImsDc1zqa4h3QoXBf5o+fFZWzE2NH/3N7CLNk9aCGWMbAbh8enfCmvoAkJwHDbERQ17eD7EqmREvgY/SMOGTjLTEZr33qLGfLAFcK+fRO5wvyeRxLAgRN6Apnid1wuzx5Hg9ylxBQ8xtCPG9NqREdIFvyZahLMt4y6VKnkD3trw07pSkGhrkmICl3x4w6D8ZHCOdIlA3F7tMb/vjd2GoAJCs3Nn+AfH7Sgu8TtiQluwvRp0LRZmNRoiHEzQxWM6IDLY9ITiIqGII7Idx59EbfrmSmNIpcUZkTzfegRU5S5DUdGuTDj7LbIRb4AaZUcqvzeUUIcKPeBOdbkHmaPc2zQ== 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=xAiDCUj00GGoAG8WLp6p6vPZ+oLgsdbXAnnLR8roOos=; b=GuVkdRTZZPgT1rc9uRwP0RCUigpPYSonrcqendMrO1P+xkOW2pphcJyhzVRCoV9skmGuOlmI0Clv20QZbUOji8ZzgElRc/vTfE3MQoozwJIrv6QUNgGcCJlkumAwb/gg3J9yXu5Q86ual8h+mG4xZpKntm7ebZHYUkw+Y9Ei/B5NG1S9H5eWyzJUzNMGmZKMcFQnbO5+0+zlPyPa1mH3Xd/5XIL+LsF8ayzNiGTvWil3IggfDI23OdptUblZJ2/VT6o0CBpYxiFAtg/RaekS1xxhgCeA34kK23b49I5Tzb1exMMYWGo+fGY1n80PPvv+RDnZWhara1dteYuSHznkCw== 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=xAiDCUj00GGoAG8WLp6p6vPZ+oLgsdbXAnnLR8roOos=; b=AH9bfI/Ym+25Zpz/0wpHnHK/b1ZWgOkooBh5kwn3/Z88kNP21r/SC9UIDpno5di+U0vqdxqJh2y+oM1miXgHJKrffo6RS0vg+k3KTmBocs68sSR76cGvWDzvUxERfXn6xkaRhH/S2JjvIz9r+uPPjV9UpMao8o7s22CYFvxrbig= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7843.namprd04.prod.outlook.com (2603:10b6:5:35f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:36 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39:36 +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 v2 04/11] RISC-V: Allow marking IPIs as suitable for remote FENCEs Date: Fri, 18 Jun 2021 18:08:44 +0530 Message-Id: <20210618123851.1344518-5-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b455923-6198-4c96-7c80-08d93256218b X-MS-TrafficTypeDiagnostic: CO6PR04MB7843: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YNviAol7z8DsJnkhqs3EYri8pV87dAtNJP4dIhwYxxwjj2ifnqjfW7bR6MnUjpVsq8WSX31MxDgmVhZGXrViuhrtWcsVX5R5gVQZHlJn9n2lCDmCSYWRcMoZPJf4oCvDye59ygZHY08jysEiIucfNgJ5jEkpVrL3lulHrpMtO1qNMK9JIo4LZS5n7T3/mscRzHbjhHJ8H3xSaIGyWgHEKIcQvx42xf27sLeZ/dz2y4jNqvTMMtSSwF8CgZmrNyuzrlxiDJB/ppBIPaJydC58NCm7UZahfXnUUcQXUUz7t6EZX014MFC3xQHcVNJy2Cg1rZ3pa+S08UWt2ke5ZWiw/7p/7YOMTJAsUayFeV4LeOSdJRvAF0kBGXrPEWtMTHPqM9wtLeaM2Y4Z6YiKpLXmia2SLVYqFN6ZoAqIXPrnu1neiI4f0264CaRhhRnDFWln54mY/m+Nq+ldjtbU3AlyUNIvTF7RHBrXqwahxeArKpqenx9zDFpb7cQf0w1SfHGpj/FB/XArsMxMuaD7rtiCDRcN1utxC5toWIwH2fduWWNlXupB309k3yQjgmpj4bJ1culIdXk4SfcKYvfiAkFF3a09pqiMllRyfV/ZVTZ2l71cfldiZ898X/D2L99wnlJkJXpmYfSq6QGs3aFskya7Rg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(366004)(346002)(376002)(136003)(83380400001)(316002)(4326008)(16526019)(186003)(110136005)(54906003)(52116002)(26005)(55016002)(2616005)(956004)(2906002)(5660300002)(7416002)(478600001)(38100700002)(38350700002)(8676002)(66556008)(8886007)(44832011)(86362001)(8936002)(36756003)(1076003)(66476007)(66946007)(6666004)(7696005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lBQBccsGOWMDQ9VifTWOhXaEbTAcKaRybvVrIl73Bv9KshMGIJV1u/6I/aJUsWYRvfrQgGvgOjInaYa6Y5C9bm+JXn3i31Vl8aM3NxTMdTiJAne97nsDpoXS9kdLHjYdyegmNkoZYd+VWVLf8HvD4yndsGPjDLqQbnhzI1sGNuMHFkWya/S/tPL5PbHPh3j0tP3Kt17tKIybcvIWWf8ZFPSrrL7cuN6Y3PdGuDbi80Ng4ZAZNw9/1iaWny9c2TkWhwRYOyR6LMmIuzWZdlb7apZXHSqC51LDm2CLiSLTKU2NyWEsN2AZnr8IaEyt9onGU/zjSzgtS5JLeCmkW1B2JiWFpWX8rlYtWFyFkfRXaC9pQl9YCJXX/CjDr3kQU2AcSmI1qEdrlhbkI2xy+AcEGthhNiej4lo2B1LFyqEtjbR5X07hrplc0jLmjifzWztMAOfCC3OIEZI0wild/0oaL1+RmDuRpVyqAzfwp/9i/gH08pYZdhMlU9C+yAVfANT1eA9qs5jKJhfjjRj+FoZ4W/wrENiMuNfWDz54FYXv77WtU9WHcLHvM4nyIIXMK6onQ2SL4P56yzWhacHFNZuKT0GhiEyDRMY2UAw4dMhDwBJ2PFTM5RW/C44JJVU0d77LOgDTKZWIx8CJVweO6dZFkd4ZHJxFU1c3YxYvUC0ukSNTicnebgISWRJEB05kLZKy+rRyeQ2vWF/VGQsGFdBiTBYyMNYkJRpR+M8C/HGHUfRU0DwfqEFe2UQYVnN/eQfoNnn1jFBtn46BHdv2Uc4ZGuz8rxwwgnDdIQMakYV8pgD8JAuj9v3+06ORto7qYrnz9glV8nr4Bd7wxk+zzvNKcbFPTp0uxps3IS1RcLeqKekTQM2u8ak8kLCxAnhpI7g34MpcGSIkxb8Vtwjt5s+xZ8scN+VXu8easiVBmcvUjQzz907xg/6xltpOBqudjC+fSKLSQlpkxW1DunCWPbBUkOTgJD3gGZsxRowLJJvXgidpPwRIxzr9BsrxLx7kvYhEKizyjpyqn8XnpjqZzLHrbYYOCbM3P6o7wVV6IYlG8HrbmIsQGLD7BDovuDCn4LJVkKEcF3Ch7jfmVe3HaFD15E5FdCJQEukdWNm4MljEmctZn9UQsDTjWqfWzuRBasykakH9jBiElZpu5pUsbce0qburCtwnAKymYyFR1ukcRbvS42maepauOMjEmS0lcqZ8pR6dWwoAzG6xcatS9C/ecp6BNlhpaaelAqk2JIP9O5vuAsPZpkYuy++oZZ2wgMq2XFwQJ59aSES9EuHc0IHpCV11Ehuvg7bdRvKalTfNAUV+wSfv1+VHz6x8GouBJqT+ X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b455923-6198-4c96-7c80-08d93256218b X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:36.2076 (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: 2a6TjvAKZ2ug7YDka56s6S3jfPLHPmASDiW/mBGaEz6hNPTrQPRlfa/u1o502Xe1t5pGzh6YT+OcOFHMZ6TFyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7843 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053937_946109_BB6962EB X-CRM114-Status: GOOD ( 17.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 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 6cc0ea95e1af..0a06542d2b74 100644 --- a/arch/riscv/kernel/sbi-ipi.c +++ b/arch/riscv/kernel/sbi-ipi.c @@ -153,7 +153,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 26d563615f53..3905177b6748 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -178,7 +178,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; @@ -186,6 +189,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 Fri Jun 18 12:38:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331265 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=-16.9 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 6183DC49361 for ; Fri, 18 Jun 2021 12:40:12 +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 30C6C613ED for ; Fri, 18 Jun 2021 12:40:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30C6C613ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=wN6D+o84jaa+H34cS9cCzKGTesP7NBowDngyVEOvI/I=; b=ycObuFTfAszaTk MQN/9n6uwwyyQC4FhvEfAwnQlIMYuuMtuX9b0KVXo1T0zxUkyJbfBhXfXbl5SKdGsHGuwgiy/smOu uUfAuBqt4grWE2+VzchfF4a3ljmXcmG/1N+OR/w08cE7PNLnqSnXwRtspV/IjPYfhPYr92Da/c1fp RuObDfGB5Ho5aH/8SHC0kEWD7RAamiVTT75Ed7WUoezcpEiHz2TyPVxqJs55zDiemNHFtAONX4eyH 5Geh/PIXgVOUySNLVpuDuu4ihW936D2S0yvJ2Dfeh/wk8/rntpg9GBgULw7qbyDFS9Ix2XfEA1/F5 jvSlqHX79tP219/n48Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDml-00E2xo-W8; Fri, 18 Jun 2021 12:39:48 +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 1luDmf-00E2t8-D3 for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39:43 +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=1624019981; x=1655555981; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=jkbKSZvRwwjsXmYu1Ws9MweMMyO4gkhzwEKijSyT1hU=; b=q1Zfk/8CAd3CUleJwXJ3tWiL0sSM4Vz9psXejSocMHSHUNLf2xKSEgvI LgZSXzXFXlMemYOg7UOlqSz2+xUFac373mOesS7/BS+4Q1cKOc1KS4Z4m PmrG1hY/91zzSRh1IiDCpScStxy1ifoaBnharTdT7sOGECIqRmkSr32Oh pAs37C1gRl67B3M50/V8JOEycx1VPbAs0ZQtJUthhK1wkwYR+cbTegd4S QWxogbC5oq3ghGawGNA29zurm9Vu/Wd+1MwdvYoNTlTRxT+5hdCRRN//3 QmmLJchIBsUK4+7gPiZTkh6LiRtu7OcpXxq885Jv1qxuhWHOnmsj+ULpq g==; IronPort-SDR: 8847SGLHPkENKLL64S0l0Uq5JsOU1FFYfmwVcnLxsIbI9uIBxRoS7xftW9wp33k6Zoi3HClFgG fK6503rFwVbrx964Zu1q8XXlNt5Vaqm6ILH6xxtdE4EOKTr1vlmfLXAZEZ8hzMNcg5ODtA827F R4xBnApb27iKAsaZaXtcZpr1Gn2/EoEgshMs5/gzu9PYqXWrqc+1GtF56VDL+VQ8SYOt4uX4a2 qVN+PVUBo0WB25MDJ33qsJQmqTnro4iLQkI5Bm0A0kFA+MA11/c/cM70lU+vNe19galoUq5XZe ysU= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779313" Received: from mail-mw2nam12lp2045.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.45]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:40 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ScKLZaQnEp5d87os23dCl2qpwbHNHOooaQaBVBVQUp/iptZiDoWEVVaOE/reh5WrEv80qzO6WZVSKen6k4L+I7plU3LXuCdHMng3RL9AuhkokqGBlNu9S07jRbnaLcokpwnXaDuwY5XQaDPFYAW9Z81XL8v52oPX9W2WEg1+Uvu4eICzVobkr33vPn7DYdFh5/qzYfjZH++Jgsgy8Iv02unez2BDAgtOYcVTcnRtlmZPvdWMPZSDiUUDHFcJif8WWEoZiqIGHpC23RiixY+fkl+Ddyo5HsRY8UW2OvRgTPjCy+cTnfxm5wZY4mn/o8Ig5C64fraJyCwTmMw/z95BAw== 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=0Jtqet2fuPqM7Ms6NUR+wXwwQts7PJjG2T9FblTTEjs=; b=DkQSLuxiTz1JX4fFz5yBtQmR0y4FAcs2Uk0xfPhWIrIRzJjkXggcUTKBPf1YCpE8L51SD9YOpWZC8MpVvr9WzxT+KAWaPbllljLe6h2smE4wIS3oWTxroD1c6cPr54FqniNooB0BHJ+lp7JtP0vK6L65wY5qVTNlWH/nInLDP38nKrGMKqjzWmyXvM+bKKUFl4tQ4HXvelRAZF+7R5nFeM354ulYrxYUmjyYfAdkjSZ5zG+zAJy6zpQTPWGd2wOnB2+Ipwi+2ZEyKB1PsAVZbo2x3HnkXzZnQQJbKJ7u3bw6ZQoP9dTlhvYlctBWCqQn/QXN8pG6NyXAyTYJxG01Hg== 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=0Jtqet2fuPqM7Ms6NUR+wXwwQts7PJjG2T9FblTTEjs=; b=gCKpNfl0bJjmwKX2e1Ez98jpYdv07tNG2FBqqZtMRxbJA4RSirgnBbSG2pqYS+dm7oJ42kAWNmH+kYvM0Od9Tl9ACeUiXWv2i9wKHn/A7khQRD/81HMOMy8KBBmSkCElV+A7YJ+75NtOwms+TCpaSuweQ6VdLBT8EUWu8eEZ+ds= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7843.namprd04.prod.outlook.com (2603:10b6:5:35f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:40 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39:40 +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 v2 05/11] RISC-V: Use IPIs for remote TLB flush when possible Date: Fri, 18 Jun 2021 18:08:45 +0530 Message-Id: <20210618123851.1344518-6-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39a25055-3193-434c-c26e-08d9325623e6 X-MS-TrafficTypeDiagnostic: CO6PR04MB7843: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OhZbIarndPcvfNjL0T4K4c9f2+GsDckg/fUENjD7kUxloZosBYXFJ2y7nZZnBDka6LfWpre9395tzWgATt7g0iCFc9UTMjfsawT486C9a7mcvVveGp0SFfuUTaOhiSkajPgnaxp0dlfuxdotCYEQPkZEoDLyoG4Xy5G5/x9ZusaVYxAyi6ZZgYFcSnAsfVNHBgkaJdi1AzmMHyL+H+Avase9/USKkr8P5cq1bPoAKqP4UQNMW2kkW6R5FKdoQPb4b2wMLUNPmltC65+vWc2MBV0nHCej4epxlfkIQPqKoeErl408GUQM/Uux4IAnM72+PI5aWGX6oQb9FIQEhIhV7RrM5VbIGbBRYc59HC1sV9Xl66BAahtoI2e6Sh95rJV5xYoSt1Aa6u3yyUiQUvGa94z8RvKdOb4EfVT+Xs8RDbpuNKJk1dcwJb2vOB3emODHv9SSd6zqtN2FbvwIChq/UDK8LhC4q6Ab9m1t0OnBWeuOmppdnWdEu6+SnNlO95Zvvy6oT3FXivoTlR9+WFhEflUVsyGZ1BkVpYM88yXUpyUQIEHYnubwqEjVymgguqUe6aaTv1csIvRVDewqqNzBkQorpr/+uUfKEACahEt+hSKrSpCy2nr7evJJRDri6DQ4N1dXan1jQXxJ9I7hZ3ECLg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(346002)(376002)(136003)(39850400004)(83380400001)(316002)(4326008)(16526019)(186003)(110136005)(54906003)(52116002)(26005)(55016002)(2616005)(956004)(2906002)(5660300002)(7416002)(478600001)(38100700002)(38350700002)(8676002)(66556008)(8886007)(44832011)(86362001)(8936002)(36756003)(1076003)(66476007)(66946007)(6666004)(7696005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hxp6OB7BGKiMHA2Y7buI68gQ0LPeF8rIJzZX3QkFvHcmV32Kll/9KMK4XS+/R/jZhcOTRFzXFVGGEdHUV8s/tQkg3NUCujfKQ5EmC6rA+r6ZIWXvUa7O0K0UQVcjy4t9eJFDMmso9vAlYofcVcrP2yoGxe/EhOGOXdIdFyHAlRYIHLmapj54MP09oIXpEzk81Zxp1nRqeXgU8QOk6Ifv4i1oqlieQKa2wKux9XsPCQnLHVFGzJP0/A74x0niCn35DuRRhnzpQUjNEYpMPrer/SGGWJuyF7oKfEZ+hv2RqtgeYnOrSHHzYFEszdKUVE4HNJADDG2etLSq4jMDf7w9/Fcxnfeb6NCKuer090Z/UV3crvmvOk1nbWpl6Gj4OSmPCt2/OeSRJkXhgx049KVCr5njmQSGFvAV97OyCPAB/MTuEuoMbdBtRGQnn3o36qxLwNzVGn3NQH0ZxZ5VHaxtP7e0J/lGpkYiuDhJMvDdoUFQgwN61C01eQOXx7Pc6ikpb5hWjvdAooEUboxtreHCqCQ+YNOV3I5cAgJuAIuTHUKXNCgd3gDvexOlnGmnBcxVgZGYxn2k9/GbVqXgh3SuOacbJE+LEGIueIED6DZyy1XVtP8FTRGtdZ3DLJIF5hVMDx32ovom5BcYP5JVkBS2/GkSldKTE/48oT/3GfzKs7BrlnDQBP9KddpkbdovAtUnb4MXJUgHdsEP8t24uVBZVdJqDj+SVGeu3ziEclsDXAm4IMYQ3ryfnUFnxlOY7C5t/Z7NywA5jKIyCImEo8y2+Jdw9MHUB3GN45r4FwUNhEYie2q5jpXEYXN1E6JN3jFBw2P4yGcN6iYwWnkbeS+1oqkG30mEZEOXQEUpdyRm4QE5ba7XZNtZD11bd3XFT4emp7lHWKBitTDmafeWeQ27siZu1j6p5eodZzCPQVaGnvZzN/c1xc3EEVyXielkwxB0lW1SYYAi9awnQAHpNHe8BLCv7BMqKt21cX6FQZTSS2ffdyCF87rXv3+lME5nv8wTllz92l60wGQAFAjj62EkkrU2d2FyRYmSqpq5YpbGElzrhl5jGcgFO5/L5YUB4HKA0g+/B0nCa2SfYXQ8YUZYI6btCrQ8eWze+SHTWDUP46aQy3+1/xwEzEyMEQBft8RIaV30o7mWbu8xeZ1UnPBFlbsDVr+tjQbnwp2LrXKeYEH0+4FAjtR5zvFh5CqBPYcECaCWegVMzPja9h73Pw9HwJ9/IsifZQQt1g5uQ2YjYnBv0Ga3NMIbH1oGlTNSdbD+nyYRWrDxnZT4BFle8uKcYrVWrKDwq5XQ8WeNRF306w+7QDJIY1KGUlOMKL0g9stz X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39a25055-3193-434c-c26e-08d9325623e6 X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:40.1573 (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: smPtT+AnXekOmDx6naCgizKfXxfJFwBwenKhym2t7FXPNvOB7yPqp0lu0CoZ+Lu7UrDqAhDQe/p/ssBLSgQcvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7843 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053941_498056_9E18AD0B X-CRM114-Status: GOOD ( 19.19 ) 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) 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 | 62 +++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index 720b443c4528..009c56fa102d 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -1,39 +1,73 @@ // SPDX-License-Identifier: GPL-2.0 +/* + * TLB flush implementation. + * + * Copyright (c) 2021 Western Digital Corporation or its affiliates. + */ #include #include #include #include +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()) + sbi_remote_sfence_vma(NULL, 0, -1); + else + on_each_cpu(ipi_flush_tlb_all, NULL, 1); +} + +struct flush_range_data { + unsigned long start; + unsigned long size; +}; + +static void ipi_flush_range(void *info) +{ + struct flush_range_data *data = info; + + /* local cpu is the only cpu present in cpumask */ + if (data->size <= PAGE_SIZE) + local_flush_tlb_page(data->start); + else + local_flush_tlb_all(); } /* - * This function must not be called with cmask being null. + * This function must not be called with NULL cpumask. * Kernel may panic if cmask is NULL. */ -static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start, - unsigned long size) +static void flush_range(struct cpumask *cmask, unsigned long start, + unsigned long size) { + struct flush_range_data info; struct cpumask hmask; unsigned int cpuid; if (cpumask_empty(cmask)) return; + info.start = start; + info.size = size; + cpuid = get_cpu(); if (cpumask_any_but(cmask, cpuid) >= nr_cpu_ids) { - /* local cpu is the only cpu present in cpumask */ - if (size <= PAGE_SIZE) - local_flush_tlb_page(start); - else - local_flush_tlb_all(); + ipi_flush_range(&info); } else { - riscv_cpuid_to_hartid_mask(cmask, &hmask); - sbi_remote_sfence_vma(cpumask_bits(&hmask), start, size); + if (!riscv_use_ipi_for_rfence()) { + riscv_cpuid_to_hartid_mask(cmask, &hmask); + sbi_remote_sfence_vma(cpumask_bits(&hmask), + start, size); + } else { + on_each_cpu_mask(cmask, ipi_flush_range, &info, 1); + } } put_cpu(); @@ -41,16 +75,16 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start, void flush_tlb_mm(struct mm_struct *mm) { - __sbi_tlb_flush_range(mm_cpumask(mm), 0, -1); + flush_range(mm_cpumask(mm), 0, -1); } void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) { - __sbi_tlb_flush_range(mm_cpumask(vma->vm_mm), addr, PAGE_SIZE); + flush_range(mm_cpumask(vma->vm_mm), addr, PAGE_SIZE); } void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { - __sbi_tlb_flush_range(mm_cpumask(vma->vm_mm), start, end - start); + flush_range(mm_cpumask(vma->vm_mm), start, end - start); } From patchwork Fri Jun 18 12:38:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331259 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=-21.9 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 D2862C48BE8 for ; Fri, 18 Jun 2021 12:40:07 +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 A22BD61369 for ; Fri, 18 Jun 2021 12:40:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A22BD61369 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=BP7KmRvghrXSAfxlWx6m47dwvoBBwdBqQAPDxFrSOeA=; b=CGnIlnnw3WMZ/y So7uqPN8lzh0Ti7mHdYpDKUnzU16kfcklsdN17rV0v5IYivqzQNVRpFr05BfyD6ZzyLBK3Z5RvTrk aezoK0tF+LJtXJp10cG4S9FFjKALXZ2rG0pOYXmIKnLrqGYOly3iz9s57ZenNT8zl05GCPlp8FITQ EapA36PpKef4CzrCRQz+Cm9yGnbSI4QUXtc+qvCsplbZIwzCMXk7b0c7tD1Avqp1I4TFXwONWfr9H 44Tqp2Re1f8OJdk2RZD7n57vghMn5kwUdZKVdbmw+o+B3LYJF3lx0/tmgL0m64d9QFERBk1ZUo6zj Ewb9tQBbw/SMAry47gOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDmo-00E2z2-82; Fri, 18 Jun 2021 12:39:50 +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 1luDmj-00E2t8-LS for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39: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=1624019985; x=1655555985; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=x8j3XS7e5BQGVmi1A6KneDVLcWPft9knQ19eSdgCyiM=; b=FF6Sze2xpiCMXTxQSosjBVYr1S06VYNsJdvWelg5O+ACwd2LZ0lXDzLM 6k3UVmWS4IJsJH+sFvhlAPM95Gq1hJDDeAEq1fZrCIUIHA3OND9FY3P5b 1QVAq9ChAup/cIQD2rutSWlARLKSaBgceRyUSvuyHyLVcvZNP49xGd5uz xgWKTLi9VHgSk8OuBzWrQ4RdsYpMl4tVZsiiuZrjmyeu1dAywcnxUbK3w tQz0aj6rJCC4BN4px2HyBhmHdHHFJ6Io6EXE4WJ3xffjRUPOBu/dZ605h eebrmIGUPo0o0yAbP0eKQojG1hRrb9/l+p7bPlW6BPX3ZnCS5HyedRZLe w==; IronPort-SDR: LhwP5QXbH+ZjZqewTU1bXJTP3C+x5sRutSsALAiyowbcvZm67KiPf1WrpJDz26WB1V7mvPcrtw b+evy/djPmjfLfCVAaeoeDDBAHN6mRHNnGLujYrxZIUDmqikNbu2gCYJsyuEVeHIPGBRcE8cGU kR0gphWLtax/FIsniOmX4xDmuivt9utbzgPeWb0Tt2CHTQCxMGDPezPEhA1BFCMDf0mpmVKHte U+IwyVLkF0/rG8Jm/DzGu8hy9AHsE0Xj2jO/mwl1CYeZc1BSTXuqajYld+GqjzQKittPzIgOEg X3E= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779317" Received: from mail-mw2nam12lp2043.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.43]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:44 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ivc2AQN6yDhAZ/Odw1ZJ7+r2VuB0/qOZzaLGjnopNk5JBSPcNr/cBcqvRKYKtPFSDdThtFEEMEMFWId5g8+/lcwOK7wjrzO9uKG5oozbwSIbeUCqklr4kXeLvLaI6iFAKLiapVRbJwFDHNKvfl1Eyya64k9//rxFIEwl8e8Nfyt2BLaKF8RoTTU44R1Wn79c5TRX44oUyYhq9YY74y428YMPmgSRp5oRY+sILrssdXOzVcRwY0CuiQHE+sfkAXwrTAXx7LCzT01sxLhGndFeK7Bv0SVzdnX3z65B7Gc/GWxMtjwKGnA8A+OCp+e3K8F1Hfr2NuwbTiPX+Rk085Uj2Q== 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=ClpfWhRSFYKp1nDVf7arBAxeYy4CtucQm4R9TO82ZIA=; b=ZTv+mtvErKxuMfz/ci4DITZk75CoLKvV86Nh5d0eRfp3zkcjupiZebIltFbWBOZ3iBznyHUQn7uGvT9jP2r3LnFEi57YHI58AVSGKkLfkHUuWeQGxogzPGBkbEIcvGlZfIoC6BvQy0ubs5iPJiK+aLb63wppzaFZ+pfO0/QxASY/Psn9efdTJIvO5RgT2bNsaERCrIziQJeaUTAWQKtbhIQoBUKMEg4BNu36ViyrFybQaGTSFwdR7ku0M0kuOLV64SzkHn/24r6+zjG590a1Ahnu88VQ9tFbLbf/VyZaBr3UjctDBk0eBdTOv6oSoF4J0m8H71FB0zE6849oRut98Q== 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=ClpfWhRSFYKp1nDVf7arBAxeYy4CtucQm4R9TO82ZIA=; b=C5FdD0jhUqi49J2Yz4u08mowuBXPBg0BEvz4l4E9gVt3DJhPRCfN3OGY9SeDhLFvXVY+NnPLuyF1ckxvWlDsn3wSqkHZCgZEuSABNxLgx5hI6ODaPukbIuPNBo23vpbRaZx0rReN2XKhyP2Uq4OLFJpEdik9xT4mn1aIzIB4jPo= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7843.namprd04.prod.outlook.com (2603:10b6:5:35f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:44 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39:44 +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 v2 06/11] dt-bindings: interrupt-controller: Add ACLINT MSWI and SSWI bindings Date: Fri, 18 Jun 2021 18:08:46 +0530 Message-Id: <20210618123851.1344518-7-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09f124e8-6982-4aa2-95ca-08d93256267d X-MS-TrafficTypeDiagnostic: CO6PR04MB7843: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t/MWuWzPYJccJ7obiyoPpeZwJvoPAM6ueqWfDAPXeE/dwfqEpqSWU3+VyZ6ygJvpiBNPFYveqmrAnlt2FEOk3F0TXjxLtwxXejGGQkwoPkEJpT9ToDT21AJpb1KG/HX16bXjDSkYnh2JgsVz9jf7BmdtR/W9/DSkORjXGQf18V54hMIWmdytcc9t789qmFp8Aq+Nh+vgmHmgF/6pfjnbfpbwjJNRBPZiO7KDzIOZqmVoR+gJdPoID8j/XLuBdsSwmwCYjwYPy7URFSVVzF4MJMNvhXytzpOScJtITQA/LB3oj48pzRpxEtdckCEUABB3oxQU/7l/OW3cPDzB1SCEzpMIpmgPtHTuMNNYXJOAAsKv4lce5v2/rmKf6dr8nEpt6b6kUldm5v+nrnF1HIWKLUXPhAb7UajTZsAhXFC2n/nQZialnOXkJb+MzG6XoNxtblUZSoXLoLjzYX2eYJKGk4TAoYqrwj5uY1qhhwqrBeDjjDFoNIvrVhB3HKi+yicFG3JGPeY8cNPk/c4kAdwz38ob8UoI0mUDkKteke2uFeAaO0VwF0pDknJ8lH7XsBFU8gIYuLNGpX+E7geDAGp47kiwsHqrI9Oj0BR0X/pqUavX11dxz2ieiGP81C5HYb2wAeDqqRVu0NSCUsAzYq1vALycJ4ip8zN+rS1J/h++Jx203odeMMoQRU4JL6gNzL6NbfVftsJ6x9wOFe45ieurOshoYr0rvcKWfo/fiAnWmFKMyEYu+ZCSN7p37BAVYFIEteg49Xj+HldorW7Ve6OLDV6X9ly4y+E4ig0POIhlYPjifrpg13OAqLiY/3c2fwccCyLtSqd1pnn+G0SXzXpbVw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(346002)(376002)(136003)(39850400004)(316002)(4326008)(16526019)(186003)(110136005)(54906003)(52116002)(26005)(55016002)(2616005)(956004)(2906002)(5660300002)(7416002)(478600001)(966005)(38100700002)(38350700002)(8676002)(66556008)(8886007)(44832011)(86362001)(8936002)(36756003)(1076003)(66476007)(66946007)(7696005)(473944003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z7au5WeEYcODJlopImJEAvqt3Ez2yBI+dHD8yTo2Nli1gzBwNTSP+BYZMRHoVwOAJbVQHEJWMnqSASHN+R2r9P3UvCbe9IENFYdiMO+sfToVa2gkEpAgH+55Cupv7B2YZoP25WdgYpS7kWVo8MBqle1fWsb+6joSomvI4ylQi9E+D+IWTd+UA6FfCpoPOcQlf/I8Z2eBcHgi3hBs2gp951RiZvgcnrHkpD5Of2mHktq43hTuS+h+iiOAvVLoHhA90s88jzAE5kpdYCO0BPXndBugVZxt4scxklvBZP5EcaNQcSx9ndypJPea1u9Vpf/xjj5Fnwv9/B/sVmTsQ8F/hHN62DFAsVGnrgsrQkXaLm/jtOZyGK4bTHzXPTPwuwUsqpfwdhyr0f2xr2Q75yPZ31udGtNKfb1acUYgxpXuBTnYPzVfMTtsDylj+b0Mxd82O+bqKvsd2d41BGlE0WwRUVYMxmUtyRTEqlNRXfIqYEPKGbq93C/iqdMPLQ8UJ0ZZwtUH2nL3JY88j5mv/l75TBVa5DvOxxZ0HPZdCEZGxXTi8Loe9hzfpF47/MMNzs8xpC46EMxPDjVGemPMrlj/oTXog0yO0kGewarjF29E5euftJf0UIcZYT+1dVF05AB4Y03RuBk0HBqTnQ1bHA09Ml87dODoLzzQE6qAJ1ZbWMbP+nePpl4sTh0jfzfUYviZzAs7AzBTlWZKBCqbWVGtbYlSfIZoXwvdQhhQk+90GTohU5TOQFmR0nOgHdmij/c0mo5pzHe4BTw9cnhVDJBp0542aldJEXcFLkAA9HELplBYWQAMwCXoSy3gGw5wIR5iAy9gkV+c0AL6RGUlFigH1528N1i3zrhlzrH0VeiQyrgtRbY4U6JBSAN1yW5VfMbj0nrVky3UzHnxd79zFxmUEPxl+NnPa9OGVLjcbpDZPUaV0VlrcYQ8A5ZpYcEcWzLNWy2pkbFhQfoqZ0D8BcycAnUlX9kQFeoF95q5Z4niIwVNaYb6Eor0UWQdlgA7ilC0s7uXL9HnxWtht8lLsKETLPqLFE2jMWY6J635AfDJYsDsjbKU6PGVpkE0teaorHqAuAbY/OJUxlStcZpGRecDLWzf3EwrzceD7N8h7TBwYGLwPBBZBokjv5isPtO2mJdkwIr4sRBs7eGXVG+jom0LuKjne/8S3A8aU2nxVq0b+xlyYzYzaf1S1bC3wBZetbeiyqD2WwSx2IkWy9YKi+XMYmnxSxQmmHhyzevh05MBL5q8qgZ7P7fW57iZrlBxlxQYQ1u1eV6Z77XCELwUmwccYdylqUiXnczZL8I0nmyTp6yEPI0EnqgKZk69t3pqwzTS X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09f124e8-6982-4aa2-95ca-08d93256267d X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:44.5051 (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: +beQlTpK112/5GUJYTN3hZbH++RnzmMbKH2PA0GGzQNqiL+C7EM+4Xkz5c0XMQEg7PyIJ6HOXWQYWnobf14x1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7843 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053945_828284_C76F3CF8 X-CRM114-Status: GOOD ( 16.74 ) 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 | 82 +++++++++++++++++++ 1 file changed, 82 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..b74025542866 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,aclint-swi.yaml @@ -0,0 +1,82 @@ +# 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: + items: + - enum: + - riscv,aclint-mswi + - riscv,aclint-sswi + + description: + Should be ",-aclint-mswi" and "riscv,aclint-mswi" OR + ",-aclint-sswi" and "riscv,aclint-sswi". + + reg: + maxItems: 1 + + "#interrupt-cells": + const: 0 + + interrupts-extended: + minItems: 1 + + 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 Fri Jun 18 12:38:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331261 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=-16.9 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 30538C48BDF for ; Fri, 18 Jun 2021 12:40:11 +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 001FF613EB for ; Fri, 18 Jun 2021 12:40:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 001FF613EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=Jjj6rDsRmaLuoyBUSUO0Rg8grSAcR+0a9PVJsurtOFI=; b=p4w2CRATyQ0aae YgQF0dpSe9JBVOnUhVu4uMSiDXU3HCBJeIib+No8Vt50BD/iLSvJNQ447fJ4G5wVCN1ORCNR1Ueeh XJsiqym3xZUbwyucbAbk3T/akjnCw9SyGDKyKUT43quwObpPdAnrkyXWV7WjGUcmHr83cDmY1i1cq EzR+Y5IQbrjgP+nS5xkIz9byx1I5veMXS28E3yOLq4sqIQsv9KHJmVeCI6l9z+lY7nmXwiJ+16DmK BN0wpS8H6DOLw+4uob/PGNJIOBz7LLIqW5ZdU5Ufg0t5H6G2rvtUDRP8CO2zZW6DCi8CmbkQdS7i6 EDEMzo62qMxAxfalIWcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDmr-00E30m-N4; Fri, 18 Jun 2021 12:39:53 +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 1luDmn-00E2t8-O8 for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39:51 +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=1624019989; x=1655555989; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=cUtAcaxw/vl0L7G+naf+CU6xYedTJ1g2K7BxRCZLed8=; b=F9sLsJ+an5zT0kSuJIHX5bFz7VXFliCAd0RJe6WHNGeBkOY9bRWr+iWx FeJU64u5lMOY/EXdWyl3fIMUYavzQ6BtnhajkHGpTFkO5wmCplLh2DR2o gOYODW2dYolRylOT8tNT7dE9j53Is58caIUIWPLx87tPSppFW5Woul12Q 0Qk3vSXzWSqOlxjF6RzqQDjx1Qh6Ixv48VEJAm1b2aixcXD8CqlwI3bxf tUrW7mQlYrUYzFZSbSnIPPVEq4TYfyu0fp0eEmi+z+EDMePdUaFvSGX19 6X1xtjk9h3XqmO0WOeBBqX0Xgy4hqRKt1OuunI0LbLsd04qMwizDTbPdE w==; IronPort-SDR: iY1qiU+xtlS1neT9oKGzwOwm7OUxQBEtpGZ5GOBsG+4GkIvx2Crn6+l2J0P/4DA+8isPqtsdeP d5QDuTDl9hBfgYcI39rXzkmHBv9v90wmYfFlfviqZMDW+1yz4GVzLAImHJH5LLDUqmuSs7cd3w kmQWoMZbx2dwZX4PtTy47V/FK1Qmy9oa8hI9KrkKsDYj5r2f6hjcQrBX+pPmO0FhsP4Z7dCGcR 7A71PXoaXekXliU0EAf8zMckP9GD2RYuPXewTjuQSrIutS7lQfPSaUNTxwFl9efPFRl/cJhgpO Wnc= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779322" Received: from mail-mw2nam12lp2043.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.43]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:48 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bz6FkcnczkV7IgC46VxQgQo9HkiffE2/i8NTmOX532G0jTt1ffzJVT/CP7E6xl3BOMWINsdhVTpyE63nD2EYYaLXAAIt8f9sQzGs1OD3ilBTiplpPYdKk/98oC2aJNZywXQkXd/rS2c3moRNln6wAwUykJdk6qSskNA8d6I0d7aC9xlysgQj/13XJcRYofuzSHDVd4pVdfBnniw2eZXuErRazRVEq+mpSz2wuJtZW/Fkb25R4KkoZ20ubH2VXDMrkOJxGg8aHPLmgJnD1eAwad/VQAte35WELuhCOWFY24QEi0dR0987IccRCO0c/2ufGpbKZyBtisEMib/oJrt7Cw== 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=Hw13Y/8BtpEkFPeNtQEZL8+MiHxYwXx0UYW802EEfj8=; b=OwDhNnISFndDKHLC+UXtKt/sPfzpGTN9JjL0x1CbCkl4PIHhEhhYyU/nQEh3KKTmrNnwAQvc/RCb+NRYXB5tRUNZs96EsqZUtYYUULAW+XFnDfL00V1xxpOgJ2pOsxJoX1vRDdkbaad3p4fHoL0hgKQ3qihFumPLfr3S04exFIL82dpjOOp7uFR14dIxhNdePQKlJdv6RlTEwhpuFlI3Z4o9GEQpxZteSQVfsTJQcWCYtgay77xdeEa0oVXIO88XrntnIa31xD13kLVFL4oBSd5qG5i1A2AJ24VKB9qQWhvl0y6b74Z95DYo0PqxsFzszvnIjDYsKalhyubwcMx4YA== 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=Hw13Y/8BtpEkFPeNtQEZL8+MiHxYwXx0UYW802EEfj8=; b=XR33oPpjSRdlbauBt1nMCBFvav5N9P8SMg9VCcnSFGXAiYimgXdwMJa9T0FHQlz84vlAb5iY2mv2JFM/j0jRL/iP/fmgrHbAcA1TPVdlZP7JQEUFJY02iZxLBbkyx5wZIVBetyIoJftbCmEZmcLl1MqRmT4XH9v3MQnSho8WDwQ= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7843.namprd04.prod.outlook.com (2603:10b6:5:35f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:48 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39:48 +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 v2 07/11] irqchip: Add ACLINT software interrupt driver Date: Fri, 18 Jun 2021 18:08:47 +0530 Message-Id: <20210618123851.1344518-8-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 059d1cd1-ee09-4f08-6d03-08d9325628ca X-MS-TrafficTypeDiagnostic: CO6PR04MB7843: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qYceKsp0Ytuo2w6GCtR9FUs8Lz5M3i+01TFh3A37wnRuN9COpu2uYSn4pYlbOxP+9r45HsuuS5dkmJKIOJiMvfg9OWRvbu7tqtKgmkoxKjLYoxER3p5LNdd9q/X9gNIuJrMmCW0eu9dVEZq1CB7y7ruCxU384kjBiPsGnxrbVhxctZMST+kODvxf4xyttvbpNKbFeGQdJf/f4JQc/V45L69oatgdpVNtZWKe0FSoQsHGAtqFnbh6FVxjhgqVNXOxD4QiBcZdbjluL0kh0oldnZPi2rsKqq5KxCZ73wTC+EKBkpmZB/1D5NC7+rCklXYi5qD5gXKxL/CiTpeh23+rHujAPuvkqyEuRC8nhqtnqknuNb+5JSGpLzcmbqFlDE9nvwbmHb6ZGzkrhiqJO8qBtPRxSpHURxKK0EDhrWXrg0/+ML+3IdDaQyOdfaZPfUomrybvWbokW69IQgf5it2ENr9EsKui2x9XtMPjmVFrucxNDlrf73Jmrf+nxFb1AvlTvOlsRmv12TySrsGyXr1kxBfFxcHa5nwYNdvjM6GRoCGTPeR/B3zTuJFa0rDv1XCb1/scbGVTTZJuVEFCsYLJlUGhgtjc8f0MZa6HsDvscQJqZqE7qnsOO0gANQHUigru+O3DwhYi42NCS+GyDuQLqg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(346002)(376002)(136003)(39850400004)(83380400001)(316002)(4326008)(16526019)(186003)(110136005)(54906003)(52116002)(26005)(55016002)(2616005)(956004)(2906002)(5660300002)(7416002)(478600001)(38100700002)(38350700002)(8676002)(66556008)(8886007)(44832011)(86362001)(8936002)(36756003)(1076003)(66476007)(66946007)(7696005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BwsX+XoR/fXHw6JRW8nFx7KNUfJcVChXPiVH7nwYP216R0EuTV7bP3bLuCeaiiVfoF2LLpba1mKVaLMDuqiYFwIVo+XseEbiL8EAvbe2vwGXYpuSdxgN3PbEioVGHA4EAZxnvDd7dz+C7mCPfo/2spJt4uDwV+6OCgMpvm1oQcAQpXJ5kAAfY7aGbNUUY3oCiGFx/5Wapp4rnCKrutwlOmFp2nKS8xyeyUDQTea8lMFDqzw24d9PQi86mbihrWVi1vg8csw74cU2UnqM9QCfXkjhJWWpR+CGXZZpkOTY6JHX4N2ziN5cDrVMxYMyxqD9A6ish09ylnZ3xNK4qk2eTHPOE2Zc+TMimnUg2vL00FBhpagDajudacS6Tcf574Do2w6AdRftW/p49ep+fbJtHigbMGfIbLFDHPOqpKnZrr3xfqwws8PMGGlODhsLhSYFxmo3uFDuSSV7G5qrYyzW7xlW2NfSGZat8cipvo+nWgA1vbFe9/I4MLkxbvtzUhhdbdvnJqzn5rgF4sKsaI3G7UWvHBrhojf1ir4lXl1sV/x5Fn9knLofEsompsEyhK3rpUrYMq/YaWkTx4vk77ERoizUv/lM/GX0BTJuJmKpITc1u8aONy91nXlXXKZWgDUnVYFlijayqOv2S8DCaCxS6WaXaS+PJYswql/G4zzs1zv+Wt+Bz0GhWcJGQV4sXacqnKyQBiuVT5ZQh6cpPj6to112kk2SCkjzg4yo2AuIPWhB+SfJpxFBHhxtQEL9sBZd8DNk5rOiDxS2ZaPIB73UolvnAdlTy6FyZFic7wI9Gz0L7th4HvcwXAo7ABy+laIZ8WstC0ETTmw2bVrBiHYi+4iVUN4ixKxCia/5NwHLBQM7dmatcdzPZXDK4rdNe3pMLcjE1/FmK6Hhw4sgNyLuoTtEHSYDIePh2lo5/JpEAX5Vg8UXJfEmUMdiWSlmHQz/lbA8rihFKHsjJZNh2y+KUZ/fJ8NklnkmkrHC4Y0Snmf7n8avnNSbmpRBJ7zOXahIS+mgBHElqs4cpYlHI/PWSKuigvU3/LJRYCHpqrtmzV48dAkbsgpHLGc06zdqbIUTUiChM/XXfEUMfTJdpNxItENzu7uZTlyEPxatX5TjjEGZnLmbm8Ft7AMJ6rrlpCEluMJldc1gFx2kaOrbJ7OPmik9HtQ2J989mqRjuQ831Jwk8YSauQye/xy1OhWIVxp/+dz943aLCSSpVNuCCO//cW6YQ+8E7mFhLQFBx4sD6y5voGphfjNQSYseti36RrFHDlL7qmjNF/C+7IR7I6O2hkaR9nnRQwnk0McwxXsGdy/K5Fk/ERJhWQkVTiN7RwMP X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 059d1cd1-ee09-4f08-6d03-08d9325628ca X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:48.3761 (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: dYA2fAHlhjjMlfbrE2+Lg64/qhrI6rRV47dW78Y7G4teLNicFcuxZq/fBYoFWivrFFQe/6BBq2AfIGX1XpQZ3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7843 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053949_847313_12A64AF8 X-CRM114-Status: GOOD ( 26.23 ) 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 provides 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 | 11 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-aclint-swi.c | 271 +++++++++++++++++++++++++++++++ 3 files changed, 283 insertions(+) create mode 100644 drivers/irqchip/irq-aclint-swi.c diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 62543a4eccc0..2010d493b03b 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -508,6 +508,17 @@ 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. + + If you don't know what to do here, say Y. + config SIFIVE_PLIC bool "SiFive Platform-Level Interrupt Controller" depends on RISCV diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index f88cbf36a9d2..a6edf6733c1d 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-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-aclint-swi.c b/drivers/irqchip/irq-aclint-swi.c new file mode 100644 index 000000000000..a31a7fc504d1 --- /dev/null +++ b/drivers/irqchip/irq-aclint-swi.c @@ -0,0 +1,271 @@ +// 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_mask_unmask(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_mask_unmask, + .irq_unmask = aclint_swi_dummy_mask_unmask, + .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 irq; + 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); + + writel(0, swi->sip_reg); + + while (true) { + /* Order bit clearing and data access. */ + mb(); + + irqs = xchg(&swi->bits, 0); + if (!irqs) + goto done; + + for (hwirq = 0; hwirq < BITS_PER_LONG; hwirq++) { + if (!(BIT(hwirq) & irqs)) + continue; + + irq = irq_find_mapping(aclint_swi_domain, hwirq); + if (unlikely(irq <= 0)) + pr_warn_ratelimited( + "can't find mapping for hwirq %lu\n", + hwirq); + else + generic_handle_irq(irq); + } + } + +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_set_virq(void) +{ + int virq; + struct irq_fwspec ipi = { + .fwnode = aclint_swi_domain->fwnode, + .param_count = 1, + .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 SBI IPI IRQ domain\n"); + return -ENOMEM; + } + + riscv_ipi_set_virq_range(virq, BITS_PER_LONG, true); + + return 0; +} + +static int __init aclint_swi_domain_init(struct device_node *node) +{ + /* + * 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; + } + + return aclint_swi_set_virq(); +} + +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 Fri Jun 18 12:38:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331267 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=-16.9 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 46D59C48BE8 for ; Fri, 18 Jun 2021 12:40:15 +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 1B56461369 for ; Fri, 18 Jun 2021 12:40:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B56461369 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=L6yvGf7bpjKyCyfVlle0rDe3DWBSVJxynrrloLnKVBo=; b=MZUgZvfTdCbPab V1Ob23pgNSNs0DqHZnMPmBTZKuNZFEeDYn+zxp4KA/JJS4rJ2PT6zA6LMNbx2uL5emdrOJYhzEPOd vKFioh0Vgn3vp5O+ClSknDRczYqf0Zpfro2n4CBXrpv3cjyJYbs/HlgPS6v8E58X1p5EzyZ+/84GG LA27Hm7qN+30NL+Is4W2JZt+CgN60C/DDgtDmKFHSJOPn0qFHQVW9Y611OML3PAa/9qL520jDHu8H sikvpyhgRSB9b4P9vFs2aaK1xhOTolQ53/fD2OSyA/2JO9/9c9NGTohLitLqqGktu2icFxXWTCCkI xURwC/knfMGo5JBTECrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDmu-00E32h-MK; Fri, 18 Jun 2021 12:39:56 +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 1luDmr-00E2t8-Ro for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:39:55 +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=1624019993; x=1655555993; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=4QGixAxKfNfJ45oOm9bBDY2BI90ypMJcRJGpkQd0iZw=; b=re9Klrx0YCQslGrUc5YQ0doENuqDTJUKd9cD5KApSnrIYwZGTNoa9rpj 4WOr4R9CgA96ivJ9Wn39K4BfsJsXAFKAS4f6gAfnUUe2z+JesFeAKFQKs o7X1cAqzfGjcOsRZz3MJTfTJLSL1HB3LaRHELnFwF+e8oLCQ/3Cz9NGR+ /tS6N5ZLbz643Tx5chWyLUpuDJ3++nA5JlRrIWssF5hAVfruVSyG5rX3D MfZapmbztZ3SV3nX3WhpxFnBVCBb+b/XuAncNJKRK5Jd4dIErBy1v7BOW PjZ7gUi/oKOexH9Y1QH3aeanoSWcvyL1IrxP/jeqQBtuoesKYmZ7Yr07L g==; IronPort-SDR: wacPq2NrmilYmMla+WFyBheiHOmyCUhxi3Fyu2YLYAq+2TwW0YmFw9wyTMBmfElBzFk/9BMqU+ bw7Z9ExDOEL/RW/I+4eKFYv1FiNxKmrwzrBVbM0NIoEwf8Sv4bLQDMb9KegvvzDZRJ7VIfi+wZ NnTcTJSlDfB0+BesTolLni9iPIfkjGwLliw1ugF10cwn6XJp3aKr9WO8ShpJ09QvCk+JadT+Ro ut4w5WLPp6WzBo1rw20WqXJX/tYv4zOGwB9oRR84jIyjeV0OXcWO9izrR4HZ7piBk9DJF0tQsw UbY= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779327" Received: from mail-mw2nam12lp2044.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.44]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:53 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fUo1OV7LdlGAMJyeKTpCfIqOOq3njnY3etNkmetTcepMl4Yo+tHDCFKf8xep0FZWv3yfkyjL3D8C44JHcIfYwWnGlOvIYWDsDurf6IUltXoOyXb0WWVgC14pQ9wjT7srhiiBH35oB7Tq9KHnrh+b7isATYj6OK5M5KH3eWQ6evEPHhfOL7ViWKBZ0sl7KcpTjBt2hDGUSTt6ikHkutrcBh/GVaSoFZUyPTm3QTQuRZNGpVtG5ckgIHY/hWREQPZ26CnMp1FqNB12e76sFfIRyHUo+cuQFGDL9qGjZZoiJsH8ZSEvx0dgCbpAMtnMS8nTKwd8mwj29wde81cIlOJLmA== 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=I5sZWcSj5FMDDPI6oxiWpnILTTE5i3vqneR1JZHSCf0=; b=hiIQd6MRWU96hWmDIwEYC3WcLuyiIpChtiqiQEWh+CdJNY6HZUGE/KrvNvplCtMhQEK1rpAcsgU0Ai3vvE+9DBnEInFPa8Qt4y14OYBILu3bZG/anh8Gi31yBAE1Ci/0a0ocjeJY6HNkr3H2t4PqHpRzb9OSXJedLbs+wFsLHZWcy5ghz78FCQUg4EJcsQxMs1CKQzTKwOIR7oI9TRrvG7hJ4pKXISvsBv5S5Ox5iTLkonrSTF2AS+kOtNQFCKuAsMJNZk8oMCEgWcEZwJdljOGywcq+mLa1t0MOj+7GL597r09zrOK5qvwb2G6430qY4xS0FlMrEZquGWaU/hS+RQ== 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=I5sZWcSj5FMDDPI6oxiWpnILTTE5i3vqneR1JZHSCf0=; b=WApAtmEh8lnmf6D+W1BpnKAEofaL2E00R8qRFgae1AAsIBDFXTGPz1ukaIcuMKxgNmhsd8JnQYysZIZFnH8jsF90rekej321Ywsw0Ui5dExdP2iuRKHFc/d1OfHwWZtqQjzPsV5un3Yv+jQRBrWzLiJaNtEF7VOivh4AwhgcLbA= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7843.namprd04.prod.outlook.com (2603:10b6:5:35f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:52 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39:52 +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 v2 08/11] RISC-V: Select ACLINT SWI driver for virt machine Date: Fri, 18 Jun 2021 18:08:48 +0530 Message-Id: <20210618123851.1344518-9-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da6f73b4-b84f-47cf-1b35-08d932562b36 X-MS-TrafficTypeDiagnostic: CO6PR04MB7843: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JHZhdiTymeYXcNScs7MOWxLmFEdswu81nLg/Iwqk/+gNuL8fv05AuvtWFQoc/hk26rtD2x9ieoLDzTThQzom6c+nd9xhTi5CGzrY2IcWbvi8R630aFhGAmUranyymLgWjqTvyO1DogJVUgf0wp6x/B3g95wLFYeAEy3SUT6fHpW1aaFZ3H7FVZUUqf++WEZ2JCtm5RF9C6cVWJ0pOz3JSupt86aYhQIpgqXczKQcGEq4+h8oyvr2mpyXEEFGw/pDPo/+wElD8ACP+UvGg+EUStJoeN8hR2gW4YJss6CYx5cDkXA6TFYVnNJzQf9qE3U+zLMFL4Jq6cK6QFHJ2vkqYG1rWCLaDCa35HC3xpVtJZGa41lnRd7t6zxJnprjhUm4r4UFVWHf676o6UVOwM80EC8PQkjpYyJvXxjzJ+5F+iBarg/EhOwd9PK9ZwYkCuIfLhXuOj7OR+McjUOxLZ78AGhsROWfNiactoWqRW1yWfcRw8VcrR33e32/fGCpbgS0EhVwtipG69nZ6VXyGtOGmUzFtqV9xup0zCVHyfPbdY9fcIpT1WwVfgTQLFb8N6DAoLwOORitsN1KXMT3i3MmvdBWWaqPJRqTQHv3c9UWrMtVAWG4F+bxVkqflpRPTjmZbnrJR+cVEH1lv4uw1R/Wsg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(366004)(346002)(376002)(136003)(316002)(4326008)(16526019)(186003)(110136005)(54906003)(52116002)(26005)(55016002)(2616005)(956004)(2906002)(5660300002)(4744005)(7416002)(478600001)(38100700002)(38350700002)(8676002)(66556008)(8886007)(44832011)(86362001)(8936002)(36756003)(1076003)(66476007)(66946007)(7696005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cpEtKf6qgOoSlbVisfQyRT1WX53uRhBco/AI99X2+HqU3IacU6/WkC+fr1cRwQVZYshz8jX0MfBtGYtnVH+VtSA1hmNJMd8B+bfkUHRXtIKYTnQKDeNnCUhm731uat1TMlOsqij60nReMj3+anF1+WXj7etngpqg9qhdv8DC369bToBkbS7Sr9cIaGQMppNYdaWHrXD9znSs+C3R8R3XpOfQRAoTc2YJFAiqHGFSbJgLJvYRO/Huk1TfAMNbcO2OWuqNsY4gDZLx//BdelVUqucyuufDQFBY2YyIrA7a1pbwonBBuT89JMCOVlb01BlE9MinQkdoZssDYA6fx5HsKbNu73feYPFeLFJYiEiufY2zCujyxAxUX53IS+S2+eXa7T35VTgxCZYBrGH56KxbKgsCKSnC2vs7l7OkjJnEUlEVZt+CI8KD8aYUbRlWmhRQY41uyrBLkqp1yrmLKmWddckGc7FtoN7HHPVfWRXf2SdTHx7ByPIivL9Dp95pyrCSBV8Vnx4yVtmVn+HFYtX5CneTqtm4JWmEsM8JopbYLhk6cJlBC4nHoOW3tWJBQ5aNx2vpNPJuKWOqlZvvgzLIJfSxrF788KYPkkEbXCdk6mKOj1K3shCdaI5Y9SpL1vPJNaRNlcanIUCVpPz7jc1XMeQIZcHk/O1lkHnrR2srwuSRSexIzmS5Hk/EbQdT0UHIsfzkvhBMb/6HfUXPaWMJ9OG7pf+Uk96hJghJKWS96gERRedrKOKLlYkYm/0d/lYdcr5Ajl0rbZX+bemOuSpYETlFlnaANBhxnVBn7mKsv/P+tKlm851gq+s0PgXyL71kPvC3lGp3ML7K1vlyirsfxAGpvsx1YhS2B9ERMsCR2ovWvR9dtQ67PSUOmIL5HSd7yzIGeOAc3TNMN60b0c7irMMmSiDoNleX0XYJU6iwwBWRrqjELAAbkseEuRQjHnbZ09KcS7uHCTo5yAtiY0wmI7lM5OyKgkBdplVXZU0EwybiSbQmpRwmz0xIB4muLRaCDlevcVIs9XZ5s+i4GBRx3oXSOkGkPP/EhXC2RSKLelpG/u4hJU26n3rhaXR2zaVi0Qblie7/wmf0nBKzxHrX4jQYWQoaHfeefuoiSysqSr1Be6vordxSAMp0me7ZJ1qX2E5HX8/Hb3RaLiaClnrXDTix4C5tFStuWhjbqGPtworul+mJMdox4e7iiw0o2s0wB0sgNg4Ja2grzPHI4htDxLt/694nB/sqttC7jczCD632V+rKdtHnPdx/ZOsI/LMV57k1dFmT9wAhcqgQkK+BnUTANHpbH4IZJPyBjwUo/vB8bkEO+TjbOokt5FXPtmAK X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: da6f73b4-b84f-47cf-1b35-08d932562b36 X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:52.6175 (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: d/zigNe4xzbwdgT1jrR1dinUG4yjXmpnQzNflKK2i58t6aB66ZQWm0SkkbCqe42YTtRBqxPR0X1Wk3h/athp9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7843 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053953_957906_4D423292 X-CRM114-Status: GOOD ( 10.57 ) 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 ed963761fbd2..2687a0902ec4 100644 --- a/arch/riscv/Kconfig.socs +++ b/arch/riscv/Kconfig.socs @@ -27,6 +27,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 Fri Jun 18 12:38:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331263 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=-21.9 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 83DD3C48BE8 for ; Fri, 18 Jun 2021 12:40:11 +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 588A1613EB for ; Fri, 18 Jun 2021 12:40:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 588A1613EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=Pe8e6Ssp4JSWvgMv5qf+DjwRYhfadhveljrIrsblmhQ=; b=sbbBS9evVjqjUX jQxnpsrHRMZ/O2nQkbTLzTLhTw2Hu63oNWHhvUPFSjfUfb3Q3F+c+xs4KwYgTfpSxOaFQjzjPjYTx sniFucLHAiDr5va8H62MWx4NdkZTdgxGYaKy9pTEwlACvOujvgkZfZJIaVKW4Nic3qGxIUshv1dtN 2gVewUr8pD4yV4UVCXOUFxnZtaTO6sg8d+XuwHdP5Amm0RmU4Q4BsZI76tgnb39TWpFCMIPfqKrco Z1jpBQzkufdFrRX6YgUJ6/Hof8Z6oETFo6/NI6kARP62AG4Fj2G3QMCbjjhmDD7kBBsJ2erBlRMqh NMb2h5+Tkc65f0bBv+HQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDn0-00E36j-Pi; Fri, 18 Jun 2021 12:40:02 +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 1luDmx-00E2t8-JV for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:40:01 +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=1624019999; x=1655555999; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=DqkClFgqsnapo7ExFYeqPGKwbgwciANsWxvz9W/SZlw=; b=ND0lbkmTyFhQoBpmA8Cb0wqXIiWOChBetYd674UKlCJw50IIpgjx+cE6 Dgps7gHLdSZKnrWUQNpD3Dk7YFdqQzd9qATemhhBfIQJF2d0KRNMZlDib SHoREmeEKeUzNy1Jt+aqzOATHfDYfVnbXTi1zwQok8wyXGZww0UXJFvwA mAp1LeG1O6RHVZf2dEWEWjwBgkDusXZSzNu9Y4mYW9Y2xYTS0ijO4VJSG +nj6bQv9a523/jg/8DovTHyFs5axRgFfXSvwJyK6bFvBtcHBYKB7wRIEZ rKxsR6mjET93fuws1UkEYrWh6fyRBwtxZ8ntilhdiUgRULYQybrlkaIBq A==; IronPort-SDR: PG1dKjXCjjZkAxHisfr37kwSHtoUp+0By62Uybi4krqhgb6a9giuRStBnsBZNy/u3TjeJkkCaa /x5Bwf+RMOdIxKzLBZFoFIJ1j3m8rCt0MJPJjmaxmk7dd0fgzjiDJxJOGyfGS32V6njv1zd8nB mVqMbbRbbjHjxRzh83jQam8PqOBeC8CJCf9C3pCZwc/PxJHv0o/AFG7I8PMvo9HHh8ZhELFYy1 RjzkTm6V/NmvTAojK1650nNkqz+Cx4kKQWojbxSdOwo+rvIAyjm6PmJl4FccRrUphWRjv2M7rB t/Q= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="283779334" Received: from mail-dm6nam12lp2171.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.171]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:39:58 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WNfJVRzNhSyQ/fz4ILyXnh2Jbq0G3a0f5TsNOm/8XvdzCzU8tNr1101wpsencdenAgCqAQLEVfxcV5rlhKdK21UViCZOiE8AHNBEozwgGZvNg1q8klGPfIy08a/V3HUO0rxWlYrMo1uopuEpZ/rXyBc6/i3zo/pZFL71x4YAeYkikeFHNHTq28+kDjU/rrZ1kcFgXIBFgHlmxUXv8KlD360vrsRoevs7juNg1o8oy2cp/gat8KJKIsyjbhWbdGajlxKFR/5OphXSX8hkJyIwLjVzfTz6NR4nAovToddretpRjVqKqJNIdhjwS1HxCtkGv7Ep9FQLrQbJBQ/1/Bs/Cw== 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=yGezVQAZvFl1pf3WlSCvFL5HKNG/bh/KgCa/0igADZU=; b=fBAvr89kwyyqz9yWAwsWSOd8QfcV0wFHhSASGLlp3CzCVPwDXng2XsdXepXycyuVleHI0fweD8VSRdFLDbvl32dz4p8aeV63zGHQ1yRpeMdZFwS7zruFXm4v4ZbaHRVr9Ex5zHbnXQkdVbdoWV9TE/bxv40yrm8EvSiPm7+sXfx6SpI0X/bCpSf8QGaaagLy2r+3JeZmTcpFQkFdPiLFmppZkZnleBK3r8jaU2V4luJQOasN7xOTbfxHq9bJPaL0a3StIpeyRObbGzUaVR2m4TvenpDlEvz8mPvljKa1uyDN0fxLjdvuVtirv7w/EglRQePzz9qLLr1z+jFPvpXQNw== 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=yGezVQAZvFl1pf3WlSCvFL5HKNG/bh/KgCa/0igADZU=; b=GE1egMcJ3IMcitvTCW1dM3QmFOfD+pmtU30n9UOtyCAf8iR5cbH8hchBZ5xIOE358wG6mCnkTQ2yITZsKRhq+J1UU1SYuDS6ZCId+8OwZBaGW7Nep2P9rt/3VZ+zXJeeTBpHq2aNREB3ig1wKfSn8ic3SUTy0poRKIyydNxVVuo= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7857.namprd04.prod.outlook.com (2603:10b6:5:35f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:39:57 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:39:57 +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 v2 09/11] dt-bindings: timer: Add ACLINT MTIMER bindings Date: Fri, 18 Jun 2021 18:08:49 +0530 Message-Id: <20210618123851.1344518-10-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 500a6c3e-0a3b-40b0-275e-08d932562dfe X-MS-TrafficTypeDiagnostic: CO6PR04MB7857: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mzrunNa8l4B0ptsU5G8bjndQuoWK+9x/B86CMnFtvp9/h3NtvClPInc83QyG6oa7xz5kI/qFb0MWj4DiVs8Ra/covRDUPdpLzUNzNxU5F285mxPautEtn0Y23C67oFGV2uHeTSmjtXN2akS49ukbIjBhSdnASDMdUyfnrqqeYUsHZ2d0r+1vHNswhTv1758gcg7CMSN2hcr0IP+Rw4IpwlzVpUNOj9kNJw6Bf11ZcWvx3HvrbxjjYE5sbf1Pjh5ZeWdV0UvrPpLeEYx4kQDblhWGM8VZV+FEBvExxEwsQcOWH+eI+/mUIFFkbLRoGrY1vgn7k7hULJ7nLc6qj4uNoc+Pq8uJxT23JyWyUt9z+POFO57p5Y0k9+4jCJFD3EhDxIDjP7czurfwMwq7zwRlARjELzstVQ5wue5d8nd9vM0+VCkbXL21o9h+bNCQzoQfoO/2bD7tBttpXTxgoZvhifYNH99K8ssnagC6GQJX2/ZUWGhBz4I9bKgYmc4Aeb1iqbUwYTvDFX4jsnzCPkO/37vg1uhonD/4P1Z/9NnJtcjMT8j+FcrYT52wK0fZfvBHR7My2yheieCxu9wdnx0a6vsK4syPpWYMZCeAfc1XXD0Mn9Pg+A/fPfm1WORzUdbKzFLA0HraRD3h+GK0ytgn9ZPCN9L0SAJULP/unL5KwU7Wvv99RiZXJVVl0GxruzBehl6fTCRaba+Q4AGsD6tsldGTlUAs/gI0M2bzyh0D9iyCBjoq+w64yJ2fbFlPRiYkh1S9BginJM4WtnXXLV4IzhQ2ooVXkifh/8M7hwfUekDEoOwXAlnGJIAqfceFvZO2O/LdZI3Mt5g5EVMU75BmnA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(39850400004)(376002)(136003)(956004)(2906002)(478600001)(316002)(86362001)(52116002)(8936002)(44832011)(2616005)(8676002)(4326008)(186003)(36756003)(5660300002)(55016002)(83380400001)(6666004)(7416002)(7696005)(110136005)(66556008)(54906003)(66476007)(66946007)(8886007)(38100700002)(1076003)(38350700002)(26005)(966005)(16526019)(473944003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ECq07MtUIobe/q67iQBKBfbLSirp1RzSNmg00hRRjVLNw6wRDIOV416x0vqYy9k3/c3+dyHyJM7EaV2TwFQFWukBb60uWcbdP+CJFFcXPi+mLqT6V1o3jSI0Q5yEqPP4tIkfeD8uuGmRs/ITxCu5zp1jfQZry7f15XMmxJCzzIkgp8dlU/BNcAHGeuiyxFSIhhUqahUVEiFo6v9xgATLk4TvpXXbjVCyFIZ7i8EdopuBYK9JQPgr8WNhP+nLr5ZUy3bMj9Tp2ILgeOGQIuZYvkAYt77qUyGRcvlzuUEGdT/hWf266OE6Tf1xywcsgJ2JbUPfbcxo220ket8WQbEG7XLQD/oNm9zgZ3ID0oCpUJnEfgqw4ejoU7sdZYNjdGlE8HYgWSf4X+Q496DpeeTOrk2Ew8o8lb0KLJrHWDzH1+ZUSaVrMaSYuq/92FUC/VhnSJn0DBNp6j5TtvwZix46tyH+Y8SgsHfzNdLleUeh3I8k+WpV6A+WVbYP5LMywfK3SSqtSfNamY1J+Bx9t9COB9i/xHhjI/zEUASlbpE6DW4fPsxXGdWV9gTIsap0MCjqYQdlYqQjFBOrsh3mfK7jbLIT/Em/4qDYFcuNYUMy/zA9SYNfPTCLQjGvfNwgh4BMIZ0ZJLZdEW1M0anwpM8gC+wah99BTFsyMHDGqcaDGBwg5tiTtC0sSFlZxSzknpzAYCMAW9uCbP4u3rdTRQERw8FevXTrotNwXW4u9tdEjS/kfsEG4hfQQDe+PspWOHbyz89bfCoDUcFWc2vja4bsAaKpUo3NoRGjXzNNLtMm6bGjtGdiaNVHSZecPbj6jzHZr89baeh2JIQprmaEKE9kwbEUHWdv25/py5bGcWm2JzwmpkYWB8iDr6H+SDFcLNFSyix9szNNkuqrGz6AM4OV+OJeX7hZiOtbs8y97t+qJPMzJlC6Q1HH7xgaOPJKoB/uWLKNv+el+Qq9ZWCdTJY/fieterujjVCrkEVV8hkS1nDhNPMGcIRfyUcNFuh6Xfn1jCAT5C/BF7RUG9t6li13Hz+K8JUuTB8FgX3c9V/t8IOcTrvV5KnMPhziFJkYHfn9BFvAXfgIrWzreuaPB4nrwlxv2Bp2QnJT3Kvo7BqxrvBsEdOh8tqqYiTVRAleon77KZA/fqfyo9SdOKkDzm/McrtV6uwfhVs5oFD/E8jkCTkqOKN1uBPRw7jqRx5A1nNi19941hftHac2yD2ufSgiI5vKEgJHbfmQ1RYe+2z2TdvVt/8CHWKaYN+uva+s1gsJvAwTR1OwUgmOL+3dIGskvQrlukl7OTOIDdE81HT/RbWmz2r+oNikqR6O5LXpN8xP X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 500a6c3e-0a3b-40b0-275e-08d932562dfe X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:39:57.0828 (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: VMfYPaFH8Pg2B8yLlmCDEjX0YsVNNajwKaGFgyP4C9Xjf1ZLEIie9ue5YD4PFnCdRPmy3XnzlFWvVMTIdiyfTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7857 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_053959_697995_936EFFE3 X-CRM114-Status: GOOD ( 15.37 ) 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 | 55 +++++++++++++++++++ 1 file changed, 55 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..1f467c869d44 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/riscv,aclint-mtimer.yaml @@ -0,0 +1,55 @@ +# 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: + items: + - const: riscv,aclint-mtimer + + description: + Should be ",-aclint-mtimer" and "riscv,aclint-mtimer". + + reg: + maxItems: 1 + + interrupts-extended: + minItems: 1 + +additionalProperties: false + +required: + - compatible + - reg + - interrupts-extended + +examples: + - | + timer@2004000 { + compatible = "riscv,aclint-mtimer"; + interrupts-extended = <&cpu1intc 7 &cpu2intc 7 &cpu3intc 7 &cpu4intc 7>; + reg = <0x2004000 0x8000>; + }; +... From patchwork Fri Jun 18 12:38:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331269 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=-16.9 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 CE942C49361 for ; Fri, 18 Jun 2021 12:40:17 +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 9EDA961369 for ; Fri, 18 Jun 2021 12:40:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EDA961369 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=5UjMjfJPObuy65GN92AFfXgyNo67kYy/g4k7Ju1hTfY=; b=GS6q7jOFYezbiW I9Fc4CvJrWRv6e8/qS6Msz6Z8Z0JWh8Nu35xh5w/7KtgcV0Xbq2D+l1tGzwKH/EBFJjRIDlG6lrns U4qKbJey0XYC9dSO9ptM3SLP4K+mA49qDIXpM/jrv+pyN2gc1s9Gl1Go8727saNAG6pZuaJ63o4gU r9JJT+hHrFwIfuefmzgNEP8mpKevBcyRwioh1e05+b1Dwz3q0a6BVLoJZBFHh5N2u61slSu9tdjIL muIMu7lrG5YsG69esLkHJxWAkaMDz9Cn8MJ13ZD/39lH4MMbwUixwotp6Jzxlunky+z1SqCiTvYqP kdT4EDlpPCIcOjQ5R2VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDn7-00E3B3-Ig; Fri, 18 Jun 2021 12:40:09 +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 1luDn2-00E37h-3E for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:40:05 +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=1624020004; x=1655556004; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=c8/hbVoTzSjTBkRASUPN42Zq6fdqrTRmRNdTUO0cOSo=; b=Yg6+uqxLcB1w2ELXifLoztDZpE7uDhKSHzBj7Bu4H5SgfJqNPFkf9yST HmeuThgqsY31qHYEjBfO49JQ4xn6w5eLvxrzn1fyUR+UPX6xu1mnGxuwB zcCpZIb9BXugopxfQRVW3eG0H34FWfoE7SBMpR7iorlGFDOJg/tTCmae9 /m9teq8XTvasp0bYnVTW/EQFaVEG+gsK0f069K5H0Ts53YAY4IxSJHxvZ 6aQmCnYortbHsieuwzvXfif8eXSyXw+JkNJ2+JlTR0YPEmrDLjvowja12 twnPzrWQbWtXCE6t8Ii0YrTug0flT+1uxk4//mDrxT8IHiOsAhNRb8NUm A==; IronPort-SDR: v7FDZHz+Mtb/p9F4I2KQIHTiI8MW0MIPtPBk9/vwjpqkEFKOMhXCt6wPjR6bj3/upLaK6RrKsg roReHHfc+JK6p7gsTybb0DXcvsqZ38gN1qcwPxlQjRCusRN9eqVSkJN0tTgLEAzYhTD8Vy0yQe BGqXAAGL83mTUqiTxMZisb+vwjSxX7bXU5Fdg2hDQRMTrcgseyYfTk5ZbrlGg8Kvh7n9A10kSt dTo7U20oUeoy0ZwQH/JF59mniQTTfhumWt5bN37XlO3m2yehiErr7nH8kVTczp2HMyMfyFPqc+ jgk= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="171563529" Received: from mail-dm6nam12lp2170.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.170]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:40:02 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b4w3KpkEzskNbb4tUix+RnVjJDdxM0UIIXR5QKhxG+/7zwA57UHxocHPzp7ujvWw3n5MlAEWE38tf9k3FLhFnIvmKc6mABZ3zzRqUcrouj00MuGT5HzcrO6dKS9hl8fn9O+pCbkUq0iUThZDPkAfJ7uNkPcgFekTKAdAPdrSac2NREvW8dhaLrgChLmJUThu+AC1mkVQo5TqDmCP93ZmTu5h8JTMCw3GISTSJhw8ApZ40sYgnm4PWTU/tVD9N+2nfnJk9GNJ0cLK30wykNV/ULtVWvaES+UV2ihm+XBTHghLYpC/2OdGslRsl2tp4N1/LiJaEsS3reiZ9HSBdNcZJw== 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=GkIF8ZYp+p1N5WGgy3ELu0b50Hty/aCwdTSyvtKemWU=; b=c5CBaU2n/aypjQ8kD39s3zBhzPDTlv8uAjjfm3acH/q7x5+Y37pvu2IDFVpFZsieqpOk1l/cHjee/ls5u262wYxb2lwr63IvIrnZs8rPnnLxENY/SvgIwXYmXKS8f8Z6AIAglwKbdzBFBxw5VwtB+bXaboJRyx8ko6yJl6+KxuXaRvvq16g0LqjJMOl9L7mRKIRJwENyrGwYNoQ63u6wI0RwduCkcQ/mBrRjrrOofFBD8tciS3j3jbSPWyhrRvVZVVdcG32A8qeeXSTBCbZORDjw/ghNm1sxq94Ha9ew9CXwzyriMNZ5jTUWwbJqY5L4FHZYjeeSW9XzArZzceCQfQ== 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=GkIF8ZYp+p1N5WGgy3ELu0b50Hty/aCwdTSyvtKemWU=; b=FY3aOjnZm+EBrHlzUBwDgZ/jPg3URxDq8IgYTAevTjBnoGb/R3IpBFL90Kd1O0YSep0x8JyZxv8NKYm9XcIFxNfHiCVpi/etvT2B0aYnU5LXVNob9jk+0hSfG8zQeU5w08v4jlh/nVaLdwNHfemAJEF68XueaRCYjG95SzsZZBI= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7857.namprd04.prod.outlook.com (2603:10b6:5:35f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:40:01 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:40:01 +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 v2 10/11] clocksource: clint: Add support for ACLINT MTIMER device Date: Fri, 18 Jun 2021 18:08:50 +0530 Message-Id: <20210618123851.1344518-11-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:39:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4618a406-46f4-4fbe-87c8-08d932563069 X-MS-TrafficTypeDiagnostic: CO6PR04MB7857: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pXSormVHrk/MSPEiAQ8Wy13b/uu2ik7PK8WMZz0H8BzFT5OoXRLtOAIg0XK950WU4d5H9Wq4ypR6zpO+Z9/YHCjy9GoiU+Jwq66UQWg9EG3vgBg7Duno/KB4EtgJ+4+PmIH/cXX6U5jrK/zH+xVwgGjS9/bJri95rykWH2XbgXpn8UBs6hJi/zES/fL4m9DrpRJXkS3jc7BczoJd0DzB7xjoyJMf6PILRB/bTVSliZ7oc35AM3RJRqKPBJzIHs2xx66S/k/pKnmj5BrTWBT41Fat4B7givdFfObPaMY7B9J6YbumZThGaoxcB0ZDGPc7KBemKJXFSEVHXJdyhjavfnkjpPp9QgiAPSlOkFEf+hrnelreAHhdvjS/b8r6UQoXMPmbGfnrd3SB0MWx4bXAkp8NbRahAHdS++qXsZ7XagatkI7eptWAwhvLluRokiLjcvNtFMXx//t5U7kS8SIeETGOnwHuJie92twcfnHYkMXs+/CnHe2N3lAFd4TZZBnVnexrBC3hQXDJ34b3bKRlC9q0YvMQcMwFv/26VqZzTFDklfAx8kiuUs+7UexOr/oxmgEKOeAI9nVueB6ul60w/JVdgU+OxIsnR4GQwvBD4XftaGlaCNevcEpA8FbmPPjgEkNRww+bqBfDAqn/Bf2Fcw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(39850400004)(376002)(136003)(956004)(2906002)(478600001)(316002)(86362001)(52116002)(8936002)(44832011)(2616005)(8676002)(4326008)(186003)(36756003)(5660300002)(55016002)(83380400001)(6666004)(7416002)(7696005)(110136005)(66556008)(54906003)(66476007)(66946007)(8886007)(38100700002)(1076003)(38350700002)(26005)(16526019); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DUe/4wu3OnUVtvsarVzxgL8+DfhZ4JmID2/Q4zBiqQpCnBQ0xHJCBLDvrpl1O59EgaVb9tgKt/pVweRfVfZjGW8O1dyhTpHRPzR9Dqj15TZEz0b3FFgiu7FYP6rLxFXAIuGIRlnwk01B7ao//cuVmwHf8R+iGFjbZRwCpGpVzmr8Rk5hH1XWHn4O7wzAC6qwENDs3mq4y5Ylil+hRmJnUJqDtwCEswN8WkvMW5EbKjFgJG3RmrHNNGuemmmCULiILyDxBRkxJ7b5uW6EMTmuUzpigBiJU/O4QJcUf2qYuMpuH+l71iniBk6wMkioxhhdM6neHlVYr6fnp2QdNr3nmPgks9wrkvCKCHBmdNVHJNCwsiHicMTCKK+onUT9W6fOHIkib8m4PEJG/rx91Kcup7X9+gkr92uZ4Znn8fGFJcC5j0LajZ353B1BxKRXdT83Ls6Lh8dSKzh7sgoXkQHijMHX0GwERYuheQGXoWkUa3zrVT4altmc0sbva/nS3kOUE2cnaVcHbLEbpIeEciYcrueHap8xJcArmxgX7H9shYVzVI8q0fjmTbwWDbjQ7F6kYtpmT5LEHXYwYfP9CkUj0IFro3h6pHjZGEM4VWll9gaPWmX2HZ1sSwT+9AY7+8+s9KH+S+kAQmKYAgT1z5sz8uHSptJ0mbhtdLcCIDP1kZIz3+hmTIo+AAH6fW1C0k4wKsePM7DZvcDXOfJB0+b8TN54EsUiPvDGHBFMc/rLK03EZ5T5/fY4BxrrvhJ9ls61Hfh6rLocK339nuqYxrB4H6HhkWD9gWIx+adBbs1XZ00leqDr9QvnoSblDDIXO0fkWmbH/15YzpsU7b0YxWQzKhENgQp71eZcxYMGGlMaAFlOePqx72RW5IBTvUJ2ETflMvT8pyMK2g7mafMIM0SetBsLzzHw/JVa97WbKnOyfAR7xgWZo8bSrBpgh1HJ4+zeFaZtUkmBrK68QwdHQtsuw+ZkWgCTsGKTaKl05yB5ly1mE44WZeeGYEzsLF/cdqfFoRZO3U5SE2HWBNrFH1Rm/M5Kv9Cm6iMRUPW4EcxtQKsUwdQbCMsYpH14/77RSZWN533oxxeB6UTnt9/e5cV/+362BY1UhQo5kG+DlGGAuwBBxCbg2XSUVDez8LS53u9NG3zdzPz4OnMIoOzdJ2knKK1HBbGllHkPEyOI2f29hQ7zser70l3S1WtdpKuTFYEKp2yBFdV09Cr5nSgwDkWEfAV6+YGT0UDD6exYpIY/FLSjb85+kY5/ngOOFz6YmkJAMxjeC1Sh5WWctFFXo6lLTsbK/h/73v1SaU042AXUOgFGqrGOEiVTfilKTA2FUuj2 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4618a406-46f4-4fbe-87c8-08d932563069 X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:40:01.1977 (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: O9c7UUw8W1i7X4mPH5CGWasMZuuI3LproeBW1Psx4x/nyJyNJmr7d4kE85QD4RDaYeXT43rMG8xsLwsSTCQgJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7857 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_054004_252238_E1FEAFA4 X-CRM114-Status: GOOD ( 18.48 ) 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 | 35 ++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/clocksource/timer-clint.c b/drivers/clocksource/timer-clint.c index 3b68ed53fe4a..bf89744cd12a 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,25 +29,26 @@ #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 #define CLINT_TIMER_CMP_OFF 0x4000 #define CLINT_TIMER_VAL_OFF 0xbff8 +#define ACLINT_MTIMER_CMP_OFF 0x0000 +#define ACLINT_MTIMER_VAL_OFF 0x7ff8 + /* CLINT manages IPI and Timer for RISC-V M-mode */ static u64 __iomem *clint_timer_cmp; 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 @@ -170,8 +179,13 @@ 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_cmp = base + ACLINT_MTIMER_CMP_OFF; + clint_timer_val = base + ACLINT_MTIMER_VAL_OFF; + } 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 @@ -219,3 +233,4 @@ static int __init clint_timer_init_dt(struct device_node *np) 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 Fri Jun 18 12:38:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12331271 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=-16.9 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 6C35FC48BDF for ; Fri, 18 Jun 2021 12:40:25 +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 38186613EB for ; Fri, 18 Jun 2021 12:40:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38186613EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=rlA4a9vxOwKcMRBo4W3SeS+n6d6SIhxD/2esPH77tE4=; b=bxj6YOJtIaoKJl 6aCztSvILo5D1uMZSi39sZ3UL0zrd5887B69tRhMA0GTku4Kf4nfEi6f6gJcNwKPUqvLbEASdkVky bXUP3MWpgo1iepTNUbDe19fYl9ixN9Mjq0Lx+IQu2S8bQv/FHEsFdiMELmkR2ouXgJI0xrk4Jfn8l s64mEXtY4B7nnCZyOeWN9feDLiZZVV3iXHo+x14snSrbR9YSARFBb1ZTv2MckRepJjdLnclB67Dqu 9s108dBi70zv0xzQQp194wXvrbtvGJwCXX3T6SLid1VPST0ef+0pOtsZr03fLBnLSXdivaO/70WNW CMYDyfvn6kK3lxaFd1Dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luDnF-00E3FZ-L8; Fri, 18 Jun 2021 12:40:17 +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 1luDn6-00E37h-4u for linux-riscv@lists.infradead.org; Fri, 18 Jun 2021 12:40:09 +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=1624020008; x=1655556008; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=FFdHgE65d6xE3WMahp4Y2C3ro4roHF+HqCp6R7Oi+uQ=; b=BDdBp2Td4VwawfkUMLz/SrTs1F8AUp4/0hHsbmqYELtx2uJqzJuhL/m8 kKjN76C7zg4up0wNuLHk4Tad2kkrulbJgrWomUoTwyZqPIv5D2vYDClar 2w3K4LGseldA2WSxYtVnbJdy9FnRdi3iPkbQVQm1qeCyp5zYL+hU1CzDu dvB4CMgyhAuxgv8rh/n7HcoLVeCU9bpOD6JywSbNUsnyPfqqbqrLe3IYU RCignZ6VW3fVsmhkwe9K46YKcMLQxTI8XSxp3eajRTjUD2XEQ+luwaLAh 1wpn906ZhlJ3yQNzGAgmCxlwMvzH0PbU3+KuPCey1Z8js7GKGt4dvx7pQ Q==; IronPort-SDR: 6zxXcZFJqd05cS/oC9pvffpkVopS8u7iNTuygCEXKJxahB4j/0HLP0RI3i16VZIr5RMdqQr76P r+Eg44UsPymzH2kzzmAr984AOYlqIv7rIzaEbGaaQa5o2MtjvWhQlU3gANODXq5r9vtgs7W8uF ExhZ81CDXpoEP5cHIgV3Rf+j5cr07aZ7HztyKW7YgZvPmymZdjab8s5l/PUAZgIpAzL0vSOiTG 3pDtYOeBOGeT2sdZBNN+aOhgv8cxaVv8FDnqV497mYOenjC9LVllYMbfHjQ+flCsjxPfq5bKO+ BvY= X-IronPort-AV: E=Sophos;i="5.83,283,1616428800"; d="scan'208";a="171563537" Received: from mail-dm6nam12lp2170.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.170]) by ob1.hgst.iphmx.com with ESMTP; 18 Jun 2021 20:40:06 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C+hXOC7pbxTkSHEGpIFb4tPuQCkiHKm9dPt4etEwxIWsZPsfdXBEkYrSmLKEdThFj0yWkvUVTU8WxLUWSZRkQR/UsBje05Vvra929hhMC/lALnyoEb2y3AmUHvtSpgkthF7p/AqImKdYSl+aBtFe4dqIuydIBrzGuv+uQz/wMkxiT3esj44N5Jfttq7Zsw6K93FqRuh3c9JFafY2gBTUNjHdo6OIqLXhCMX4C0HIXq++sa9nYkLVuU47oG2qZt0qXqSXnf+5LF3967Oy9+Te5wX4SVUOkeXM0ojd/NwhMrA0lm1PYBG3f+WFJJtSe0KnW5qxfJy7U26ZtN5ZGpCJVg== 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=3OypQkUVR/xjQ8A+WMYYGD/8cT1GOvzv98X+yQzCzZg=; b=lo1Ja6Pv/khsN26xaM4RxiTwTSrzA1sRe5SbgtNUq3JCyagBvcmLR2qxB0jo8ucVMT9hIjQFEi9x4VvTaWsXG/MuaHbFP+GZjlEOD+UOpbIqfyDCIxDevmzzKaYuAJYPPIQiW8++LQ3m8KFzLK1NpN8ZNtFUt+Z6S4AfkqS5MsQ6etdP8eRLwrVKRjzQ7Te5WTEGX9zjZ7+xA/Z65hMxhgTO11JcpvaKrugZY+jxYnaSqJFp5YCE2YrS0Kx9/R6r0MVm+k6O6vBUDFasJYI+Yd5zdap0Udu9oXHFGFz2w9B4cAd1TfznWGZzYz2O1T+1XEAMgi0wU9wqnhRJi4a6Hg== 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=3OypQkUVR/xjQ8A+WMYYGD/8cT1GOvzv98X+yQzCzZg=; b=wFSYLm9TlQT9M5dSme6XGv4wm8V/NVVtDgycIuKWN7MEFpVP4seAKhToSPEZN+EYQT0U3SMIr5WHE6cycppxj6uHuX6vy0T4MGeRRRCjgwDcKEWor+50I+BflNxJQ8kDloVdXcR4+1HopaJ7SGRx+6DmR4XVrnpBVgJ2nEAhHEI= Authentication-Results: dabbelt.com; dkim=none (message not signed) header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) by CO6PR04MB7857.namprd04.prod.outlook.com (2603:10b6:5:35f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 12:40:05 +0000 Received: from CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 12:40:05 +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 v2 11/11] MAINTAINERS: Add entry for RISC-V ACLINT drivers Date: Fri, 18 Jun 2021 18:08:51 +0530 Message-Id: <20210618123851.1344518-12-anup.patel@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618123851.1344518-1-anup.patel@wdc.com> References: <20210618123851.1344518-1-anup.patel@wdc.com> X-Originating-IP: [122.171.164.186] X-ClientProxiedBy: MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) To CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (122.171.164.186) by MA1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Fri, 18 Jun 2021 12:40:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f76cb02-4edf-4366-4dd8-08d9325632f8 X-MS-TrafficTypeDiagnostic: CO6PR04MB7857: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UYy6Z45KZoPujCXZhn4WNTydC2l+cDthEop+aKA/RoYlvfx9mdhC5aGiRtY4JFOo2B4wFXTa98Cl5KjWIIvRNdtUp4VulvK0TTWIKPlqgXZPvyrW45jItaSVXetd5xKxwvvnavD/GjbHYCkh5FeIyQKIul2WWY510OZtRXBO9C5PkkMwtXgWQrwT1UWgtW6K9/dL5yfVzUd0ZJdooepQoIYBvV6xncUUQnmmmKhh+bEIn5F4+RognveJRaYuk+GoZQrl9rz4SABZVahjRRnwo8SwwdzfC0bZrldmYTg+P8Jtm+Ecd0/BPt2AbTzVOWod4r6TYIe3E+y8pe9q9kYpNtPlU0K1scbHaXUYIPSpoNKtSRSXH2072iyhBxU7kKWIvFV8tMJ5fq0p+1Pu9RSDO0HWTI7dz1w5FIPR+MWjjRxPgDvwamAG4aRGUxGNmgmEfNsbRuE/EBTvrbi7MMOezbLQiUQoZoBLV8nUCot3xsUyNtHYsblxzCg3wCYnpgo3z7XhelqDkLWUpx0sx6LYQ70BtcsCQFbdYUr3GEzr3786mx057DZgS7D91kEQc/J3TM1GRh5JHq1A1mp+VCjw0+LbAwxDtjk0KQO4sOiPdnTtI3+pQUKK5yaZWgfnxvUShO2R3zYyoijDGCAI2hfatA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(39850400004)(376002)(136003)(956004)(2906002)(478600001)(316002)(86362001)(52116002)(8936002)(44832011)(2616005)(4744005)(8676002)(4326008)(186003)(36756003)(5660300002)(55016002)(83380400001)(6666004)(7416002)(7696005)(110136005)(66556008)(54906003)(66476007)(66946007)(8886007)(38100700002)(1076003)(38350700002)(26005)(16526019); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5rGINAQK7R9gcSkLMVD7cT8cia+Ct4cIDncaTfA3QgcUdFaUXzGXdRuw/iL2dXFxBobfO9TnosbGWdxhhBOX4FYgPE9LnQoMyjl61pL522Pu8kYvj27JMQIEEIxFYUE3CvzVWjbC8tfttgCVGdpoZevne151EQyyR0nj+gEOOyAw1eKQ5k6FvX4/eEy9tCDC7LI1TXmqrOiJg/hEQU3xHMURQWIIiVWRc5vhj3VJYdd2EybwCLSjA9aBlUO0GFa7oF7IdZloX5Q322O9f/b3ynzEgQr2DAdRkPz9n/P880fmH8FFDg4Y9d/kz57RX6Sc5/2LVYulvR9/um4XDSPJg9qpxdjZPEQAjPZW9TDbiH5G25Qn7ho5nlJShDPRQUconcen9wnOKUPtr9UM6fPGqdJlak3XqrXn3JOa7zoXK9aQoVBQ/VJW0BBtMFZhls3JKgIQ9+xJHIgqoUpwPfKe42x6PhLsq2YE6KMQw2Dv1jGXua/PshjxhmeWDuzgBQ80YTvmHl0Ph/T5TOBX0qaSZ33CfNmILdGhkTt1/5x6yCsdXgo2tdN6sBBQyEBGErvO76VIlEXjBZak4Kljg9fH9hialpUOp5sJb1R2wZF0LfJ8wlO5/ouKpjLtvIYhJeBFNSA5EGMsNN33nbnWM6dAHOboA12JeP3Ms7nvD+YN4oRTT1Zi4fPJ6b2qE5O+F7EhyNbcWu9M5o9ylchbb60YSeZjGsxqJRvReMaOyV+EWEZXPJYHR2Es89EeJNGSMyI/bPEKgB7qS2Pfe1K62ypBGbjKviBL5pbHOOMON/2IY/+fdWctrcD4WrpNH42WlYXXkOYw0sacNVFY8i5o7h/nrVYvzDU9XWbNHKlbg6zVOjLZ5gF38mstFnDVtdYLnUdNL71jvdVqBHKAeW5I7Kp2oVDYzGjI38SThCsAxG3hR2FumJH6fL5317qSikHgIvOjsxwRv8FBYKBzOtNxBjZkzjbVcfq9L2WOHKzL4JmyCkypl3sI1u8Getu+onlsx3kHCht5hi+ysjp6hm+88lcywjAVLpcBDSkHB1P36OkvrmTpRUyE2MwZ87H9BOeJPsiub+8zRbC/IjhSIUEuQIIruhaWQ2/IvdHZJZGbZABtsmZQEQqyzMUG1TA1aFInLSJwOL5bVoddETIvwetS7sm0qD4Zu4upRu2DLz+B6WSH+OfsC7YznT7NTM0KYJsTC2PJucF0jpUTyz29N84oPtCa40fgDbhwDEC5Yn9OjR69TIr6v7h8RJPXXxAVrgjaiNcMyTQqSXWfg0lnQkclCMg9SirjY3SMPUOh3Jwu8ip/M/cGImowN+i5GVW9ZuK80n0q X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f76cb02-4edf-4366-4dd8-08d9325632f8 X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 12:40:05.6511 (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: MPqPyTXm5DynaCM0jNgaJHoT7s8ccWDIeWx/wDYLI1IUwrW9ugpFybcyDNnYLGKoz7LQNkc6l7+ogUDB6QVXgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7857 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_054008_329125_DCCBB1E3 X-CRM114-Status: GOOD ( 10.53 ) 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 bc0ceef87b73..64a5ee2fb20c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15693,6 +15693,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-aclint-swi.c + RISC-V ARCHITECTURE M: Paul Walmsley M: Palmer Dabbelt