All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: imx-sdma: initialize all script addresses
@ 2020-05-13  6:04 ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2020-05-13  6:04 UTC (permalink / raw)
  To: dmaengine
  Cc: Vinod Koul, kernel, linux-imx, linux-arm-kernel, Robin Gong,
	Sascha Hauer

The script addresses array increases with each new version. The driver
initializes the array to -EINVAL initially, but only up to the size
of the v1 array. Initialize the additional addresses for the newer
versions as well. Without this unitialized values of the newer arrays
are treated as valid.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-sdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 01422e721b26e..2ca79357f57dc 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -2080,7 +2080,7 @@ static int sdma_probe(struct platform_device *pdev)
 
 	/* initially no scripts available */
 	saddr_arr = (s32 *)sdma->script_addrs;
-	for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++)
+	for (i = 0; i < sizeof(*sdma->script_addrs) / sizeof(s32); i++)
 		saddr_arr[i] = -EINVAL;
 
 	dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask);
-- 
2.26.2


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

* [PATCH] dmaengine: imx-sdma: initialize all script addresses
@ 2020-05-13  6:04 ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2020-05-13  6:04 UTC (permalink / raw)
  To: dmaengine
  Cc: Sascha Hauer, Vinod Koul, linux-imx, kernel, Robin Gong,
	linux-arm-kernel

The script addresses array increases with each new version. The driver
initializes the array to -EINVAL initially, but only up to the size
of the v1 array. Initialize the additional addresses for the newer
versions as well. Without this unitialized values of the newer arrays
are treated as valid.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-sdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 01422e721b26e..2ca79357f57dc 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -2080,7 +2080,7 @@ static int sdma_probe(struct platform_device *pdev)
 
 	/* initially no scripts available */
 	saddr_arr = (s32 *)sdma->script_addrs;
-	for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++)
+	for (i = 0; i < sizeof(*sdma->script_addrs) / sizeof(s32); i++)
 		saddr_arr[i] = -EINVAL;
 
 	dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask);
-- 
2.26.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] dmaengine: imx-sdma: initialize all script addresses
  2020-05-13  6:04 ` Sascha Hauer
@ 2020-05-13  8:02   ` Robin Gong
  -1 siblings, 0 replies; 6+ messages in thread
From: Robin Gong @ 2020-05-13  8:02 UTC (permalink / raw)
  To: Sascha Hauer, dmaengine
  Cc: Vinod Koul, kernel, dl-linux-imx, linux-arm-kernel

On 2020/05/13 14:04 Sascha Hauer <s.hauer@pengutronix.de> wrote:
> The script addresses array increases with each new version. The driver
> initializes the array to -EINVAL initially, but only up to the size of the v1 array.
> Initialize the additional addresses for the newer versions as well. Without this
> unitialized values of the newer arrays are treated as valid.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/dma/imx-sdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index
> 01422e721b26e..2ca79357f57dc 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -2080,7 +2080,7 @@ static int sdma_probe(struct platform_device *pdev)
> 
>  	/* initially no scripts available */
>  	saddr_arr = (s32 *)sdma->script_addrs;
> -	for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++)
> +	for (i = 0; i < sizeof(*sdma->script_addrs) / sizeof(s32); i++)
>  		saddr_arr[i] = -EINVAL;
Reviewed-by : Robin Gong <yibin.gong@nxp.com>
> 
>  	dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask);
> --
> 2.26.2


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

* RE: [PATCH] dmaengine: imx-sdma: initialize all script addresses
@ 2020-05-13  8:02   ` Robin Gong
  0 siblings, 0 replies; 6+ messages in thread
From: Robin Gong @ 2020-05-13  8:02 UTC (permalink / raw)
  To: Sascha Hauer, dmaengine
  Cc: linux-arm-kernel, Vinod Koul, dl-linux-imx, kernel

On 2020/05/13 14:04 Sascha Hauer <s.hauer@pengutronix.de> wrote:
> The script addresses array increases with each new version. The driver
> initializes the array to -EINVAL initially, but only up to the size of the v1 array.
> Initialize the additional addresses for the newer versions as well. Without this
> unitialized values of the newer arrays are treated as valid.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/dma/imx-sdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index
> 01422e721b26e..2ca79357f57dc 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -2080,7 +2080,7 @@ static int sdma_probe(struct platform_device *pdev)
> 
>  	/* initially no scripts available */
>  	saddr_arr = (s32 *)sdma->script_addrs;
> -	for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++)
> +	for (i = 0; i < sizeof(*sdma->script_addrs) / sizeof(s32); i++)
>  		saddr_arr[i] = -EINVAL;
Reviewed-by : Robin Gong <yibin.gong@nxp.com>
> 
>  	dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask);
> --
> 2.26.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] dmaengine: imx-sdma: initialize all script addresses
  2020-05-13  6:04 ` Sascha Hauer
@ 2020-05-15  6:57   ` Vinod Koul
  -1 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2020-05-15  6:57 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: dmaengine, kernel, linux-imx, linux-arm-kernel, Robin Gong

On 13-05-20, 08:04, Sascha Hauer wrote:
> The script addresses array increases with each new version. The driver
> initializes the array to -EINVAL initially, but only up to the size
> of the v1 array. Initialize the additional addresses for the newer
> versions as well. Without this unitialized values of the newer arrays
> are treated as valid.

Applied, thanks

-- 
~Vinod

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

* Re: [PATCH] dmaengine: imx-sdma: initialize all script addresses
@ 2020-05-15  6:57   ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2020-05-15  6:57 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: dmaengine, Robin Gong, linux-imx, kernel, linux-arm-kernel

On 13-05-20, 08:04, Sascha Hauer wrote:
> The script addresses array increases with each new version. The driver
> initializes the array to -EINVAL initially, but only up to the size
> of the v1 array. Initialize the additional addresses for the newer
> versions as well. Without this unitialized values of the newer arrays
> are treated as valid.

Applied, thanks

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-05-15  6:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13  6:04 [PATCH] dmaengine: imx-sdma: initialize all script addresses Sascha Hauer
2020-05-13  6:04 ` Sascha Hauer
2020-05-13  8:02 ` Robin Gong
2020-05-13  8:02   ` Robin Gong
2020-05-15  6:57 ` Vinod Koul
2020-05-15  6:57   ` 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.