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: 103311 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2737858vqr; Mon, 5 Jun 2023 07:48:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jLRautcNtxxRzscT8XE6TpRiMb13ZoJzJ1IFaMXMFHyU3Y1gRebBews0ANIVFF6/dCsR8 X-Received: by 2002:a17:902:d38d:b0:1ac:815e:320b with SMTP id e13-20020a170902d38d00b001ac815e320bmr7298298pld.17.1685976533674; Mon, 05 Jun 2023 07:48:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685976533; cv=none; d=google.com; s=arc-20160816; b=cSx7/4zfRufBnxT4vmMZFMRehaLevKjbIMhKxQe+EV5MZqsHkp+bFDjgA3yDuKesGg WNGaqTOQJz1C3gnb2dS2JffbAxCDpHiRVESvjYNBP2+k4CFQGVxyl076RtO/50MLMRYS mLwWUVsVtc5pwUIl+lbM1sorlyk2udScRJeP8qCWfaEbLw39Gwwytx63xRqjyh+PQ18p jCxIpH/Dx5BeYCbHmNj7LgSHggeV71fqjUL91CAqUbJHsMzKg4m9XWI0sPwGF8u9w9V5 I3gpsOG5a8LIQnrQujbgePBr2NIEP9zmtYJxaAB0j18hSOGp1KnPAvG2cPH+NkGoaDRf xLFQ== 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=jnPfgIDWBs0YYXdVzHgFIrX5B+53ekGUHMTcfude0cE=; b=h3jZNhSnTZLf20/Dqo18/woqLNVkkZJyHg41yjGdCQb21VbMJnSZcxvwCjTuNAMHE4 cNFkRKKtf+fvZJuQpBJUXM0qKOva1pODQLetLC5oUOi5KTX+zP93fIxkvpbO0LxeaPc4 uBw5NwTMUeAxVJREAXrCKJ/bZhCgaxQbJHt70+v+7SLeMhH/4hpG8UuYaknAK7XjwkHr 5kjMPnFZPLh8Q8GRFex45kozxswPrmNQh1v1F2FlhfDIeWqJmMRiDqRPHiP5SCkM+v84 JwVJiJvQZ8HUNMxJd3hgaswD5CMJcPrwN7Bq3gatRDicmaBDMd8pNz1/u0EdmQmm9WZ9 Z4bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ffVyNgoo; 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 y12-20020a170903010c00b001b024ab08fbsi5423633plc.59.2023.06.05.07.48.38; Mon, 05 Jun 2023 07:48:53 -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=ffVyNgoo; 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 S234088AbjFEOfZ (ORCPT + 99 others); Mon, 5 Jun 2023 10:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbjFEOfX (ORCPT ); Mon, 5 Jun 2023 10:35:23 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B64C483 for ; Mon, 5 Jun 2023 07:35:22 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2565a9107d2so4145047a91.0 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=gyvNbxDljEsVXnfeD1oP+zQqPnQiHFuads2N9H0tMmX6g4NprV4qcV8H51h6lF/0mS DQCpgY1fTR4oILl3s7SZlsFo/mCqbVDpycn1DD0/YLxBttWT/IOEa2KKxNO80472UVts D420OIQ4Yx5sDMUNVJH25RK5LsMmUf5Y6w7cy0jl12JXrzqaqzII3hgvLNlPDBjvcLhq xgPY75SA88U3wLy84YiL31f7IKNNeLzMr6CPaqRYF1/52E9KSyv/pKtmwscQfzYbUyFV J1UzgqRy5TXhaZTkYdYB3sf1hXqFNMbQiXYc8jxUjcSEWJBpMU5R9GR9tojJYW/T7sqv HVRA== X-Gm-Message-State: AC+VfDzCyAvCwY+6DCyeCxMGfNR/DCmHO2c1BITdS2WFEU2WZ5GNvOlw 3u/jIo7fDYCGcEc0xW68BDRutA== 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-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 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?1767874529655929178?= X-GMAIL-MSGID: =?utf-8?q?1767874529655929178?= 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: 103313 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2741465vqr; Mon, 5 Jun 2023 07:55:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yuU4+yuBh4CepkTF65yuz2C5vPtfwjE8MMkwMWxHssYBFcp2y63C/YiaRDeq9MsWWikvR X-Received: by 2002:a05:6a20:8e08:b0:117:1c72:2f06 with SMTP id y8-20020a056a208e0800b001171c722f06mr1798328pzj.38.1685976924875; Mon, 05 Jun 2023 07:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685976924; cv=none; d=google.com; s=arc-20160816; b=Q1oJ5PZmqPXcd55bmHWoHz8QfEKO/urcqOSs7J1Rh5qWGLFv7A5LgoWIL+DyVreq6m +8zQ7ZfSf//0NqzmL0SW+mpdMc9/9XUZszYtE8aucCKydqGD+wawHDf/GpHfhkgwEds5 10zCVLBu4Fx/Jb6w1RY1Ijaop3OfRoVsFXIfd+9ytmejWyp7aUb44UCDp/w+45WVPRPw MduuDTJEM6uVfu3GQxkFkHNQjrK7CUeAvGY2QPORoeX7waXqEUKuS1dq1ImxJjtXGDaW JSSnHY6YFBJzkjTtxX9A5L2DTiI0ee19j9RyyDlnm5A4bdLhShm9qYR07FZ9lVJIoY6J /KSw== 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=2WhshXKr1H1IgI6UHBSQIBmTcD1tz7rfuPsSZ0ruzz8=; b=T7Y2G1AeKsS7llIS00xxCY43hiYY/v2m5VCrAZgJbEhVXWE/HuKDei8unFs8zSoeDC 3BnM50/xQ6pZ2GWvOj4zLirnn+nTqo5N5sbuz0ssfEWNyi0MvXnutUJ7RoWjyEmTTF2G E1S9ZL8LaUISFcZx28cqGBj2xac2Bj2r6Rvp++BPlxhI0VpOVEA2/qWzlnPcXrrkHlg3 ahpv2PevEHbuXT0hgCSc07ONchJScxZcQfLKpXYtkRFNGY+6Y8LHQ0FRedEnddJmZATs qbQuvNpvlhoruQDxBLk38I/u5m1fxyVkz9i/cu3zULhZ/AsNf/Is2MKAfapdFjcS8Ksk 4tmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=H7ntuHSc; 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 s18-20020a632c12000000b0053fc2857c09si5660738pgs.652.2023.06.05.07.55.12; Mon, 05 Jun 2023 07:55: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=H7ntuHSc; 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 S234191AbjFEOf3 (ORCPT + 99 others); Mon, 5 Jun 2023 10:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234073AbjFEOf0 (ORCPT ); Mon, 5 Jun 2023 10:35:26 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E35D483 for ; Mon, 5 Jun 2023 07:35:25 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-256712e2be3so4164100a91.2 for ; Mon, 05 Jun 2023 07:35:25 -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=dIlga4aEN60ywXlLSA8FDXmVhMhXBFpOAsJYxqmr9uM+vgKikDvtVJhfGn0UujVD68 T8S7Gk8aRFepvIAknJmPlG/DywobvMb53WKHJtVRb+u2R/ttfrpFqZN+VdRlpNAdDX2z 6jcd/w85dQjo/6/BiEcg7FE1BlCNqVEdhq9kkPqkpnFd8WG6Gy4xhLsTP+KTEntu08jW LOamLnIFsNh+yTp8lerF4t+lwHJB2F+isx+7R6byHvrua+hb/MCHb+0VjIdpoDy+G8E3 OiwaKngRl4TsxLpP7m51X53DaqQb3Paz2xfyuiZh8EdeR3BTd0Z14NQ1oSzQfBwJvfN+ LdXA== X-Gm-Message-State: AC+VfDyAm01r0C/xWXJRn/KQNDQimdC4bUsl4UN04ZW21RII+otT8hOA PuCglaFkjisaZjSI8UwqEsp7ow== 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-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 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?1767874940026353804?= X-GMAIL-MSGID: =?utf-8?q?1767874940026353804?= 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;