All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] dmaengine/ARM: use proper 'dma-channels/requests' properties
@ 2022-04-27 16:14 Krzysztof Kozlowski
  2022-04-27 16:14 ` [PATCH 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-27 16:14 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

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.

See also:
[1] https://lore.kernel.org/linux-devicetree/fedb56be-f275-aabb-cdf5-dbd394b8a7bd@linaro.org/T/#m6235f451045c337d70a62dc65eab9a716618550b

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels'
  2022-04-27 16:14 [PATCH 0/3] dmaengine/ARM: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
@ 2022-04-27 16:14 ` Krzysztof Kozlowski
  2022-04-27 18:26   ` Rob Herring
  2022-04-27 16:14 ` [PATCH 2/3] " Krzysztof Kozlowski
  2022-04-27 16:14 ` [PATCH 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
  2 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-27 16:14 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

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 <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/dma/sprd-dma.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/sprd-dma.txt b/Documentation/devicetree/bindings/dma/sprd-dma.txt
index adccea9941f1..c7e9b5fd50e7 100644
--- a/Documentation/devicetree/bindings/dma/sprd-dma.txt
+++ b/Documentation/devicetree/bindings/dma/sprd-dma.txt
@@ -8,10 +8,13 @@ Required properties:
 - interrupts: Should contain one interrupt shared by all channel.
 - #dma-cells: must be <1>. Used to represent the number of integer
 	cells in the dmas property of client device.
-- #dma-channels : Number of DMA channels supported. Should be 32.
+- dma-channels : Number of DMA channels supported. Should be 32.
 - clock-names: Should contain the clock of the DMA controller.
 - clocks: Should contain a clock specifier for each entry in clock-names.
 
+Deprecated properties:
+- #dma-channels : Number of DMA channels supported. Should be 32.
+
 Example:
 
 Controller:
@@ -20,7 +23,7 @@ apdma: dma-controller@20100000 {
 	reg = <0x20100000 0x4000>;
 	interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
 	#dma-cells = <1>;
-	#dma-channels = <32>;
+	dma-channels = <32>;
 	clock-names = "enable";
 	clocks = <&clk_ap_ahb_gates 5>;
 };
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] dmaengine: sprd: deprecate '#dma-channels'
  2022-04-27 16:14 [PATCH 0/3] dmaengine/ARM: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
  2022-04-27 16:14 ` [PATCH 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
@ 2022-04-27 16:14 ` Krzysztof Kozlowski
  2022-04-27 16:14 ` [PATCH 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
  2 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-27 16:14 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

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 <krzysztof.kozlowski@linaro.org>
---
 drivers/dma/sprd-dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 7f158ef5672d..2138b80435ab 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1117,7 +1117,11 @@ static int sprd_dma_probe(struct platform_device *pdev)
 	u32 chn_count;
 	int ret, i;
 
-	ret = device_property_read_u32(&pdev->dev, "#dma-channels", &chn_count);
+	/* Parse new and deprecated dma-channels properties */
+	ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count);
+	if (ret)
+		ret = device_property_read_u32(&pdev->dev, "#dma-channels",
+					       &chn_count);
 	if (ret) {
 		dev_err(&pdev->dev, "get dma channels count failed\n");
 		return ret;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] arm64: dts: sprd: use new 'dma-channels' property
  2022-04-27 16:14 [PATCH 0/3] dmaengine/ARM: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
  2022-04-27 16:14 ` [PATCH 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
  2022-04-27 16:14 ` [PATCH 2/3] " Krzysztof Kozlowski
@ 2022-04-27 16:14 ` Krzysztof Kozlowski
  2022-04-28  7:35   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-27 16:14 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

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

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/sprd/whale2.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi
index 79b9591c37aa..945f0e02d364 100644
--- a/arch/arm64/boot/dts/sprd/whale2.dtsi
+++ b/arch/arm64/boot/dts/sprd/whale2.dtsi
@@ -126,7 +126,7 @@ ap_dma: dma-controller@20100000 {
 				reg = <0 0x20100000 0 0x4000>;
 				interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
 				#dma-cells = <1>;
-				#dma-channels = <32>;
+				dma-channels = <32>;
 				clock-names = "enable";
 				clocks = <&apahb_gate CLK_DMA_EB>;
 			};
@@ -272,7 +272,7 @@ agcp_dma: dma-controller@41580000 {
 				compatible = "sprd,sc9860-dma";
 				reg = <0 0x41580000 0 0x4000>;
 				#dma-cells = <1>;
-				#dma-channels = <32>;
+				dma-channels = <32>;
 				clock-names = "enable", "ashb_eb";
 				clocks = <&agcp_gate CLK_AGCP_DMAAP_EB>,
 				       <&agcp_gate CLK_AGCP_AP_ASHB_EB>;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels'
  2022-04-27 16:14 ` [PATCH 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
@ 2022-04-27 18:26   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2022-04-27 18:26 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-kernel, Rob Herring, Orson Zhai, Vinod Koul, dmaengine,
	Chunyan Zhang, Baolin Wang, Krzysztof Kozlowski, devicetree

On Wed, 27 Apr 2022 18:14: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 <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/dma/sprd-dma.txt | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] arm64: dts: sprd: use new 'dma-channels' property
  2022-04-27 16:14 ` [PATCH 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
@ 2022-04-28  7:35   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-28  7:35 UTC (permalink / raw)
  To: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, dmaengine, devicetree, linux-kernel

On 27/04/2022 18:14, Krzysztof Kozlowski wrote:
> The '#dma-channels' property was deprecated in favor of one defined by
> generic dma-common DT bindings.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  arch/arm64/boot/dts/sprd/whale2.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi
> index 79b9591c37aa..945f0e02d364 100644
> --- a/arch/arm64/boot/dts/sprd/whale2.dtsi
> +++ b/arch/arm64/boot/dts/sprd/whale2.dtsi
> @@ -126,7 +126,7 @@ ap_dma: dma-controller@20100000 {
>  				reg = <0 0x20100000 0 0x4000>;
>  				interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
>  				#dma-cells = <1>;
> -				#dma-channels = <32>;
> +				dma-channels = <32>;


As Rob proposed, the removal of old property does not have to happen in
this patch (but much later). This would allow merging DTS change
immediately.

I will resend in that spirit, unless SoC maintainers prefer the original
approach (where DTS has to wait for next release)?


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-28  7:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 16:14 [PATCH 0/3] dmaengine/ARM: use proper 'dma-channels/requests' properties Krzysztof Kozlowski
2022-04-27 16:14 ` [PATCH 1/3] dt-bindings: dmaengine: sprd: deprecate '#dma-channels' Krzysztof Kozlowski
2022-04-27 18:26   ` Rob Herring
2022-04-27 16:14 ` [PATCH 2/3] " Krzysztof Kozlowski
2022-04-27 16:14 ` [PATCH 3/3] arm64: dts: sprd: use new 'dma-channels' property Krzysztof Kozlowski
2022-04-28  7:35   ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.