2022-04-27 16:44:17

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 0/6] dmaengine/ARM: use proper 'dma-channels/requests' properties

Hi,

The core DT schema defines generic 'dma-channels' and 'dma-requests'
properties, so in preparation to moving bindings to DT schema, convert
existing users of '#dma-channels' and '#dma-requests' to the generic
variant.

Not tested on hardware.

IMPORTANT
=========
The patchset is not bisectable! The DTS patches should be applied a
release *after* driver change is accepted.

Changes since v1
================
1. Add missing TI patches.

See also:
[1] https://lore.kernel.org/linux-devicetree/[email protected]/T/#m6235f451045c337d70a62dc65eab9a716618550b

Best regards,
Krzysztof


2022-04-27 16:45:08

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 1/6] dt-bindings: usb: am33xx-usb: deprecate '#dma-channels'

The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Documentation/devicetree/bindings/usb/am33xx-usb.txt | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
index 7a198a30408a..654ffc62d013 100644
--- a/Documentation/devicetree/bindings/usb/am33xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -61,8 +61,9 @@ DMA
endpoint number (0 … 14 for endpoints 1 … 15 on instance 0 and 15 … 29
for endpoints 1 … 15 on instance 1). The second number is 0 for RX and
1 for TX transfers.
-- #dma-channels: should be set to 30 representing the 15 endpoints for
+- dma-channels: should be set to 30 representing the 15 endpoints for
each USB instance.
+- #dma-channels: deprecated

Example:
~~~~~~~~
@@ -193,7 +194,7 @@ usb: usb@47400000 {
interrupts = <17>;
interrupt-names = "glue";
#dma-cells = <2>;
- #dma-channels = <30>;
- #dma-requests = <256>;
+ dma-channels = <30>;
+ dma-requests = <256>;
};
};
--
2.32.0

2022-04-27 16:45:38

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 2/6] dt-bindings: usb: da8xx-usb: deprecate '#dma-channels'

The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Documentation/devicetree/bindings/usb/da8xx-usb.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/da8xx-usb.txt b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
index 9ce22551b2b3..fb2027a7d80d 100644
--- a/Documentation/devicetree/bindings/usb/da8xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/da8xx-usb.txt
@@ -36,7 +36,8 @@ DMA
- #dma-cells: should be set to 2. The first number represents the
channel number (0 … 3 for endpoints 1 … 4).
The second number is 0 for RX and 1 for TX transfers.
-- #dma-channels: should be set to 4 representing the 4 endpoints.
+- dma-channels: should be set to 4 representing the 4 endpoints.
+- #dma-channels: deprecated

Example:
usb_phy: usb-phy {
@@ -74,7 +75,7 @@ Example:
reg-names = "controller", "scheduler", "queuemgr";
interrupts = <58>;
#dma-cells = <2>;
- #dma-channels = <4>;
+ dma-channels = <4>;
};

};
--
2.32.0

2022-04-27 16:45:43

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 5/6] ARM: dts: da850: use new 'dma-channels' property

The '#dma-channels' property was deprecated in favor of one defined by
generic dma-common DT bindings.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm/boot/dts/da850.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index c3942b4e82ad..0e8b42a95ba4 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -679,7 +679,7 @@ cppi41dma: dma-controller@201000 {
"scheduler", "queuemgr";
interrupts = <58>;
#dma-cells = <2>;
- #dma-channels = <4>;
+ dma-channels = <4>;
power-domains = <&psc1 1>;
status = "okay";
};
--
2.32.0

2022-04-27 16:48:08

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 3/6] dmaengine: ti: deprecate '#dma-channels'

The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'. Switch to new property while
keeping backward compatibility.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/dma/ti/cppi41.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c
index 062bd9bd4de0..695915dba707 100644
--- a/drivers/dma/ti/cppi41.c
+++ b/drivers/dma/ti/cppi41.c
@@ -1105,8 +1105,12 @@ static int cppi41_dma_probe(struct platform_device *pdev)
cdd->qmgr_num_pend = glue_info->qmgr_num_pend;
cdd->first_completion_queue = glue_info->first_completion_queue;

