From patchwork Wed Jun 7 11:24:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 104451 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp287682rwl; Wed, 7 Jun 2023 04:46:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+kqiDgfiRE47D6eSHvGcHiA0e1EgPbMZw7xzAS8ENsdUoipM32IkoBmwMvFWSipc1Fx8v X-Received: by 2002:a17:902:c409:b0:1b0:48e9:cddd with SMTP id k9-20020a170902c40900b001b048e9cdddmr2803980plk.69.1686138383504; Wed, 07 Jun 2023 04:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686138383; cv=none; d=google.com; s=arc-20160816; b=lh5c8j3+rnrzSf/cbeWbUI5TyQdVp3nNO7+5R4937wRnPeRZ+FeQOgSlkUePhF2JZN EcWnVRHQElGo/MLxIamO56dNqH2YwJ8/Np8QrCOZFv4lGRqQkXIvP8/+x4woPd3sXNdF ZZKx1rrOYoFBujfApc+w2P7eZRoCJufEc9BkTmR8Sl2SITGA7QwwgnoKEE+BHAGzBuHh tUvsX+1ZovvcXYIwomQBz4WivXNVsZfoQpAu4m8VM88QXA5WyCDWlA5SiYm2bbAaV0sq 6iqE6TmY763nYbH2lCfUsYAM+NLOxb/h22t/vgQQVA6SR25uZ1zBHo9x0MZcfDHWjjEy icng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FaLF8SuXqZ+eem5Z+p2tHoPzcT4Es5+ktuLMhNLEyaQ=; b=ca0hGzTqRmQ+eMWY107PoW9DeF2sewOkFX5VIm2IJRnOi+yr5TTVOADd8UdbiPbYBG oArqma9VPBhCF5fI5BuAk7eTqXrwm4bfnaRFixz1/YbQ0ZLWHmIp9xpwybO76rhroCd4 bMbMNz3vjqrz0i/hdqCM4nyoLmqC6l+qwF236T4TnTc0Wkrs1gMmSy8JamnGqK4RtVKU mA8k723FgW++AqSlM9gbr9r2h6ZNMoyPc1Cu+OITs/V1mjGpm5xz5H25Sy/zV63cVc7g 7S5GU51R9W3kjDlm9mz3TpJX21ucBoshngVR/6DjAe49M2goaIQS7jX5YGfE2AlDOuuC k9yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=WCsZ22y+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a170903228400b001ac482e25a0si1703240plh.374.2023.06.07.04.46.10; Wed, 07 Jun 2023 04:46:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=WCsZ22y+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239682AbjFGLYc (ORCPT + 99 others); Wed, 7 Jun 2023 07:24:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233982AbjFGLY2 (ORCPT ); Wed, 7 Jun 2023 07:24:28 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB90A1707 for ; Wed, 7 Jun 2023 04:24:27 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-652d1d3e040so3661241b3a.1 for ; Wed, 07 Jun 2023 04:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1686137067; x=1688729067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FaLF8SuXqZ+eem5Z+p2tHoPzcT4Es5+ktuLMhNLEyaQ=; b=WCsZ22y+8czgBOQ9DxhWSAUqumehO6PNurNynJB4BmToYu6snCtWQL+exdFzufbLlX bvoB8jqEWvGls4utETB1quXhAdc5ateJtVPpVG4Q4BIe4sjEz3iOxrJttLa/Zed52lyX 8/1RJJw8nfPLIXTmTbjyLBm+goVaPkeavhGj9qTnaJr3G5/hC2Usy66pUFkgIdsprF6B yG2k9rXQs/q4qVOPjcxFPmhS2y77EH+DgMcSW1alU7l/U05q8ySYu3r4bmnQyCGJDC2t yGUlrc0mC09c4EFcq8rMqJAnUmIh2YhnVaxFWt49+zt5a143SHm+N31hZyAvF8C/BM5R +50A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686137067; x=1688729067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FaLF8SuXqZ+eem5Z+p2tHoPzcT4Es5+ktuLMhNLEyaQ=; b=Bta+ORg/sjQaCCFRPiVRbyJ8U6pfOrrbeQ7tqYkGwDTvzJU6tSbSBff/gDun4H+/cv aKSSMJYL1pkb9RWKnqOUO8YM1ZnvO7AmVbToAqwKkAGmy2ZqqfJ9Djv+QFLiY94Eizho F77c2TA91jBdsXIGpavi3knYnPytu/yftruBIx6GPyu/bV38kbq+Mry4Nuc8XFGLNEGz hMQAgoGjqfey01MBkz/OeT9E5jLC0iSniqsJhKTOH06VNfth6/E0MDmvezLE6C6Q/daH Liuln45kHKj6N8HnflclwUSg6aJHIJWUfLwvgh1getCclHo8OKoA/F3Yp9jQYpBn9T5X 6Obg== X-Gm-Message-State: AC+VfDzALkdmYvIKJMt8qD3Zp+d7zNA9H4EVu6Few2M4m7i9ZYXQ7i4Q 4yXFV+6DLptF8HU8JC6kN15WsQ== X-Received: by 2002:a05:6a21:3706:b0:10e:96b5:45fa with SMTP id yl6-20020a056a21370600b0010e96b545famr1341134pzb.43.1686137067317; Wed, 07 Jun 2023 04:24:27 -0700 (PDT) Received: from kerodi.Dlink ([106.51.186.3]) by smtp.gmail.com with ESMTPSA id o10-20020a1709026b0a00b001b2069072ccsm6228322plk.18.2023.06.07.04.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 04:24:26 -0700 (PDT) From: Sunil V L To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Mark Rutland , Sunil V L , kernel test robot , Conor Dooley Subject: [PATCH v2 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space Date: Wed, 7 Jun 2023 16:54:16 +0530 Message-Id: <20230607112417.782085-2-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607112417.782085-1-sunilvl@ventanamicro.com> References: <20230607112417.782085-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768044241889987601?= X-GMAIL-MSGID: =?utf-8?q?1768044241889987601?= The arch specific __acpi_map_table can be wrapper around either early_memremap or early_ioremap. But early_memremap routine works with normal pointers whereas __acpi_map_table expects pointers in iomem address space. This causes kernel test bot to fail while using the sparse tool. Fix the issue by using early_ioremap and similar fix done for __acpi_unmap_table. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/ Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core") Signed-off-by: Sunil V L Reviewed-by: Conor Dooley --- arch/riscv/kernel/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c index df5a45a2eb93..5ee03ebab80e 100644 --- a/arch/riscv/kernel/acpi.c +++ b/arch/riscv/kernel/acpi.c @@ -204,7 +204,7 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size) if (!size) return NULL; - return early_memremap(phys, size); + return early_ioremap(phys, size); } void __init __acpi_unmap_table(void __iomem *map, unsigned long size) @@ -212,7 +212,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size) if (!map || !size) return; - early_memunmap(map, size); + early_iounmap(map, size); } void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) From patchwork Wed Jun 7 11:24:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 104469 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp305762rwl; Wed, 7 Jun 2023 05:13:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kkDdTuOq3NlJGazOuLsu6jSFxzUu3hyhuevA/EUAt2xCq5pssRat51xLyvko6xIBP1RwI X-Received: by 2002:a17:90a:a588:b0:253:7dff:62ee with SMTP id b8-20020a17090aa58800b002537dff62eemr1607365pjq.17.1686140004132; Wed, 07 Jun 2023 05:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686140004; cv=none; d=google.com; s=arc-20160816; b=mIui7/DuC0u0vm3zU2uUnKG4UhqoSDvGD6KyAKKgP8aXQNHaFYBStSYH6D9HX18ADo H7JPO390PkCTNoVImL949Bf7U2bhhAUiTNEKuxq7EKqQxTIa7+Aq6z0RPocXyjci4D3C tj2wy5tAGIcTMJbsgOiJ/R6vnpPaaSYpGICt7goZWlAa9gXywja/cfUQcbF3q1ZcVmei 0X02I+99A9QpIzGwlp99prCNeWXwH28ienSeZw1FUONya3s4DzpIq0VI/RY9H/SwgNrz rGilzh1smFUIr0nwcBWsm471fej0iFedkNvP+01Fb3dIIDv5z/YhtLZ1CjgJ6qzzVOM0 dzaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EKUAIZ0nFHOgAYGnbeK6iIGxT+kuJpEiGpjsvdtXi+U=; b=QGvKw7659mQxFLN43w/tmaNO5VCv3nvEA4XyTfBSza98+97L/cSLmWXufy0WF/8UGN NVp9MnKOfqyTS3bz3wRrTTqMINoSsnswLNimB4Y1W4+hCyG+7dC0CMXBSOf6/SLfa7Xq tL6kn2xoqvnlNdlY6Z9PGNg/i9nSh3+Cb3m/p3E+WGwcusOb5Mr3xYC2uU+ImEuWlCJc 61bflOIiGkS9yaJtuT+he/sV4uYkux3I6POeaoS76/6GWkFxSwbo7KjRAi3g27oKG8fd EfYE0QaM+JeNmuByx6BZQ6m5kwtKX4DDfq15zRucYw21lv6BhTNhDJEZu6+fwsifegSI 4Jiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=PApebzMK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a17090a0f8600b00259ba4a1349si1019975pjz.104.2023.06.07.05.13.04; Wed, 07 Jun 2023 05:13:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=PApebzMK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240324AbjFGLYg (ORCPT + 99 others); Wed, 7 Jun 2023 07:24:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235273AbjFGLYc (ORCPT ); Wed, 7 Jun 2023 07:24:32 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48FA110DE for ; Wed, 7 Jun 2023 04:24:31 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b01d3bb571so31194175ad.2 for ; Wed, 07 Jun 2023 04:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1686137071; x=1688729071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EKUAIZ0nFHOgAYGnbeK6iIGxT+kuJpEiGpjsvdtXi+U=; b=PApebzMKCyqeqXPvbn9sAWGMu9YTfuYS1wTr4s7XojjK/1/8qH0LdaYZ3piwvnIIQr LGaZGt6kN5ptNt6YkYXgEfms51C0lWvb4hy/7KMpH6JJNfVF9tuXDP4KPF81cV4uc/2u tBH5nf8dSv3mWC38EwFDMdWkkCq/cAGDoDgHuQCDo2Mb8plFlvkLVRCDxKmzHVNBUWjY NwRsL6ac/88EiMnZOCnd2l/NbV+HhcHyHbB4RUXMPiP2GcsJ++76oDehR7ppMoluV37J fDqEOH0awHQvjzGk7DCl900Kbp7do5DuU9krb1YPvAcI8FaqAnmar4vdEN8ogPgFxEob Kryg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686137071; x=1688729071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EKUAIZ0nFHOgAYGnbeK6iIGxT+kuJpEiGpjsvdtXi+U=; b=BbP2dg0FYZ8YmDDQ5a+oiOYfGw1yfbyHsYuABxmfozcoJu8zvRtNTAbmlMKzbZKJDg yycb+fmNSa6cYT3Ile/jDNeR3FiLTyFKwPYqALNlEMHqGcDC0GvmUEzKFVOhM0SXka3N UlTqctwrjepo9ng+UOxYAYa90Xbh/C6Hv1S2Nq8vsp9/hWvyL9im2YXSW2JuLxxVxWCF L/WEeKYyXTb/urkoJKU+1nWGhsWEjzPyxRaWe2LGCNiILY2viC6BMMVclTQRDbqR72pu bIYDlH9WVninz6H1i8vb7gqH5kCnuCdhQP6w8ZTIaIHXKf/p4uJetHC74ZSQCf4eDeDv kAyQ== X-Gm-Message-State: AC+VfDxIJEMq2XDrxBbm7uIEbW6Jt8YbSaCtRaZx52ZtT9dnp2YcDHCw evKfdz/aQvBzAaZH1ViyV/xcDA== X-Received: by 2002:a17:902:cec4:b0:1b1:dfbd:a192 with SMTP id d4-20020a170902cec400b001b1dfbda192mr2072940plg.57.1686137070768; Wed, 07 Jun 2023 04:24:30 -0700 (PDT) Received: from kerodi.Dlink ([106.51.186.3]) by smtp.gmail.com with ESMTPSA id o10-20020a1709026b0a00b001b2069072ccsm6228322plk.18.2023.06.07.04.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 04:24:30 -0700 (PDT) From: Sunil V L To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Mark Rutland , Sunil V L , Conor Dooley Subject: [PATCH v2 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Date: Wed, 7 Jun 2023 16:54:17 +0530 Message-Id: <20230607112417.782085-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607112417.782085-1-sunilvl@ventanamicro.com> References: <20230607112417.782085-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768045941117076101?= X-GMAIL-MSGID: =?utf-8?q?1768045941117076101?= Currently the PMU driver is using DT based lookup to find the INTC node for sscofpmf extension. This will not work for ACPI based systems causing the driver to fail to register the PMU overflow interrupt handler. Hence, change the code to use the standard interface to find the INTC node which works irrespective of DT or ACPI. Signed-off-by: Sunil V L Reviewed-by: Conor Dooley Reviewed-by: Atish Patra --- drivers/perf/riscv_pmu_sbi.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 4f3ac296b3e2..0bc491252a44 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -739,7 +739,6 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde { int ret; struct cpu_hw_events __percpu *hw_events = pmu->hw_events; - struct device_node *cpu, *child; struct irq_domain *domain = NULL; if (riscv_isa_extension_available(NULL, SSCOFPMF)) { @@ -756,20 +755,8 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde if (!riscv_pmu_use_irq) return -EOPNOTSUPP; - for_each_of_cpu_node(cpu) { - child = of_get_compatible_child(cpu, "riscv,cpu-intc"); - if (!child) { - pr_err("Failed to find INTC node\n"); - of_node_put(cpu); - return -ENODEV; - } - domain = irq_find_host(child); - of_node_put(child); - if (domain) { - of_node_put(cpu); - break; - } - } + domain = irq_find_matching_fwnode(riscv_get_intc_hwnode(), + DOMAIN_BUS_ANY); if (!domain) { pr_err("Failed to find INTC IRQ root domain\n"); return -ENODEV;