Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1922121rdh; Sat, 25 Nov 2023 07:17:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkQwK9fo3hToPtLyLqcGf+ysD6GscxnyisCsm86YSv0l6ACQ1ahIeyh4H4ts6qgTnI5VYb X-Received: by 2002:a17:902:c1d5:b0:1cc:3829:8355 with SMTP id c21-20020a170902c1d500b001cc38298355mr5763751plc.12.1700925449012; Sat, 25 Nov 2023 07:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700925448; cv=none; d=google.com; s=arc-20160816; b=YSWJWWYNW0GTJMSuhMTG/P202GiNGF9JT9pXmyIQZDVhZnDnPSvjLT/Cr4g+ds9ys9 NOrOTne0Y1JzgWQtryDq4RGVcAcpW2To1rOHmQaPDzTLaoGZFlN/TV/rrBmtsAkrhT5K Wqg4h7aIaXMqV0tSWyzpckGQa+KRiEbNhu0px/uV0k6OR+K+Rg8c1JtnHRZkI1UZVQqR n8+2pVVExttja4TXaEskHgkNNmpenKpzM5EtCucx/Z1hl8npaAA4Qf60Gf+CbdAHJjI3 YpfPsPAfaM07P0v8UotOKNeWsWBjldvH1wsotce2FLTJkaJt7Jq1u38CU0rd7Tw4ns7j CUFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=L//cXM65lEufA8qopdoTlT0G7CECObDXCb5waukCjRo=; fh=ak+yhwwE5oFsOxwTlYCV6m3337suY361DW85Vd318Lw=; b=ZsSKD36gM7Lkmg/FaCUcYjjfGnUTzjcfLV/HXkL6SBCEGpeMyBWQqaZqXh8prKx97+ 52U4JXqU+/8lhDPsXgLdxR+f7ncAMgR+60MqtdLcHuCiAh062jI2d6xFPdzhBpAzbbCU 196Pd9XfmqNi6GdWlvtI75yntVj/qZA8cAaIuVKDUY1pVSR1VFrJDDTUX7q/5UjIvzi6 VvQ21cU957w5H9xrLS3ywUlM+Lp6wtaQH2ATRlhrfbuzlKhOwIhutfeMdvAkQPXA48CQ IwTHC7pCyG3F7OlgN8ZKaFhcJzgGKwqEILq1XQvmH8bpnDdlxROUNjxPWWuRBPnQpiAT 1LyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ap7yNQ2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u13-20020a17090341cd00b001cf6a75337dsi6209577ple.378.2023.11.25.07.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 07:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ap7yNQ2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5C29B80A441F; Sat, 25 Nov 2023 07:17:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232047AbjKYPRL (ORCPT + 99 others); Sat, 25 Nov 2023 10:17:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbjKYPRK (ORCPT ); Sat, 25 Nov 2023 10:17:10 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5AB6101 for ; Sat, 25 Nov 2023 07:17:15 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40859dee28cso22600515e9.0 for ; Sat, 25 Nov 2023 07:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700925434; x=1701530234; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=L//cXM65lEufA8qopdoTlT0G7CECObDXCb5waukCjRo=; b=Ap7yNQ2moSOX+8m5uas3PtuT63QBqWm6/dD8H9jpRPFgLvz2j41AxuYzYlG0yUT5lV 0qgjyt0H35yUQaGz1Z5kIxSHfSiy6RDgF+aFd0sxZOHMuPgthx2lHoj6MfMDmaRSkV6E qyJBvAxQKuF/zDHeBf4I96rnj13bzHSmsnVW/ZKVZ8jLQG32M/i55hnyFLfBYJP7bAbq g4ASPA3UO5MwqKWgf/mkL+iYjKOlBLv/nslgMnuEUljzRvbsdtLhbDwXb3g/1cDQdfeF rD0blYYsMuAtVA3W/iiIwao5+2A1wbuwFk/f4xk3FwMeH4Kf32FjPJIUwu59TJmJwQGu truw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700925434; x=1701530234; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=L//cXM65lEufA8qopdoTlT0G7CECObDXCb5waukCjRo=; b=VKXr6HeXfCWL7ZWvb+B4xx7wI6QuKvptScqbbG/zWKCuwGVI4YDm9J+pwlNhC7XKYb uBre1RhZB1lHHf9qjUy5hHhuIc5kohfYJJldFnbWDy9pOdIq4g9+X7eTMaB3Nwj4Zp2X oScvbCf+ELrJKUXraeytdRuy3erVAzdAYot/62zz0wJXKPca3D6LpGvnk2zpLuhYLK+M Wsu4CgXNUqdZ2DCodWic4h57k6O5JDIXiGZ4DVD+GkS2pQ69MIHWCxaHC87js/9SJLRh ZoGw+2nfAbJ0Ah4D6MgGtSRPk7JYHq/P0VSazmth1nVyuJhw6DkHIhQAk41k5xE2rE3t Uy8g== X-Gm-Message-State: AOJu0YxKH9w1Idq+s6tcJBvypgM4lunGcGt8cCsvm9nr0P/gl4ZhKLr9 I/ahj7D5g9MWLOEZbU1l3PEz9A== X-Received: by 2002:a05:600c:3550:b0:40b:415e:c044 with SMTP id i16-20020a05600c355000b0040b415ec044mr1056018wmq.37.1700925434011; Sat, 25 Nov 2023 07:17:14 -0800 (PST) Received: from [192.168.100.102] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id a10-20020a056000050a00b0032ddf2804ccsm6798220wrf.83.2023.11.25.07.17.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Nov 2023 07:17:13 -0800 (PST) Message-ID: <44a2b30a-7f8c-44a9-8a74-b09fee2b61b7@linaro.org> Date: Sat, 25 Nov 2023 15:17:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 2/2] irqchip: irq-qcom-mpm: Support passing a slice of SRAM as reg space Content-Language: en-US To: Konrad Dybcio , Andy Gross , Bjorn Andersson , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20230328-topic-msgram_mpm-v6-0-682e4855b7e2@linaro.org> <20230328-topic-msgram_mpm-v6-2-682e4855b7e2@linaro.org> From: Bryan O'Donoghue In-Reply-To: <20230328-topic-msgram_mpm-v6-2-682e4855b7e2@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 07:17:26 -0800 (PST) On 25/11/2023 14:27, Konrad Dybcio wrote: > The MPM hardware is accessible to us from the ARM CPUs through a shared > memory region (RPM MSG RAM) that's also concurrently accessed by other > kinds of cores on the system (like modem, ADSP etc.). Modeling this > relation in a (somewhat) sane manner in the device tree basically > requires us to either present the MPM as a child of said memory region > (which makes little sense, as a mapped memory carveout is not a bus), > define nodes which bleed their register spaces into one another, or > passing their slice of the MSG RAM through some kind of a property. > > Go with the third option and add a way to map a region passed through > the "qcom,rpm-msg-ram" property as our register space. > > The current way of using 'reg' is preserved for ABI reasons. > > Acked-by: Shawn Guo > Signed-off-by: Konrad Dybcio > --- > drivers/irqchip/irq-qcom-mpm.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/drivers/irqchip/irq-qcom-mpm.c b/drivers/irqchip/irq-qcom-mpm.c > index 7124565234a5..7115e3056aa5 100644 > --- a/drivers/irqchip/irq-qcom-mpm.c > +++ b/drivers/irqchip/irq-qcom-mpm.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -322,8 +323,10 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent) > struct device *dev = &pdev->dev; > struct irq_domain *parent_domain; > struct generic_pm_domain *genpd; > + struct device_node *msgram_np; > struct qcom_mpm_priv *priv; > unsigned int pin_cnt; > + struct resource res; > int i, irq; > int ret; > > @@ -374,9 +377,21 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent) > > raw_spin_lock_init(&priv->lock); > > - priv->base = devm_platform_ioremap_resource(pdev, 0); > - if (IS_ERR(priv->base)) > - return PTR_ERR(priv->base); > + /* If we have a handle to an RPM message ram partition, use it. */ > + msgram_np = of_parse_phandle(np, "qcom,rpm-msg-ram", 0); > + if (msgram_np) { > + ret = of_address_to_resource(msgram_np, 0, &res); You are capturing the return value but doing nothing with it. One of if (ret) { of_node_put(msgram_np); return ret; } or just drop the ret = if you are sure of_address_to_resource() can never return an error for your use-case. Once fixed. Reviewed-by: Bryan O'Donoghue