From patchwork Mon Jun 5 14:35:11 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: 13267402 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65599C77B73 for ; Mon, 5 Jun 2023 14:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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=5ArECtM2I0QUAdcUzWAJYjD79ZTrljqUR5sL20K1Ooo=; b=VUpeCYVO4WLRdc BNxgkmCxcb3PTbUWWU/ZYrbf1vWDrd+6HudSRaB3cBN/TSHOYyFleWb8wfKazaSinc9N52A5yF8G9 qVsttp/AXtyvhV2zKSBYhsWHNH54xjxT5fnYBDxjYBzV07snBsjMia/FZLnLcJa5tCG4L++K66wLQ R3qvUVJR8lTbNelucyb/VU0E7/9pBOfk6CN91O+fLILcIjZEDrS58rYfKlaNu+J/LAEeEIF9DEsxN BhlzIXfPH6ElsVpbxBK6QQjWJdOvbKPhNnoygXV7A5YWl6+FPj3q9EqHkYsM3UY+LOhUrXSNCGhkk 4AXbbmWaLT6/cpEzXi+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6BIt-00FoJC-1h; Mon, 05 Jun 2023 14:35:27 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6BIp-00FoGG-1n for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 14:35:25 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-256a41d3e81so4138901a91.1 for ; Mon, 05 Jun 2023 07:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1685975722; x=1688567722; 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=jnPfgIDWBs0YYXdVzHgFIrX5B+53ekGUHMTcfude0cE=; b=ffVyNgoosVSs91945n4gFuDiXVzNuQEEPwb9IjnJp4MyeKLTIRZw7Xnsyu0vqoDSPI 1h0gdfP5D+HMUZjI6u8k40LINt0IXgn/xtnNyvPHrjKSNgKwg16mt/5bxbzXJHDfH4pF y1oV1LRu4cc2aOmKc0Xhtw7aXNMHdxNozGFcDads+8HgDeuwEuH28fnOKGAPOShykVoc Gesn8FP+iWgXBfrBRYpazhtvc46TbMy1suMh1bE+xq28UM+8iwYJ59NirSXpLYmKW1el zrlRuF3C/qgZEaTpEQO9kubKn6IJ/mOnezYYN9qn0zucGdn/qgrVSRHUlAwh4BCoEIYQ 6c1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685975722; x=1688567722; 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=jnPfgIDWBs0YYXdVzHgFIrX5B+53ekGUHMTcfude0cE=; b=Bg6H3bRYoZ73KXWV4lcPjJ8aAynza/hP6/rm7IPFBzWVM5RfMyCBri/DHum8W+BeDE U1fM3KfBuOWxCRneKPOUgZFuXv/EY9pg3uTR88014Ra6i/wlDUWiAsZ2hyWG+Gv4kzbi ISKms9WP8jDXgWQMjObDpG6otQsTHi98qy8uspRYJJokM1SLYegpdshvbz2idcEg/27j 4XYdzKoXqPUvqfpWtZdqPAuIn/FfLHZa64Ev8S+iPogQ8XQKFxzop45+nPclAl5T/9uQ XSg4ugrs56rZBtp4eLqW3l/3CirBQuJfiT4ZOSvwNcG9NOQECMx/omE16mFHEkjarKNx Xxqg== X-Gm-Message-State: AC+VfDxAcDvjjp7c26QQKulx7RfJL2+gTAffyPglw8vR7GAoHnnp9P5O Pz8pEjG7eyOQJ42FH9TBn31NJQ== X-Google-Smtp-Source: ACHHUZ7T/nG/LREifYc0zczolikuIQMgBFpvxe9aToBG/9+TDnjWaZRcSokFABIaKOafGLDmMIPE4g== X-Received: by 2002:a17:90a:319:b0:259:7ed4:d6cd with SMTP id 25-20020a17090a031900b002597ed4d6cdmr844923pje.5.1685975722231; Mon, 05 Jun 2023 07:35:22 -0700 (PDT) Received: from kerodi.Dlink ([106.51.186.3]) by smtp.gmail.com with ESMTPSA id z14-20020a17090a1fce00b00250334d97dasm8297069pjz.31.2023.06.05.07.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 07:35:21 -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 Subject: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space Date: Mon, 5 Jun 2023 20:05:11 +0530 Message-Id: <20230605143512.707533-2-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605143512.707533-1-sunilvl@ventanamicro.com> References: <20230605143512.707533-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230605_073523_596527_B3AA13CA X-CRM114-Status: GOOD ( 12.99 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Signed-off-by: Sunil V L Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/ 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 Mon Jun 5 14:35:12 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: 13267649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7B7BC7EE23 for ; Mon, 5 Jun 2023 15:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E+5c2TYsyLlP8RMxp1QOyPr0OdxvbHBG6zBIyuxaxr0=; b=mBQptRzo8Io4RU mGbyqbxF2edgto/BP29hvynVypB0Y8dlDzXb0CFKYpaPqDe+aF41su2r559t+jndCwMoXeff2xhp9 uggZbYPUR/AeskcH6IZrtx326orzrygqnXBrGhKUK8uuxo2EmzK4yfLnBHyuzYSVwegf8WwsAl5XW HETGAzLSSebSUOhryMiVUADDNuW4c5nak2p8UOHE7G3i+fTIQylu/2XW0kSxiWZgVHfOrFiPKQVH2 G58tGdGimk6nsENwzjyTFY7JxQr5PBiHKmysn+byZP2Sv7qW1O8z4xb6C3p7twsLInz3323eHbX9Z GeHDhn4XPMeXeG6mUIdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6CKb-00FzTw-0M; Mon, 05 Jun 2023 15:41:17 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6CKa-00FzSf-0q for linux-arm-kernel@bombadil.infradead.org; Mon, 05 Jun 2023 15:41:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=2WhshXKr1H1IgI6UHBSQIBmTcD1tz7rfuPsSZ0ruzz8=; b=VC0XefOPrXGKdJ2fE/KExnpBJ/ ZTUvFeDkaqi/D0bDsa4vy75E4cGDmQ4DknNtepXtegvkqYuvbR4PhkuPy5u0O+RCFhsKCjamuD1Z8 CX76pmpFirszK1HfJ6rWTF3l7YGJG/oLKj5N7o/tDSNwccXVcFtcu/Z/Mpwym049ZIKidwQcro6jD bw2cTOtmCglBnyRAzvQhrRQ+q7EpDdXoFAg0iuasOroptHdu9JV1xM+OcHSzlReyM5lwp+m00m7Q3 Fp81GMUaMhINsS5PGZ4L4SmoVxx+I3Nozru/ACOev0+Qn1YxCbauqDfEqlQMWqVxuQIoQoFOtnLTx vkfLrjjw==; Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6BIu-003N1e-0r for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 14:35:30 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2566f66190dso4165281a91.1 for ; Mon, 05 Jun 2023 07:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1685975725; x=1688567725; 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=2WhshXKr1H1IgI6UHBSQIBmTcD1tz7rfuPsSZ0ruzz8=; b=H7ntuHScdWoPUzoKwZRiZvqfG0awHlrUSSK1pAs+lyeqFTCIxUqklYXFE6dAzkkCBZ uCgLf76q03S709XNLv5k7Aow/J45iEBVaUcEhIKIkrhFaZkQaarHrSejsZFr8ZzJLbfD YSD1qJIncAISnp2zKZsfw7oNLb2W867w3mU3+2RBoJkzxD6PadpJqptPo4tMnaYlBD55 6DZiEZ80LPwMv88d+hydYcCdPZKMzpbuaqK7MfRVO4nuu3nv9V+dEfqx9Or2N2mU/rYt DA0f6kwF8yS4K5wJWWbFpm67k5WE+l/oAKu3FnPizmpf4ENTAi1b28sbxMsVTCdhpNmE bl6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685975725; x=1688567725; 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=2WhshXKr1H1IgI6UHBSQIBmTcD1tz7rfuPsSZ0ruzz8=; b=L85jv5nq9nwOKxNG1Gnyt6dhLsuR+es7X75EdhacZRbTJKAfA84Y+BF656AiROUdoW eJ+fqd1ttbfejuFb1tUiQwtLy2bwPPQmuZUtGCqSnXY8F2qxs9pJSTpzzZJEcDJaD4Zz TBXYYjQV24zkJJ/I864GVKOLVAZMvcneF+VBGSHpKL4yTLyRExJnBVgSIljTtF9M2qO8 rPgOQ1rfS82aWXXrus5VPMf3GTuYr69MH6s7329cdYB4yYJ8VfrnrRtaty6INxFTxnjO HtsGe31+cd3ZB4nw8AYsARFLjzGdmn0Ih/u8u6E/j04KtamszJFsld9U/4AVMzeHwvjG QSQw== X-Gm-Message-State: AC+VfDxPb5BzgiofxP9BSWY7nhUb4wC/13mIJmIU7Q7GcbCz/EpA1qW2 zQNrhx2MDJ2esLrIsrwyj1xYQg== X-Google-Smtp-Source: ACHHUZ4Ov2HL9q+WOUyTJWRvS+NleXOMHYl+52PubaZZyMSGeiU54ocyAhUOLpl4Mv27fCWN3q8bdw== X-Received: by 2002:a17:90a:9201:b0:255:cddf:a0c8 with SMTP id m1-20020a17090a920100b00255cddfa0c8mr7068618pjo.41.1685975725413; Mon, 05 Jun 2023 07:35:25 -0700 (PDT) Received: from kerodi.Dlink ([106.51.186.3]) by smtp.gmail.com with ESMTPSA id z14-20020a17090a1fce00b00250334d97dasm8297069pjz.31.2023.06.05.07.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 07:35:25 -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 Subject: [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Date: Mon, 5 Jun 2023 20:05:12 +0530 Message-Id: <20230605143512.707533-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605143512.707533-1-sunilvl@ventanamicro.com> References: <20230605143512.707533-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230605_153528_438245_3C230B2B X-CRM114-Status: GOOD ( 13.68 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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;