Message ID | 20230504145737.286444-8-joychakr@google.com |
---|---|
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 b10csp404858vqo; Thu, 4 May 2023 08:24:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77eGZe2JICd3VXbDk/a4sqIKNO2OFx/SldZ+FU49vfb/qmPCTDFIrP1FrlE2Sn5SiSVSqc X-Received: by 2002:a17:90a:6788:b0:250:1b4c:d861 with SMTP id o8-20020a17090a678800b002501b4cd861mr533967pjj.13.1683213875045; Thu, 04 May 2023 08:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683213875; cv=none; d=google.com; s=arc-20160816; b=Z7i+9wfaH2q6Zlz/r4mJHegA+XkXTUYmCcvN5kRcMZ0OK5+SLJehy2sZ3ostZsKvJm QzjkEd3GBuoSDUCuOMK5vYj1iDM04wEnxYxhZt5iEauT7UfFnVAWWE2m5sufUoc8E1FG 33fby13GMHqlMTnIxJ0UvsYZeStPWW5KpzPfmW+ewIZUrks8+cV/KNnylDUzsGIa9DDY eCe/xu1QND8luukWZEP4dQCIv8Qwnf9PHWPRnWkHtIQ4qb05BMPcEsOoGBgG+ulr2KMT nhbpgPWWSD5826LChUBVf16UQlOa6ZzVhJoksUhxWBv9BW9SiQ9GnYdMCpb/bceS4/60 lKew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=h8IvnB7h0HAb5+pIi9GxWOAfPdgUl4BJHVh6FYr/ed4=; b=G0IQXtvsh3a8zV9YEVwIGDxuzhXD5SqNcRO+Gd6lcWTU/fwPi/8KYcxcU+zOyhhgIY lfKph32ZJfghL1GV8D4PgK12/eAZp2bWQx7EYbY98KkBFtw0U+eaBN49NGgKz1EEL07p UI6LxnCIG3wVhWTCEg4FHcPRsKIrbAb3PWaa/+3gExt9DAemx2ZQqb89awOFjTsFFuNy J0jF0HEKFIWOXQaMnVFZX7mRmLpY+xi+CA2hTBUIr2U051JZZtP1ALyRMWSap3ybbVv7 mE27dhnewR/2EoZCHDHX9qNkBKS/QTkhdJ5dPwXJVwDWXa5sh2ZagXwTcUAGOKvFZ7FN +uHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=kuPcLL3Y; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a63cf0d000000b0051f0bd40bb0si32665300pgg.779.2023.05.04.08.24.22; Thu, 04 May 2023 08:24:35 -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=@google.com header.s=20221208 header.b=kuPcLL3Y; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231351AbjEDO7h (ORCPT <rfc822;b08248@gmail.com> + 99 others); Thu, 4 May 2023 10:59:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231246AbjEDO7H (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 4 May 2023 10:59:07 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222A1359B for <linux-kernel@vger.kernel.org>; Thu, 4 May 2023 07:58:46 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-b9a79db4e7fso770190276.0 for <linux-kernel@vger.kernel.org>; Thu, 04 May 2023 07:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212314; x=1685804314; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=h8IvnB7h0HAb5+pIi9GxWOAfPdgUl4BJHVh6FYr/ed4=; b=kuPcLL3YoUQz+usR6xPzkJy7Qzr+xCOBwv6dT38Ejb2rkKMHl6Kndt9vgn2RH4iitP GJzORCEA21O3g7/+GS33g9uei5QHrpLimIHK6fsQUacmH2Ffj7SjKmI206Xa7q3FfAQi y0KxVKkNxuqVL/Y5uOl7Vn77LsMWYTuLC9BGNUjEoBMOCy3RNHDuPInha6yTRnHysOvv 87lKZJwjKlaTS/8g3dW2kRdfZ59pgJYwl/S5nwAj4svodlkgx0dFw2640Q/nGRWC7fPl qDXmBQWzRWA9JPZf/U42JKCVkiRpstLjCijuixLhhfkoz85C07G08kXg+HuqmmsDwhzu hgkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212314; x=1685804314; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h8IvnB7h0HAb5+pIi9GxWOAfPdgUl4BJHVh6FYr/ed4=; b=bcE3eZnONHKMbLxKybfYOhufMVElvVgiFQX0tUXGFiPyUvhEyCL/Q2EDIRbW6id42p qmrYed68rnfMVDjd/wRIdR8cmmMbje52RDRHGUIERh/61I9Q0o2s85YQk3q8TA+DA93W vVWuH9hqoCUswiyUNXhzaN7IDoBvqeoxqT5K7DCgpL5AVW/a+oQfvaqn+29+NLYmNd83 KNgOsX2V77JwhfGJ6JtBcGIDlYwt9tVWC32nJw52XorYVrLso5aT6fJecTrTbKGhVBp7 5J6KSfcAb4EjG67BpKb6BUuhkkaqciCjerwr1VvblgfT/W6a7p1FBUMgk19fB10HnJ6B /Jpg== X-Gm-Message-State: AC+VfDxlp9S1nxYSpwPy92U90Zp1RzpKArygO3vNI/8IsJa5oltmyhMs /1bm9S/YZioFJWuvtsv0l2Uv6l+3S/LD3g== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:6902:c2:b0:b96:7676:db4a with SMTP id i2-20020a05690200c200b00b967676db4amr152609ybs.0.1683212314520; Thu, 04 May 2023 07:58:34 -0700 (PDT) Date: Thu, 4 May 2023 14:57:37 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-8-joychakr@google.com> Subject: [PATCH 7/7] dt-bindings: dmaengine: pl330: Add new quirks From: Joy Chakraborty <joychakr@google.com> To: Vinod Koul <vkoul@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty <joychakr@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham 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?1764977166444638634?= X-GMAIL-MSGID: =?utf-8?q?1764977671871672692?= |
Series |
dmaengine: pl330: Updates and new quirks for peripheral usecases
|
|
Commit Message
Joy Chakraborty
May 4, 2023, 2:57 p.m. UTC
Add 2 new quirks added to the driver "arm,pl330-optimize-dev2mem-axsize"
and "arm,pl330-periph-single-dregs"
Signed-off-by: Joy Chakraborty <joychakr@google.com>
---
Documentation/devicetree/bindings/dma/arm,pl330.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On Thu, May 4, 2023 at 8:38 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 04/05/2023 16:57, Joy Chakraborty wrote: > > Add 2 new quirks added to the driver "arm,pl330-optimize-dev2mem-axsize" > > and "arm,pl330-periph-single-dregs" > > This we can see from the diff. You need to answer why? > Sure will change it to: " Addition of following quirks : - "arm,pl330-periph-use-diff-axsize" AxSize of transactions to peripherals are limited by the peripheral address width which inturn limits the AxSize used for transactions towards memory. This quirk will make transactions to memory use the maximum possible bus width(AxSize), store data in MFIFO and use narrow multi-beat transactions to move data to peripherals. This only applies to transfers between memory and peripherals where bus widths available are different for memory and the peripheral. - "arm,pl330-periph-complete-with-singles" : When transfer sizes are not a multiple of a block of burst transfers (AxLen * AxSize configured at the peripheral), certain peripherals might choose not to set the burst request at the peripheral request interface of the DMA. This quirk moves the remaining bytes to the peripheral using single transactions. " > > > > Signed-off-by: Joy Chakraborty <joychakr@google.com> > > --- > > Documentation/devicetree/bindings/dma/arm,pl330.yaml | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/dma/arm,pl330.yaml b/Documentation/devicetree/bindings/dma/arm,pl330.yaml > > index 4a3dd6f5309b..0499a7fba88d 100644 > > --- a/Documentation/devicetree/bindings/dma/arm,pl330.yaml > > +++ b/Documentation/devicetree/bindings/dma/arm,pl330.yaml > > @@ -53,6 +53,14 @@ properties: > > type: boolean > > description: quirk for performing burst transfer only > > > > + arm,pl330-optimize-dev2mem-axsize: > > + type: boolean > > + description: quirk for optimizing AxSize used between dev<->mem > > This tells me nothing... Neither what it is about nor why this is > property of a board or PL330 hardware implementation. Please describe > hardware, not drivers. > Will change the name to "arm,pl330-periph-use-diff-axsize" and add description: " Quirk to use different AxSize for bursts while accessing source and destination when moving data between memory and peripheral. Maximum possible bus width is used as AxSize for transactions towards memory and transactions towards peripherals use AxSize as per peripheral address width. " > > + > > + arm,pl330-periph-single-dregs: > > + type: boolean > > + description: quirk for using dma-singles for peripherals in _dregs() > > Same concerns. > Will change the name to "arm,pl330-periph-complete-with-singles" and add description: " Quirk to use dma singles n times instead of an n beat burst to complete a transfer when the transfer size is not a multiple of the burst size and burst length configured at the peripheral. n being bytes left after the major chunk is transferred with peripheral configured burst transactions. " > > Best regards, > Krzysztof > Will update the patch series if this is satisfactory. Thanks Joy
On 05/05/2023 11:44, Joy Chakraborty wrote: > On Thu, May 4, 2023 at 8:38 PM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 04/05/2023 16:57, Joy Chakraborty wrote: >>> Add 2 new quirks added to the driver "arm,pl330-optimize-dev2mem-axsize" >>> and "arm,pl330-periph-single-dregs" >> >> This we can see from the diff. You need to answer why? >> > > Sure will change it to: > " > Addition of following quirks : > - "arm,pl330-periph-use-diff-axsize" > AxSize of transactions to peripherals are limited by the peripheral > address width which inturn limits the AxSize used for transactions > towards memory. > This quirk will make transactions to memory use the maximum > possible bus width(AxSize), store data in MFIFO and use narrow > multi-beat transactions to move data to peripherals. > This only applies to transfers between memory and peripherals where > bus widths available are different for memory and the peripheral. > - "arm,pl330-periph-complete-with-singles" : > When transfer sizes are not a multiple of a block of burst > transfers (AxLen * AxSize configured at the peripheral), certain > peripherals might choose not to set the burst request at the > peripheral request interface of the DMA. > This quirk moves the remaining bytes to the peripheral using single > transactions. > " This does not answer why. You just copied again the patch contents. > >>> >>> Signed-off-by: Joy Chakraborty <joychakr@google.com> >>> --- >>> Documentation/devicetree/bindings/dma/arm,pl330.yaml | 8 ++++++++ >>> 1 file changed, 8 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/dma/arm,pl330.yaml b/Documentation/devicetree/bindings/dma/arm,pl330.yaml >>> index 4a3dd6f5309b..0499a7fba88d 100644 >>> --- a/Documentation/devicetree/bindings/dma/arm,pl330.yaml >>> +++ b/Documentation/devicetree/bindings/dma/arm,pl330.yaml >>> @@ -53,6 +53,14 @@ properties: >>> type: boolean >>> description: quirk for performing burst transfer only >>> >>> + arm,pl330-optimize-dev2mem-axsize: >>> + type: boolean >>> + description: quirk for optimizing AxSize used between dev<->mem >> >> This tells me nothing... Neither what it is about nor why this is >> property of a board or PL330 hardware implementation. Please describe >> hardware, not drivers. >> > > Will change the name to "arm,pl330-periph-use-diff-axsize" and add description: > " > Quirk to use different AxSize for bursts while accessing source and > destination when moving data between memory and peripheral. > Maximum possible bus width is used as AxSize for transactions towards > memory and transactions towards peripherals use AxSize as per > peripheral address width. > " Still no answer. Why this is property of a board or PL330 hardware implementation? I also asked to describe hardware but I still see "quirk to ...". We use "quirk" as concept in Linux driver. Describe the hardware, not Linux driver. > >>> + >>> + arm,pl330-periph-single-dregs: >>> + type: boolean >>> + description: quirk for using dma-singles for peripherals in _dregs() >> >> Same concerns. >> > > Will change the name to "arm,pl330-periph-complete-with-singles" and > add description: > " > Quirk to use dma singles n times instead of an n beat burst to > complete a transfer when the transfer size is not a multiple of the No, how you wrote it sounds like driver. Don't add driver quirks to DT. Best regards, Krzysztof
On Fri, May 5, 2023 at 5:53 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 05/05/2023 11:44, Joy Chakraborty wrote: > > On Thu, May 4, 2023 at 8:38 PM Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > >> > >> On 04/05/2023 16:57, Joy Chakraborty wrote: > >>> Add 2 new quirks added to the driver "arm,pl330-optimize-dev2mem-axsize" > >>> and "arm,pl330-periph-single-dregs" > >> > >> This we can see from the diff. You need to answer why? > >> > > > > Sure will change it to: > > " > > Addition of following quirks : > > - "arm,pl330-periph-use-diff-axsize" > > AxSize of transactions to peripherals are limited by the peripheral > > address width which inturn limits the AxSize used for transactions > > towards memory. > > This quirk will make transactions to memory use the maximum > > possible bus width(AxSize), store data in MFIFO and use narrow > > multi-beat transactions to move data to peripherals. > > This only applies to transfers between memory and peripherals where > > bus widths available are different for memory and the peripheral. > > - "arm,pl330-periph-complete-with-singles" : > > When transfer sizes are not a multiple of a block of burst > > transfers (AxLen * AxSize configured at the peripheral), certain > > peripherals might choose not to set the burst request at the > > peripheral request interface of the DMA. > > This quirk moves the remaining bytes to the peripheral using single > > transactions. > > " > > This does not answer why. You just copied again the patch contents. > Hi Krzysztof, Both the changes could be useful for SOC's which have PL330 integrated with a peripheral but I am not sure if all SOC's need/want this change hence wanted to keep it as a DT knob to avoid any regressions. But like you say it might not be the right thing to do. > > > >>> > >>> Signed-off-by: Joy Chakraborty <joychakr@google.com> > >>> --- > >>> Documentation/devicetree/bindings/dma/arm,pl330.yaml | 8 ++++++++ > >>> 1 file changed, 8 insertions(+) > >>> > >>> diff --git a/Documentation/devicetree/bindings/dma/arm,pl330.yaml b/Documentation/devicetree/bindings/dma/arm,pl330.yaml > >>> index 4a3dd6f5309b..0499a7fba88d 100644 > >>> --- a/Documentation/devicetree/bindings/dma/arm,pl330.yaml > >>> +++ b/Documentation/devicetree/bindings/dma/arm,pl330.yaml > >>> @@ -53,6 +53,14 @@ properties: > >>> type: boolean > >>> description: quirk for performing burst transfer only > >>> > >>> + arm,pl330-optimize-dev2mem-axsize: > >>> + type: boolean > >>> + description: quirk for optimizing AxSize used between dev<->mem > >> > >> This tells me nothing... Neither what it is about nor why this is > >> property of a board or PL330 hardware implementation. Please describe > >> hardware, not drivers. > >> > > > > Will change the name to "arm,pl330-periph-use-diff-axsize" and add description: > > " > > Quirk to use different AxSize for bursts while accessing source and > > destination when moving data between memory and peripheral. > > Maximum possible bus width is used as AxSize for transactions towards > > memory and transactions towards peripherals use AxSize as per > > peripheral address width. > > " > > Still no answer. Why this is property of a board or PL330 hardware > implementation? > I also asked to describe hardware but I still see "quirk to ...". We use > "quirk" as concept in Linux driver. Describe the hardware, not Linux driver. > This comes to use when the bus width requirement between peripheral and memory is different, but buswidth is something we read from HW registers so this can be enabled by default. > > > > >>> + > >>> + arm,pl330-periph-single-dregs: > >>> + type: boolean > >>> + description: quirk for using dma-singles for peripherals in _dregs() > >> > >> Same concerns. > >> An example of such a case is given in the ARM TRM for PL330, so maybe we can have this by default as well. Link : https://developer.arm.com/documentation/ddi0424/d/functional-overview/peripheral-request-interface/dmac-length-management#:~:text=DMAC%20length%20management-,Example%202.3,-shows%20a%20DMAC > > > > Will change the name to "arm,pl330-periph-complete-with-singles" and > > add description: > > " > > Quirk to use dma singles n times instead of an n beat burst to > > complete a transfer when the transfer size is not a multiple of the > > No, how you wrote it sounds like driver. Don't add driver quirks to DT. > > Best regards, > Krzysztof > Hi Vinod Kaul, Do you think it is feasible to enable these changes by default instead of a DT property ? Thanks Joy
On 08/05/2023 13:58, Joy Chakraborty wrote: > On Fri, May 5, 2023 at 5:53 PM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 05/05/2023 11:44, Joy Chakraborty wrote: >>> On Thu, May 4, 2023 at 8:38 PM Krzysztof Kozlowski >>> <krzysztof.kozlowski@linaro.org> wrote: >>>> >>>> On 04/05/2023 16:57, Joy Chakraborty wrote: >>>>> Add 2 new quirks added to the driver "arm,pl330-optimize-dev2mem-axsize" >>>>> and "arm,pl330-periph-single-dregs" >>>> >>>> This we can see from the diff. You need to answer why? >>>> >>> >>> Sure will change it to: >>> " >>> Addition of following quirks : >>> - "arm,pl330-periph-use-diff-axsize" >>> AxSize of transactions to peripherals are limited by the peripheral >>> address width which inturn limits the AxSize used for transactions >>> towards memory. >>> This quirk will make transactions to memory use the maximum >>> possible bus width(AxSize), store data in MFIFO and use narrow >>> multi-beat transactions to move data to peripherals. >>> This only applies to transfers between memory and peripherals where >>> bus widths available are different for memory and the peripheral. >>> - "arm,pl330-periph-complete-with-singles" : >>> When transfer sizes are not a multiple of a block of burst >>> transfers (AxLen * AxSize configured at the peripheral), certain >>> peripherals might choose not to set the burst request at the >>> peripheral request interface of the DMA. >>> This quirk moves the remaining bytes to the peripheral using single >>> transactions. >>> " >> >> This does not answer why. You just copied again the patch contents. >> > Hi Krzysztof, > Both the changes could be useful for SOC's which have PL330 integrated > with a peripheral What do you mean here by "PL330 integrated with a peripheral"? > but I am not sure if all SOC's need/want this change > hence wanted to keep it as a DT knob to avoid any regressions. > But like you say it might not be the right thing to do. Devicetree is for describing hardware, not the contents of registers of a device. Your changes might fit or might not, I don't know this good enough, so I wait for your justification. Without justification this looks like controlling driver from DT... > >>> >>>>> >>>>> Signed-off-by: Joy Chakraborty <joychakr@google.com> >>>>> --- >>>>> Documentation/devicetree/bindings/dma/arm,pl330.yaml | 8 ++++++++ >>>>> 1 file changed, 8 insertions(+) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/dma/arm,pl330.yaml b/Documentation/devicetree/bindings/dma/arm,pl330.yaml >>>>> index 4a3dd6f5309b..0499a7fba88d 100644 >>>>> --- a/Documentation/devicetree/bindings/dma/arm,pl330.yaml >>>>> +++ b/Documentation/devicetree/bindings/dma/arm,pl330.yaml >>>>> @@ -53,6 +53,14 @@ properties: >>>>> type: boolean >>>>> description: quirk for performing burst transfer only >>>>> >>>>> + arm,pl330-optimize-dev2mem-axsize: >>>>> + type: boolean >>>>> + description: quirk for optimizing AxSize used between dev<->mem >>>> >>>> This tells me nothing... Neither what it is about nor why this is >>>> property of a board or PL330 hardware implementation. Please describe >>>> hardware, not drivers. >>>> >>> >>> Will change the name to "arm,pl330-periph-use-diff-axsize" and add description: >>> " >>> Quirk to use different AxSize for bursts while accessing source and >>> destination when moving data between memory and peripheral. >>> Maximum possible bus width is used as AxSize for transactions towards >>> memory and transactions towards peripherals use AxSize as per >>> peripheral address width. >>> " >> >> Still no answer. Why this is property of a board or PL330 hardware >> implementation? >> I also asked to describe hardware but I still see "quirk to ...". We use >> "quirk" as concept in Linux driver. Describe the hardware, not Linux driver. >> > > This comes to use when the bus width requirement between peripheral > and memory is different, but buswidth is something we read from HW > registers so this can be enabled by default. Don't add discoverable stuff to DT. > >> >>> >>>>> + >>>>> + arm,pl330-periph-single-dregs: >>>>> + type: boolean >>>>> + description: quirk for using dma-singles for peripherals in _dregs() >>>> >>>> Same concerns. >>>> > > An example of such a case is given in the ARM TRM for PL330, so maybe > we can have this by default as well. > Link : https://developer.arm.com/documentation/ddi0424/d/functional-overview/peripheral-request-interface/dmac-length-management#:~:text=DMAC%20length%20management-,Example%202.3,-shows%20a%20DMAC I could not find here a case describing hardware. You pointed out some code. What does the code have anything to do with DT? Best regards, Krzysztof
On Mon, May 8, 2023 at 10:13 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 08/05/2023 13:58, Joy Chakraborty wrote: > > On Fri, May 5, 2023 at 5:53 PM Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > >> > >> On 05/05/2023 11:44, Joy Chakraborty wrote: > >>> On Thu, May 4, 2023 at 8:38 PM Krzysztof Kozlowski > >>> <krzysztof.kozlowski@linaro.org> wrote: > >>>> > >>>> On 04/05/2023 16:57, Joy Chakraborty wrote: > >>>>> Add 2 new quirks added to the driver "arm,pl330-optimize-dev2mem-axsize" > >>>>> and "arm,pl330-periph-single-dregs" > >>>> > >>>> This we can see from the diff. You need to answer why? > >>>> > >>> > >>> Sure will change it to: > >>> " > >>> Addition of following quirks : > >>> - "arm,pl330-periph-use-diff-axsize" > >>> AxSize of transactions to peripherals are limited by the peripheral > >>> address width which inturn limits the AxSize used for transactions > >>> towards memory. > >>> This quirk will make transactions to memory use the maximum > >>> possible bus width(AxSize), store data in MFIFO and use narrow > >>> multi-beat transactions to move data to peripherals. > >>> This only applies to transfers between memory and peripherals where > >>> bus widths available are different for memory and the peripheral. > >>> - "arm,pl330-periph-complete-with-singles" : > >>> When transfer sizes are not a multiple of a block of burst > >>> transfers (AxLen * AxSize configured at the peripheral), certain > >>> peripherals might choose not to set the burst request at the > >>> peripheral request interface of the DMA. > >>> This quirk moves the remaining bytes to the peripheral using single > >>> transactions. > >>> " > >> > >> This does not answer why. You just copied again the patch contents. > >> > > Hi Krzysztof, > > Both the changes could be useful for SOC's which have PL330 integrated > > with a peripheral > > What do you mean here by "PL330 integrated with a peripheral"? Hi Krzysztof, By integration with peripheral I mean when the PL330 DMA is used to copy data to/from memory to a peripheral hardware (e.g. FIFO of a SPI master) where flow control of data is managed by the peripheral request interface exposed by PL330 : https://developer.arm.com/documentation/ddi0424/a/functional-overview/peripheral-request-interface > > > but I am not sure if all SOC's need/want this change > > hence wanted to keep it as a DT knob to avoid any regressions. > > But like you say it might not be the right thing to do. > > Devicetree is for describing hardware, not the contents of registers of > a device. Your changes might fit or might not, I don't know this good > enough, so I wait for your justification. Without justification this > looks like controlling driver from DT... > Yes this does control the driver behaviour on how the PL330 DMA hardware is programmed but it also is a function of - The bus width available in the soc towards memory and peripheral to be different. - The requirement of peripherals interfaced with PL330 on how odd transfer sizes are to be copied from memory to peripheral. But, both changes IMO can be enabled by default as well in the driver without devicetree knobs but it carries the risk of regression on SOC's which do not have such a requirement. Hence I was looking for some insight from Vinod Koul to see if it is okay to go ahead with the changes without device tree knobs. > > > >>> > >>>>> > >>>>> Signed-off-by: Joy Chakraborty <joychakr@google.com> > >>>>> --- > >>>>> Documentation/devicetree/bindings/dma/arm,pl330.yaml | 8 ++++++++ > >>>>> 1 file changed, 8 insertions(+) > >>>>> > >>>>> diff --git a/Documentation/devicetree/bindings/dma/arm,pl330.yaml b/Documentation/devicetree/bindings/dma/arm,pl330.yaml > >>>>> index 4a3dd6f5309b..0499a7fba88d 100644 > >>>>> --- a/Documentation/devicetree/bindings/dma/arm,pl330.yaml > >>>>> +++ b/Documentation/devicetree/bindings/dma/arm,pl330.yaml > >>>>> @@ -53,6 +53,14 @@ properties: > >>>>> type: boolean > >>>>> description: quirk for performing burst transfer only > >>>>> > >>>>> + arm,pl330-optimize-dev2mem-axsize: > >>>>> + type: boolean > >>>>> + description: quirk for optimizing AxSize used between dev<->mem > >>>> > >>>> This tells me nothing... Neither what it is about nor why this is > >>>> property of a board or PL330 hardware implementation. Please describe > >>>> hardware, not drivers. > >>>> > >>> > >>> Will change the name to "arm,pl330-periph-use-diff-axsize" and add description: > >>> " > >>> Quirk to use different AxSize for bursts while accessing source and > >>> destination when moving data between memory and peripheral. > >>> Maximum possible bus width is used as AxSize for transactions towards > >>> memory and transactions towards peripherals use AxSize as per > >>> peripheral address width. > >>> " > >> > >> Still no answer. Why this is property of a board or PL330 hardware > >> implementation? > >> I also asked to describe hardware but I still see "quirk to ...". We use > >> "quirk" as concept in Linux driver. Describe the hardware, not Linux driver. > >> > > > > This comes to use when the bus width requirement between peripheral > > and memory is different, but buswidth is something we read from HW > > registers so this can be enabled by default. > > Don't add discoverable stuff to DT. Sure, will not add this to DT. > > > > >> > >>> > >>>>> + > >>>>> + arm,pl330-periph-single-dregs: > >>>>> + type: boolean > >>>>> + description: quirk for using dma-singles for peripherals in _dregs() > >>>> > >>>> Same concerns. > >>>> > > > > An example of such a case is given in the ARM TRM for PL330, so maybe > > we can have this by default as well. > > Link : https://developer.arm.com/documentation/ddi0424/d/functional-overview/peripheral-request-interface/dmac-length-management#:~:text=DMAC%20length%20management-,Example%202.3,-shows%20a%20DMAC > > I could not find here a case describing hardware. You pointed out some > code. What does the code have anything to do with DT? > The instructions mentioned here are consumed by the PL330 Hardware to generate AXI transactions on the system bus. The example mentioned in the link is similar to how the driver would behave when this is enabled. I shall remove this as well and create a new patch without any DT depency for the changes. Thanks Joy > > Best regards, > Krzysztof >
diff --git a/Documentation/devicetree/bindings/dma/arm,pl330.yaml b/Documentation/devicetree/bindings/dma/arm,pl330.yaml index 4a3dd6f5309b..0499a7fba88d 100644 --- a/Documentation/devicetree/bindings/dma/arm,pl330.yaml +++ b/Documentation/devicetree/bindings/dma/arm,pl330.yaml @@ -53,6 +53,14 @@ properties: type: boolean description: quirk for performing burst transfer only + arm,pl330-optimize-dev2mem-axsize: + type: boolean + description: quirk for optimizing AxSize used between dev<->mem + + arm,pl330-periph-single-dregs: + type: boolean + description: quirk for using dma-singles for peripherals in _dregs() + dma-coherent: true iommus: