Message ID | 20230325134410.21092-2-me@dylanvanassche.be |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp423207vqo; Sat, 25 Mar 2023 06:59:29 -0700 (PDT) X-Google-Smtp-Source: AKy350aN8/+LhRunfMd05AmQ6KdInNJKJBOUN932cUFOelkOeKWY4IWtGpz9iPkMuR6fZfdOHatG X-Received: by 2002:aa7:c954:0:b0:501:daae:80ce with SMTP id h20-20020aa7c954000000b00501daae80cemr5704149edt.12.1679752769202; Sat, 25 Mar 2023 06:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679752769; cv=none; d=google.com; s=arc-20160816; b=YzOGYgWk9RO5VMqgVtpk/JcCNQjcqQ25Rg1zQFQUEQfFFU0Au2wnR0LwMrSWUdramv JDHGk/xwmfC8M4YH9CZo+5dokNJxofC0qNaVr2U/RBkHUVHRbyBQ8MtYfH4efskxPR7h mN9+8ZkdVianBY9DxuQfjQlIQmZI5PO+4xfvsEPGYbmrpHaYcWiEkB3XrVE413bcHCPq LrO5PAcZEdtun1xPrCGxVWEt/58yM51JQQj/ro2LjbuU+bqkthSZhamfcOwAgpYaXNFi J4PSSLWD5tYmZJbFOnpt4IEN0rgReIr0njyS/3Cq4g+a+SaF/0/xvJyPK3g3SSvBQFvG oHWw== 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=egp86lPSAVRoHmUI43dTRCeOVXvgb3RGUlpfI0Vk4PA=; b=Tim26OjMVbnjlvGYIixIzBbAwtG7Bi8g3YuMLKcwZ8/yXiZKOsTAbFztW5sJcRLPi9 Y3q9ZTOzug9Lc362yAW9DnMyr5WV2/GtLZ5MEMX0I8faqrO3O2vVIl+PDpeC9yS8u4j3 HRDoy06mFhlD3l2Ilu6zzst2g8SKtU27Soyvl55Zd+pAiI/UdXnT+rNGKvBA/OCwIB+e 6fukJxMU1u0OUs1wl2XzfUE+VRdEjpQBFEMJVufOW3oAVeBiHhrEvJjyqRTrVcbnUbBr Knqa+nlfjgmulSYkYgGVNAAAAqvBleh9DcbHQRHMS8tJjzJLRIIdioH3AqrpJa7lSS0J rRMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=bRbRi8Gm; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pw9-20020a17090720a900b0092bc0619e06si23202110ejb.619.2023.03.25.06.59.06; Sat, 25 Mar 2023 06:59:29 -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=@dylanvanassche.be header.s=MBO0001 header.b=bRbRi8Gm; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbjCYNoe (ORCPT <rfc822;makky5685@gmail.com> + 99 others); Sat, 25 Mar 2023 09:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbjCYNoc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 25 Mar 2023 09:44:32 -0400 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050:0:465::202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E23AA113C4; Sat, 25 Mar 2023 06:44:30 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PkL0W40KBz9sZv; Sat, 25 Mar 2023 14:44:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1679751867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=egp86lPSAVRoHmUI43dTRCeOVXvgb3RGUlpfI0Vk4PA=; b=bRbRi8GmlCcub2pA68xfLa+vh5b+s+MRzOsU1UX0hkaBml3By0iR4T5sexKIdmrh9OtZ8+ enyQVMYOgMy9kHeX7N9v4qJO58Ms8wart++vVDf1O+0IP1A27dOmTq30zlnNesObAyio7a IepYHY+w4PR0UGnoLF6K0DvhUgfcce94GeErVd3Vz45EsWyiex+CL1QNarAD9LUl/4JdXG yJ0L9EmLngPJk3FGnz8EA0Q8UwdZ5XgohTszdS+ZbdSWU0mxziVikORsnJOFDUPwCO/vZI hC2Fk+mFVG8KV1jY8LNfOkbZmvAeTTvw+PaK3DtFzK4U/YZ/Rg23jxqyn236Xw== From: Dylan Van Assche <me@dylanvanassche.be> To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Amol Maheshwari <amahesh@qti.qualcomm.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: Konrad Dybcio <konrad.dybcio@linaro.org>, Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Dylan Van Assche <me@dylanvanassche.be> Subject: [PATCH 1/2] dt-bindings: misc: qcom,fastrpc: add qcom,assign-all-memory property Date: Sat, 25 Mar 2023 14:44:09 +0100 Message-Id: <20230325134410.21092-2-me@dylanvanassche.be> In-Reply-To: <20230325134410.21092-1-me@dylanvanassche.be> References: <20230325134410.21092-1-me@dylanvanassche.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4PkL0W40KBz9sZv X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761348439941555836?= X-GMAIL-MSGID: =?utf-8?q?1761348439941555836?= |
Series |
FastRPC reserved memory assignment for SDM845 SLPI
|
|
Commit Message
Dylan Van Assche
March 25, 2023, 1:44 p.m. UTC
Document the added qcom,assign-all-memory in devicetree bindings.
Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
---
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On 25/03/2023 14:44, Dylan Van Assche wrote: > Document the added qcom,assign-all-memory in devicetree bindings. > > Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> > --- > Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > index 1ab9588cdd89..fa5b00534b30 100644 > --- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > +++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > @@ -57,6 +57,12 @@ properties: > Virtual machine IDs for remote processor. > $ref: "/schemas/types.yaml#/definitions/uint32-array" > > + qcom,assign-all-mem: > + description: > + Assign memory to all Virtual machines defined by qcom,vmids. This (neither commit msg) does not explain why this is needed and actually does not sound like hardware-related property. > + type: boolean > + > + Do not add double blank lines. > "#address-cells": > const: 1 > Best regards, Krzysztof
Hi Krzysztof, On Sun, 2023-03-26 at 10:55 +0200, Krzysztof Kozlowski wrote: > On 25/03/2023 14:44, Dylan Van Assche wrote: > > Document the added qcom,assign-all-memory in devicetree bindings. > > > > Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> > > --- > > Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 6 > > ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git > > a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > index 1ab9588cdd89..fa5b00534b30 100644 > > --- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > +++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > @@ -57,6 +57,12 @@ properties: > > Virtual machine IDs for remote processor. > > $ref: "/schemas/types.yaml#/definitions/uint32-array" > > > > + qcom,assign-all-mem: > > + description: > > + Assign memory to all Virtual machines defined by qcom,vmids. > > This (neither commit msg) does not explain why this is needed and > actually does not sound like hardware-related property. This is made a separate property to toggle different behavior in the driver if it is needed for some FastRPC nodes. Downstream does guard this with a property 'restrict-access' as well, see [1] for a random SDM845 downstream kernel. On SDM845, this property is not present, thus the IF block runs. On SDM670, this property is present, then the IF block is skipped. That's why I opt for this property to have this behaviour conditionally. I'm not sure how to explain it better though. Any feedback is appreciated, thanks! Kind regards, Dylan Van Assche [1] https://github.com/SHIFTPHONES/android_kernel_shift_sdm845/blob/sos-3.x/drivers/char/adsprpc.c#L4615-L4631 > > > + type: boolean > > + > > + > > Do not add double blank lines. > > > "#address-cells": > > const: 1 > > > > Best regards, > Krzysztof >
On 27/03/2023 13:37, Dylan Van Assche wrote: > Hi Krzysztof, > > On Sun, 2023-03-26 at 10:55 +0200, Krzysztof Kozlowski wrote: >> On 25/03/2023 14:44, Dylan Van Assche wrote: >>> Document the added qcom,assign-all-memory in devicetree bindings. >>> >>> Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> >>> --- >>> Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 6 >>> ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git >>> a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml >>> b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml >>> index 1ab9588cdd89..fa5b00534b30 100644 >>> --- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml >>> +++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml >>> @@ -57,6 +57,12 @@ properties: >>> Virtual machine IDs for remote processor. >>> $ref: "/schemas/types.yaml#/definitions/uint32-array" >>> >>> + qcom,assign-all-mem: >>> + description: >>> + Assign memory to all Virtual machines defined by qcom,vmids. >> >> This (neither commit msg) does not explain why this is needed and >> actually does not sound like hardware-related property. > > This is made a separate property to toggle different behavior in the > driver if it is needed for some FastRPC nodes. Bindings are not for driver behavior. > Downstream does guard > this with a property 'restrict-access' as well, see [1] for a random > SDM845 downstream kernel. On SDM845, this property is not present, thus > the IF block runs. On SDM670, this property is present, then the IF > block is skipped. That's why I opt for this property to have this > behaviour conditionally. I'm not sure how to explain it better though. Still you described driver... Please come with something more hardware related. Best regards, Krzysztof
Hi Krzysztof, On Mon, 2023-03-27 at 14:22 +0200, Krzysztof Kozlowski wrote: > On 27/03/2023 13:37, Dylan Van Assche wrote: > > Hi Krzysztof, > > > > On Sun, 2023-03-26 at 10:55 +0200, Krzysztof Kozlowski wrote: > > > On 25/03/2023 14:44, Dylan Van Assche wrote: > > > > Document the added qcom,assign-all-memory in devicetree > > > > bindings. > > > > > > > > Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> > > > > --- > > > > Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 6 > > > > ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > diff --git > > > > a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > index 1ab9588cdd89..fa5b00534b30 100644 > > > > --- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > +++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > @@ -57,6 +57,12 @@ properties: > > > > Virtual machine IDs for remote processor. > > > > $ref: "/schemas/types.yaml#/definitions/uint32-array" > > > > > > > > + qcom,assign-all-mem: > > > > + description: > > > > + Assign memory to all Virtual machines defined by > > > > qcom,vmids. > > > > > > This (neither commit msg) does not explain why this is needed and > > > actually does not sound like hardware-related property. > > > > This is made a separate property to toggle different behavior in > > the > > driver if it is needed for some FastRPC nodes. > > Bindings are not for driver behavior. > > > Downstream does guard > > this with a property 'restrict-access' as well, see [1] for a > > random > > SDM845 downstream kernel. On SDM845, this property is not present, > > thus > > the IF block runs. On SDM670, this property is present, then the IF > > block is skipped. That's why I opt for this property to have this > > behaviour conditionally. I'm not sure how to explain it better > > though. > > Still you described driver... Please come with something more > hardware > related. So just updating the description is enough then? As this is all reverse engineered, I have no access to the documentation of FastRPC, so best effort: """ Mark allocated memory region accessible to remote processor. This memory region is used by remote processor to communicate when no dedicated Fastrpc context bank hardware is available for remote processor. """ Is this the description that is 'more hardware related'? Kind regards, Dylan Van Assche > > Best regards, > Krzysztof >
On Mon, 27 Mar 2023 at 17:27, Dylan Van Assche <me@dylanvanassche.be> wrote: > > Hi Krzysztof, > > On Mon, 2023-03-27 at 14:22 +0200, Krzysztof Kozlowski wrote: > > On 27/03/2023 13:37, Dylan Van Assche wrote: > > > Hi Krzysztof, > > > > > > On Sun, 2023-03-26 at 10:55 +0200, Krzysztof Kozlowski wrote: > > > > On 25/03/2023 14:44, Dylan Van Assche wrote: > > > > > Document the added qcom,assign-all-memory in devicetree > > > > > bindings. > > > > > > > > > > Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> > > > > > --- > > > > > Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml | 6 > > > > > ++++++ > > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > diff --git > > > > > a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > > b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > > index 1ab9588cdd89..fa5b00534b30 100644 > > > > > --- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > > +++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml > > > > > @@ -57,6 +57,12 @@ properties: > > > > > Virtual machine IDs for remote processor. > > > > > $ref: "/schemas/types.yaml#/definitions/uint32-array" > > > > > > > > > > + qcom,assign-all-mem: > > > > > + description: > > > > > + Assign memory to all Virtual machines defined by > > > > > qcom,vmids. > > > > > > > > This (neither commit msg) does not explain why this is needed and > > > > actually does not sound like hardware-related property. > > > > > > This is made a separate property to toggle different behavior in > > > the > > > driver if it is needed for some FastRPC nodes. > > > > Bindings are not for driver behavior. > > > > > Downstream does guard > > > this with a property 'restrict-access' as well, see [1] for a > > > random > > > SDM845 downstream kernel. On SDM845, this property is not present, > > > thus > > > the IF block runs. On SDM670, this property is present, then the IF > > > block is skipped. That's why I opt for this property to have this > > > behaviour conditionally. I'm not sure how to explain it better > > > though. > > > > Still you described driver... Please come with something more > > hardware > > related. > > So just updating the description is enough then? > > As this is all reverse engineered, I have no access to the > documentation of FastRPC, so best effort: Vendor kernels put a lot of controls into DT, despite some of these controls being related to software or being a platform constant. Upstream tends to push some of the constraints into the driver data, leaving only variadic parts in DT. Could you please check if the property you are proposing is constant among the devices on a platform or not. If it is a platform peculiarity, a usual way is to add it to driver data rather than the DT. > > """ > Mark allocated memory region accessible to remote processor. > This memory region is used by remote processor to communicate > when no dedicated Fastrpc context bank hardware is available > for remote processor. > """ > > Is this the description that is 'more hardware related'?
On 27/03/2023 16:26, Dylan Van Assche wrote: >> Bindings are not for driver behavior. >> >>> Downstream does guard >>> this with a property 'restrict-access' as well, see [1] for a >>> random >>> SDM845 downstream kernel. On SDM845, this property is not present, >>> thus >>> the IF block runs. On SDM670, this property is present, then the IF >>> block is skipped. That's why I opt for this property to have this >>> behaviour conditionally. I'm not sure how to explain it better >>> though. >> >> Still you described driver... Please come with something more >> hardware >> related. > > So just updating the description is enough then? > > As this is all reverse engineered, I have no access to the > documentation of FastRPC, so best effort: > > """ > Mark allocated memory region accessible to remote processor. > This memory region is used by remote processor to communicate > when no dedicated Fastrpc context bank hardware is available > for remote processor. This description does not explain here anything. The memory region is already accessible without this property. You described the desired Linux feature or behavior, not the actual hardware. The bindings are about the latter, so instead you need to rephrase the property and its description to match actual hardware capabilities/features/configuration etc. Remember that any arguments to downstream are not really good arguments. Their design choices and bindings are usually totally not acceptable. They simply embed whatever driver needs in DT - policies, system configuration, driver behavior... Also, Dmitry made here good point. Best regards, Krzysztof
Hi Dmitry & Krzysztof, On Mon, 2023-03-27 at 16:36 +0200, Krzysztof Kozlowski wrote: > On 27/03/2023 16:26, Dylan Van Assche wrote: > > > Bindings are not for driver behavior. > > > > > > > Downstream does guard > > > > this with a property 'restrict-access' as well, see [1] for a > > > > random > > > > SDM845 downstream kernel. On SDM845, this property is not > > > > present, > > > > thus > > > > the IF block runs. On SDM670, this property is present, then > > > > the IF > > > > block is skipped. That's why I opt for this property to have > > > > this > > > > behaviour conditionally. I'm not sure how to explain it better > > > > though. > > > > > > Still you described driver... Please come with something more > > > hardware > > > related. > > > > So just updating the description is enough then? > > > > As this is all reverse engineered, I have no access to the > > documentation of FastRPC, so best effort: > > > > """ > > Mark allocated memory region accessible to remote processor. > > This memory region is used by remote processor to communicate > > when no dedicated Fastrpc context bank hardware is available > > for remote processor. > > This description does not explain here anything. The memory region is > already accessible without this property. > > You described the desired Linux feature or behavior, not the actual > hardware. The bindings are about the latter, so instead you need to > rephrase the property and its description to match actual hardware > capabilities/features/configuration etc. > > Remember that any arguments to downstream are not really good > arguments. > Their design choices and bindings are usually totally not acceptable. > They simply embed whatever driver needs in DT - policies, system > configuration, driver behavior... > > Also, Dmitry made here good point. > > I agree, downstream is not doing great on being upstreamable. Thanks Dmitry, your explanation makes it pretty clear what I should figure out. This helps a lot! As far as I know, this assignment is only skipped when the sensors are not on the SLPI but on the ADSP e.g. SDM670, thus mid range SoCs. So reading these comments, this looks more like 'driver behavior' which should not end up in bindings as mentioned above. As I now understand the problem with this property, I will rework it for v2 and drop it. This is only done for the SLPI so by guarding it with a domain ID check we should be able to avoid the property in the bindings. Thanks for the feedback & patience! I really learned a lot! Kind regards, Dylan Van Assche > > Best regards, > Krzysztof >
diff --git a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml index 1ab9588cdd89..fa5b00534b30 100644 --- a/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml +++ b/Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml @@ -57,6 +57,12 @@ properties: Virtual machine IDs for remote processor. $ref: "/schemas/types.yaml#/definitions/uint32-array" + qcom,assign-all-mem: + description: + Assign memory to all Virtual machines defined by qcom,vmids. + type: boolean + + "#address-cells": const: 1