+ /* Parse new and deprecated dma-channels properties */
ret = of_property_read_u32(dev->of_node,
- "#dma-channels", &cdd->n_chans);
+ "dma-channels", &cdd->n_chans);
+ if (ret)
+ ret = of_property_read_u32(dev->of_node,
+ "#dma-channels", &cdd->n_chans);
if (ret)
goto err_get_n_chans;

--
2.32.0

2022-04-27 16:48:12

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 6/6] ARM: dts: dm81xx: use new 'dma-channels/requests' properties

The '#dma-channels' and '#dma-requests' properties were deprecated in
favor of these defined by generic dma-common DT bindings.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm/boot/dts/dm814x.dtsi | 4 ++--
arch/arm/boot/dts/dm816x.dtsi | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi
index 7702e048e110..ab2572482ba9 100644
--- a/arch/arm/boot/dts/dm814x.dtsi
+++ b/arch/arm/boot/dts/dm814x.dtsi
@@ -167,8 +167,8 @@ cppi41dma: dma-controller@47402000 {
interrupts = <17>;
interrupt-names = "glue";
#dma-cells = <2>;
- #dma-channels = <30>;
- #dma-requests = <256>;
+ dma-channels = <30>;
+ dma-requests = <256>;
};
};

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
index a9e7274806f4..317b7c74e32c 100644
--- a/arch/arm/boot/dts/dm816x.dtsi
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -655,8 +655,8 @@ cppi41dma: dma-controller@47402000 {
interrupts = <17>;
interrupt-names = "glue";
#dma-cells = <2>;
- #dma-channels = <30>;
- #dma-requests = <256>;
+ dma-channels = <30>;
+ dma-requests = <256>;
};
};

--
2.32.0

2022-04-27 16:52:43

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 4/6] ARM: dts: am33xx: use new 'dma-channels/requests' properties

The '#dma-channels' and '#dma-requests' properties were deprecated in
favor of these defined by generic dma-common DT bindings.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm/boot/dts/am33xx.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index f6ec85d58dd1..55ffb0813ded 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -461,8 +461,8 @@ cppi41dma: dma-controller@2000 {
interrupts = <17>;
interrupt-names = "glue";
#dma-cells = <2>;
- #dma-channels = <30>;
- #dma-requests = <256>;
+ dma-channels = <30>;
+ dma-requests = <256>;
};
};

--
2.32.0

2022-04-27 18:21:25

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 4/6] ARM: dts: am33xx: use new 'dma-channels/requests' properties

On Wed, Apr 27, 2022 at 06:11:24PM +0200, Krzysztof Kozlowski wrote:
> The '#dma-channels' and '#dma-requests' properties were deprecated in
> favor of these defined by generic dma-common DT bindings.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> arch/arm/boot/dts/am33xx.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
> index f6ec85d58dd1..55ffb0813ded 100644
> --- a/arch/arm/boot/dts/am33xx.dtsi
> +++ b/arch/arm/boot/dts/am33xx.dtsi
> @@ -461,8 +461,8 @@ cppi41dma: dma-controller@2000 {
> interrupts = <17>;
> interrupt-names = "glue";
> #dma-cells = <2>;
> - #dma-channels = <30>;
> - #dma-requests = <256>;
> + dma-channels = <30>;
> + dma-requests = <256>;

You could keep the old properties for compatibility and to apply
immediately.

> };
> };
>
> --
> 2.32.0
>
>

2022-04-27 18:28:19

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 2/6] dt-bindings: usb: da8xx-usb: deprecate '#dma-channels'

On Wed, 27 Apr 2022 18:11:22 +0200, Krzysztof Kozlowski wrote:
> The generic property, used in most of the drivers and defined in generic
> dma-common DT bindings, is 'dma-channels'.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> Documentation/devicetree/bindings/usb/da8xx-usb.txt | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>

2022-04-27 18:51:26

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] dt-bindings: usb: am33xx-usb: deprecate '#dma-channels'

On Wed, 27 Apr 2022 18:11:21 +0200, Krzysztof Kozlowski wrote:
> The generic property, used in most of the drivers and defined in generic
> dma-common DT bindings, is 'dma-channels'.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> Documentation/devicetree/bindings/usb/am33xx-usb.txt | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>

