All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] of: dma: make #dma-cells optional
@ 2013-02-28  0:57 Rob Herring
  2013-02-28  0:57 ` [PATCH 2/2] dma: of: allow for non-existent #dma-cells property Rob Herring
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rob Herring @ 2013-02-28  0:57 UTC (permalink / raw)
  To: linux-kernel, devicetree-discuss
  Cc: Rob Herring, Vinod Koul, Dan Williams, Grant Likely

From: Rob Herring <rob.herring@calxeda.com>

For controllers with no requests/clients (memory to memory only), the

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
 Documentation/devicetree/bindings/dma/dma.txt |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/dma/dma.txt b/Documentation/devicetree/bindings/dma/dma.txt
index 8f504e6..d388f06 100644
--- a/Documentation/devicetree/bindings/dma/dma.txt
+++ b/Documentation/devicetree/bindings/dma/dma.txt
@@ -8,9 +8,10 @@ controller.
 * DMA controller
 
 Required property:
-- #dma-cells: 		Must be at least 1. Used to provide DMA controller
-			specific information. See DMA client binding below for
-			more details.
+- #dma-cells: 		Required for controllers with requests. Optional for
+			memory to memory only DMA controllers. Must be at least
+			1. Used to provide DMA controller specific information. 
+			See DMA client binding below for more details.
 
 Optional properties:
 - dma-channels: 	Number of DMA channels supported by the controller.
-- 
1.7.10.4


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

* [PATCH 2/2] dma: of: allow for non-existent #dma-cells property
  2013-02-28  0:57 [PATCH 1/2] of: dma: make #dma-cells optional Rob Herring
@ 2013-02-28  0:57 ` Rob Herring
       [not found] ` <1362013078-2213-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2013-03-07  6:34 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2013-02-28  0:57 UTC (permalink / raw)
  To: linux-kernel, devicetree-discuss
  Cc: Rob Herring, Vinod Koul, Dan Williams, Grant Likely

From: Rob Herring <rob.herring@calxeda.com>

Allow the #dma-cells property to be optional and default to 0. This fixes
a crash on Calxed highbank which has no clients and no #dma-cells property.

Also, the error check was pointless as be32_to_cpup causes a NULL ptr error
first before we get to the error check.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/dma/of-dma.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index 69d04d2..e97a062 100644
--- a/drivers/dma/of-dma.c
+++ b/drivers/dma/of-dma.c
@@ -92,7 +92,7 @@ int of_dma_controller_register(struct device_node *np,
 				void *data)
 {
 	struct of_dma	*ofdma;
-	int		nbcells;
+	int		nbcells = 0;
 
 	if (!np || !of_dma_xlate) {
 		pr_err("%s: not enough information provided\n", __func__);
@@ -103,13 +103,7 @@ int of_dma_controller_register(struct device_node *np,
 	if (!ofdma)
 		return -ENOMEM;
 
-	nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL));
-	if (!nbcells) {
-		pr_err("%s: #dma-cells property is missing or invalid\n",
-		       __func__);
-		kfree(ofdma);
-		return -EINVAL;
-	}
+        of_property_read_u32(np, "#dma-cells", &nbcells);
 
 	ofdma->of_node = np;
 	ofdma->of_dma_nbcells = nbcells;
-- 
1.7.10.4


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

* Re: [PATCH 1/2] of: dma: make #dma-cells optional
       [not found] ` <1362013078-2213-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-02-28  1:33   ` Jon Hunter
       [not found]     ` <512EB3FD.2000207-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Hunter @ 2013-02-28  1:33 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ


On 02/27/2013 06:57 PM, Rob Herring wrote:
> From: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
> 
> For controllers with no requests/clients (memory to memory only), the

Looks like the changelog got truncated.

