Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1935933rdh; Sat, 25 Nov 2023 07:41:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHn4hGDQNznwo5xYXvGFXhxQNmlTldo5eYgVHzTNzAdLcHT/10TQgZNgoESCpiyQ5Hi4quq X-Received: by 2002:a17:90a:e7c8:b0:285:b6a6:c506 with SMTP id kb8-20020a17090ae7c800b00285b6a6c506mr472446pjb.43.1700926901611; Sat, 25 Nov 2023 07:41:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700926901; cv=none; d=google.com; s=arc-20160816; b=TclNCQEIjuu6VdKi6EA6b+Gbk0jxg6RJiVhkpdTKuuKBBy670sqAqb5pz3hDpk92mt B+g1+c5K8dp0CMrUSQGpnoO1cH5ipj/f/Zg3vKNMottSE7XZ7x+cavlGX7AS7vGm08r/ dnSTV4Q5urexWoZEudi6KEeptVWfiCXYQMTvEXQo3LCPb4ddOZtp1U40GIFTPNwy3zPs 6WFbWjC/F2F2IQz73TqxyNTZaUZnlk27EypxDqiVJb7kqGBQ8V2VLNSecCd+5bx+ScMb QfJ00TGiUEZu+yTkPIeJWEFbNCe5ngIL8P/WnJnwnhuual2Eypdl1m1cNsVll/apj+bn i8fA== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=DZPM3fc1sKx4Gg4S7hWUKEhn04fj5QKwM/8vpdwmNFU=; fh=ti8zFvkqXpvPUcOcSbSl+oG3zUaAiRj4WhJUzxfk+m4=; b=ABfZ8UQ46VeVv2we89PNSr6BPk33HkPFTfUL1ddeMX2e1uCXQBc4Flc9qpo1gC87vH DHgiNfAM0QyjQzmrus82WWqV2SO7yRQdEqG4zH6fsQwkCFL1+cKdjstLTArYMUkyAzCh jHb1NVrtzqyOSW4AA7VOEOCIimFf0ivwcoccRvZ2KMgOdhNSwjjaFeVw9Vhron2G+Wdh XLmyxyFT3MEsCUslQ7yn1GPcFNPDwqX3F35S2mMagijXjrpt4ZTrC99NJiCEDKEZBeY8 cb4NODiqPkKX5mqp1BacRj1IKWFXj77p8qWPJ1V+GfDBw9rYQ5n3MBSed9qZ5KeCL9Yi en5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pYXm/Qsp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id u13-20020a17090adb4d00b0028528a3aab7si6495752pjx.178.2023.11.25.07.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 07:41:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pYXm/Qsp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 138D08083DD1; Sat, 25 Nov 2023 07:41:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232228AbjKYPlW (ORCPT + 99 others); Sat, 25 Nov 2023 10:41:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231976AbjKYPlU (ORCPT ); Sat, 25 Nov 2023 10:41:20 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 996B710D for ; Sat, 25 Nov 2023 07:41:26 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5441305cbd1so3737384a12.2 for ; Sat, 25 Nov 2023 07:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700926885; x=1701531685; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DZPM3fc1sKx4Gg4S7hWUKEhn04fj5QKwM/8vpdwmNFU=; b=pYXm/QspGRx6QRVsuDtOx03EY+AjkRqwAfwRQEK5XxP8ALmm+u4vEn3jHHdMvalMbK fwr+h03WXG03hk9I0BWruk4JgaWinRx29nnvA0FvCpmpR1Geo3ylQeF1KTx4C0Lc4qAz JroU3gVnEIXCHmrngcL7Hl+BK1WgSS+0Oxxatl+8nKiKQ1ND92ca6TQwDyr7izQ/FTDk VmwLqu7HM+l4CuSiPAcjR1Ve/Z60CvttaFPyMgiavV4kRfM9cKAMPfXLYiibFAPM6y8z 8JCCnCifHT8gsiRn/S0X2BlmPWbIO9Bi5ng7SMay/3mB7wwmNOKjU1QN3jWVHvJj9E72 WTnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700926885; x=1701531685; h=content-transfer-encoding:in-reply-to:autocrypt: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=DZPM3fc1sKx4Gg4S7hWUKEhn04fj5QKwM/8vpdwmNFU=; b=wlzflnRQFCg4qo4ZIyBnu0irKn85MsS/Jn4G/2gX4DVAKbQO82+qGlaHp0MgEPt320 es1kL6g8VqO6uFdWDdVeZEdevw2dL91reTa7m4K/HKKU0xcMCNC4YF1sc3NQoJ7xOg78 EZmUFfybN9cUXDPKzBF2yjrnansNvaqd+6zJ5DDoD0UuTM5imu+yOyWYlQm4TEnm1whE c0jy0x+9LFRC9nUc3MOxy+9ANyJ2UCIB+l+DGHgK7H/ZE2fFmdvoupDXxsXhhMrYOI6z GkMPwx1FRo1sqY99qqtMv8PKDV1rVh8LyzOgTsXYAuNWdT45RehOI0Tt8DiBUqmRbO1f 6qOw== X-Gm-Message-State: AOJu0YymUw4Jf0oaASjCtbiS7lA507V6G70t7BxLDoCGQ0ID99WdGHYk EhJ9AuJo2G32fgUWD8KGb5XvCQ== X-Received: by 2002:a50:aac3:0:b0:544:a153:cd19 with SMTP id r3-20020a50aac3000000b00544a153cd19mr3594225edc.41.1700926884918; Sat, 25 Nov 2023 07:41:24 -0800 (PST) Received: from [192.168.201.100] (178235187180.dynamic-4-waw-k-2-3-0.vectranet.pl. [178.235.187.180]) by smtp.gmail.com with ESMTPSA id j26-20020aa7ca5a000000b00548aeeb1a9esm3148429edt.89.2023.11.25.07.41.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Nov 2023 07:41:24 -0800 (PST) Message-ID: <1a3d840d-50d3-474f-89a6-e36a1cb8f5de@linaro.org> Date: Sat, 25 Nov 2023 16:41:22 +0100 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: Bryan O'Donoghue , 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> <44a2b30a-7f8c-44a9-8a74-b09fee2b61b7@linaro.org> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92AyF9rW2G3qisFcwPgvatt7 TXD5E38mLyOPOUyXNj9XpDbt1hNwKQfiidmPh5e7VNAWRnW1iCMMoKqzM1Anzq7e5Afyeifz zRcQPLaqrPjnKqZGL2BKQSZDh6NkI5ZLRhhHQf61fkWcUpTp1oDC6jWVfT7hwRVIQLrrNj9G MpPzrlN4YuAqKeIer1FMt8cq64ifgTzxHzXsMcUdclzq2LTk2RXaPl6Jg/IXWqUClJHbamSk t1bfif3SnmhA6TiNvEpDKPiT3IDs42THU6ygslrBxyROQPWLI9IL1y8S6RtEh8H+NZQWZNzm UQ3imZirlPjxZtvz1BtnnBWS06e7x/UEAguj7VHCuymVgpl2Za17d1jj81YN5Rp5L9GXxkV1 aUEwONM3eCI3qcYm5JNc5X+JthZOWsbIPSC1Rhxz3JmWIwP1udr5E3oNRe9u2LIEq+wH/toH kpPDhTeMkvt4KfE5m5ercid9+ZXAqoaYLUL4HCEw+HW0DXcKDwARAQABzShLb25yYWQgRHli Y2lvIDxrb25yYWQuZHliY2lvQGxpbmFyby5vcmc+wsGOBBMBCAA4FiEEU24if9oCL2zdAAQV R4cBcg5dfFgFAmQ5bqwCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQR4cBcg5dfFjO BQ//YQV6fkbqQCceYebGg6TiisWCy8LG77zV7DB0VMIWJv7Km7Sz0QQrHQVzhEr3trNenZr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eYSrYYnX+UJsSxpzLc/0sT1eRJDEhI4XIQM4ClIzpsCIN5HnVF76UQXh3a9zpwh3dk8i bhN/URmCOTH+LHNJYN/MxY8wuukq877DWB7k86pBs5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <44a2b30a-7f8c-44a9-8a74-b09fee2b61b7@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 fry.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 (fry.vger.email [0.0.0.0]); Sat, 25 Nov 2023 07:41:39 -0800 (PST) On 25.11.2023 16:17, Bryan O'Donoghue wrote: > 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. Oops you're right > > 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. Never say never! Konrad