2022-04-27 21:16:29

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 4/6] ARM: dts: am33xx: use new 'dma-channels/requests' properties

On Wed, 27 Apr 2022 at 20:20, Rob Herring <[email protected]> wrote:
> > diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
> > index f6ec85d58dd1..55ffb0813ded 100644
> > --- a/arch/arm/boot/dts/am33xx.dtsi
> > +++ b/arch/arm/boot/dts/am33xx.dtsi
> > @@ -461,8 +461,8 @@ cppi41dma: dma-controller@2000 {
> > interrupts = <17>;
> > interrupt-names = "glue";
> > #dma-cells = <2>;
> > - #dma-channels = <30>;
> > - #dma-requests = <256>;
> > + dma-channels = <30>;
> > + dma-requests = <256>;
>
> You could keep the old properties for compatibility and to apply
> immediately.

Indeed, that's a nice solution. Any preference from TI SoC maintainers?

Best regards,
Krzysztof

2022-04-28 08:39:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 4/6] ARM: dts: am33xx: use new 'dma-channels/requests' properties

On 28/04/2022 09:30, Tony Lindgren wrote:
> * Krzysztof Kozlowski <[email protected]> [220427 19:23]:
>> On Wed, 27 Apr 2022 at 20:20, Rob Herring <[email protected]> wrote:
>>>> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
>>>> index f6ec85d58dd1..55ffb0813ded 100644
>>>> --- a/arch/arm/boot/dts/am33xx.dtsi
>>>> +++ b/arch/arm/boot/dts/am33xx.dtsi
>>>> @@ -461,8 +461,8 @@ cppi41dma: dma-controller@2000 {
>>>> interrupts = <17>;
>>>> interrupt-names = "glue";
>>>> #dma-cells = <2>;
>>>> - #dma-channels = <30>;
>>>> - #dma-requests = <256>;
>>>> + dma-channels = <30>;
>>>> + dma-requests = <256>;
>>>
>>> You could keep the old properties for compatibility and to apply
>>> immediately.
>>
>> Indeed, that's a nice solution. Any preference from TI SoC maintainers?
>
> Makes sense to me to avoid dependencies.

Thanks. I will send a v3 today with such change.


Best regards,
Krzysztof

2022-04-28 20:58:34

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH v2 3/6] dmaengine: ti: deprecate '#dma-channels'

* Krzysztof Kozlowski <[email protected]> [220427 16:08]:
> The generic property, used in most of the drivers and defined in generic
> dma-common DT bindings, is 'dma-channels'. Switch to new property while
> keeping backward compatibility.

Looks good to me:

Reviewed-by: Tony Lindgren <[email protected]>

2022-04-29 18:30:32

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH v2 4/6] ARM: dts: am33xx: use new 'dma-channels/requests' properties

* Krzysztof Kozlowski <[email protected]> [220427 19:23]:
> On Wed, 27 Apr 2022 at 20:20, Rob Herring <[email protected]> wrote:
> > > diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
> > > index f6ec85d58dd1..55ffb0813ded 100644
> > > --- a/arch/arm/boot/dts/am33xx.dtsi
> > > +++ b/arch/arm/boot/dts/am33xx.dtsi
> > > @@ -461,8 +461,8 @@ cppi41dma: dma-controller@2000 {
> > > interrupts = <17>;
> > > interrupt-names = "glue";
> > > #dma-cells = <2>;
> > > - #dma-channels = <30>;
> > > - #dma-requests = <256>;
> > > + dma-channels = <30>;
> > > + dma-requests = <256>;
> >
> > You could keep the old properties for compatibility and to apply
> > immediately.
>
> Indeed, that's a nice solution. Any preference from TI SoC maintainers?

Makes sense to me to avoid dependencies.

Regards,

Tony

2022-05-22 00:33:35

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2 3/6] dmaengine: ti: deprecate '#dma-channels'

On 27-04-22, 18:11, Krzysztof Kozlowski wrote:
> The generic property, used in most of the drivers and defined in generic
> dma-common DT bindings, is 'dma-channels'. Switch to new property while
> keeping backward compatibility.

Applied, thanks

--
~Vinod