> Signed-off-by: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
> Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Dan Williams <djbw-b10kYP2dOMg@public.gmane.org>
> Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/dma/dma.txt |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/dma/dma.txt b/Documentation/devicetree/bindings/dma/dma.txt
> index 8f504e6..d388f06 100644
> --- a/Documentation/devicetree/bindings/dma/dma.txt
> +++ b/Documentation/devicetree/bindings/dma/dma.txt
> @@ -8,9 +8,10 @@ controller.
>  * DMA controller
>  
>  Required property:
> -- #dma-cells: 		Must be at least 1. Used to provide DMA controller
> -			specific information. See DMA client binding below for
> -			more details.
> +- #dma-cells: 		Required for controllers with requests. Optional for
> +			memory to memory only DMA controllers. Must be at least
> +			1. Used to provide DMA controller specific information. 
> +			See DMA client binding below for more details.
>  
>  Optional properties:
>  - dma-channels: 	Number of DMA channels supported by the controller.

Otherwise ...

Acked-by: Jon Hunter <jon-hunter-l0cyMroinI0@public.gmane.org>

Cheers
Jon

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

* Re: [PATCH 1/2] of: dma: make #dma-cells optional
       [not found]     ` <512EB3FD.2000207-l0cyMroinI0@public.gmane.org>
@ 2013-02-28  1:43       ` Jon Hunter
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Hunter @ 2013-02-28  1:43 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ


On 02/27/2013 07:33 PM, Jon Hunter wrote:
> 
> On 02/27/2013 06:57 PM, Rob Herring wrote:
>> From: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
>>
>> For controllers with no requests/clients (memory to memory only), the
> 
> Looks like the changelog got truncated.

By the way, may be this was in your original changelog, but I am curious
what information the DMA client node in this case? Is it just the dma
controller?

Cheers
Jon

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

* Re: [PATCH 1/2] of: dma: make #dma-cells optional
  2013-02-28  0:57 [PATCH 1/2] of: dma: make #dma-cells optional Rob Herring
  2013-02-28  0:57 ` [PATCH 2/2] dma: of: allow for non-existent #dma-cells property Rob Herring
       [not found] ` <1362013078-2213-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-03-07  6:34 ` Vinod Koul
  2 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2013-03-07  6:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-kernel, devicetree-discuss, Rob Herring, Dan Williams,
	Grant Likely

On Wed, Feb 27, 2013 at 06:57:57PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> For controllers with no requests/clients (memory to memory only), the
Change log is truncated...

> 
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Dan Williams <djbw@fb.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> ---
>  Documentation/devicetree/bindings/dma/dma.txt |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/dma/dma.txt b/Documentation/devicetree/bindings/dma/dma.txt
> index 8f504e6..d388f06 100644
> --- a/Documentation/devicetree/bindings/dma/dma.txt
> +++ b/Documentation/devicetree/bindings/dma/dma.txt
> @@ -8,9 +8,10 @@ controller.
>  * DMA controller
>  
>  Required property:
> -- #dma-cells: 		Must be at least 1. Used to provide DMA controller
> -			specific information. See DMA client binding below for
> -			more details.
> +- #dma-cells: 		Required for controllers with requests. Optional for
> +			memory to memory only DMA controllers. Must be at least
> +			1. Used to provide DMA controller specific information. 
> +			See DMA client binding below for more details.
>  
>  Optional properties:
>  - dma-channels: 	Number of DMA channels supported by the controller.
> -- 
> 1.7.10.4
> 

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

end of thread, other threads:[~2013-03-07  6:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28  0:57 [PATCH 1/2] of: dma: make #dma-cells optional Rob Herring
2013-02-28  0:57 ` [PATCH 2/2] dma: of: allow for non-existent #dma-cells property Rob Herring
     [not found] ` <1362013078-2213-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-28  1:33   ` [PATCH 1/2] of: dma: make #dma-cells optional Jon Hunter
     [not found]     ` <512EB3FD.2000207-l0cyMroinI0@public.gmane.org>
2013-02-28  1:43       ` Jon Hunter
2013-03-07  6:34 ` Vinod Koul

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.