All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-24 17:22 ` Schrempf Frieder
  0 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-24 17:22 UTC (permalink / raw)
  To: Dan Williams, Fabio Estevam, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul
  Cc: Schrempf Frieder, stable, dmaengine, linux-arm-kernel, linux-kernel

From: Frieder Schrempf <frieder.schrempf@kontron.de>

On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
the broken DMA support for UART6, we change the check for event_id0
to include '0' as a valid id.

Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 drivers/dma/imx-sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 066b21a32232..3d4aac97b1fc 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1331,7 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
 
 	sdma_channel_synchronize(chan);
 
-	if (sdmac->event_id0)
+	if (sdmac->event_id0 >= 0)
 		sdma_event_disable(sdmac, sdmac->event_id0);
 	if (sdmac->event_id1)
 		sdma_event_disable(sdmac, sdmac->event_id1);
@@ -1631,7 +1631,7 @@ static int sdma_config(struct dma_chan *chan,
 	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
 
 	/* Set ENBLn earlier to make sure dma request triggered after that */
-	if (sdmac->event_id0) {
+	if (sdmac->event_id0 >= 0) {
 		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
 			return -EINVAL;
 		sdma_event_enable(sdmac, sdmac->event_id0);
-- 
2.17.1

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

* [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-24 17:22 ` Schrempf Frieder
  0 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-24 17:22 UTC (permalink / raw)
  To: Dan Williams, Fabio Estevam, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul
  Cc: dmaengine, linux-kernel, stable, Schrempf Frieder, linux-arm-kernel

From: Frieder Schrempf <frieder.schrempf@kontron.de>

On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
the broken DMA support for UART6, we change the check for event_id0
to include '0' as a valid id.

Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 drivers/dma/imx-sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 066b21a32232..3d4aac97b1fc 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1331,7 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
 
 	sdma_channel_synchronize(chan);
 
-	if (sdmac->event_id0)
+	if (sdmac->event_id0 >= 0)
 		sdma_event_disable(sdmac, sdmac->event_id0);
 	if (sdmac->event_id1)
 		sdma_event_disable(sdmac, sdmac->event_id1);
@@ -1631,7 +1631,7 @@ static int sdma_config(struct dma_chan *chan,
 	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
 
 	/* Set ENBLn earlier to make sure dma request triggered after that */
-	if (sdmac->event_id0) {
+	if (sdmac->event_id0 >= 0) {
 		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
 			return -EINVAL;
 		sdma_event_enable(sdmac, sdmac->event_id0);
-- 
2.17.1

_______________________________________________
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] 14+ messages in thread

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
  2020-02-24 17:22 ` Schrempf Frieder
@ 2020-02-24 18:43   ` Fabio Estevam
  -1 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2020-02-24 18:43 UTC (permalink / raw)
  To: Schrempf Frieder
  Cc: Dan Williams, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul,
	stable, dmaengine, linux-arm-kernel, linux-kernel

Hi Frieder,

On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
<frieder.schrempf@kontron.de> wrote:
>
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>
> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix

I would suggest being a bit more specific than saying i.MX6.

I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
so it would be better to specify it in the commit log.

imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
it for imx6sx.

> the broken DMA support for UART6, we change the check for event_id0
> to include '0' as a valid id.
>
> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

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

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-24 18:43   ` Fabio Estevam
  0 siblings, 0 replies; 14+ messages in thread
From: Fabio Estevam @ 2020-02-24 18:43 UTC (permalink / raw)
  To: Schrempf Frieder
  Cc: Linus Walleij, Sascha Hauer, linux-kernel, stable, Vinod Koul,
	NXP Linux Team, Pengutronix Kernel Team, dmaengine, Dan Williams,
	Shawn Guo, linux-arm-kernel

Hi Frieder,

On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
<frieder.schrempf@kontron.de> wrote:
>
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>
> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix

I would suggest being a bit more specific than saying i.MX6.

I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
so it would be better to specify it in the commit log.

imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
it for imx6sx.

> the broken DMA support for UART6, we change the check for event_id0
> to include '0' as a valid id.
>
> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

_______________________________________________
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] 14+ messages in thread

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
  2020-02-24 18:43   ` Fabio Estevam
@ 2020-02-25  6:12     ` Vinod Koul
  -1 siblings, 0 replies; 14+ messages in thread
From: Vinod Koul @ 2020-02-25  6:12 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Schrempf Frieder, Dan Williams, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, stable,
	dmaengine, linux-arm-kernel, linux-kernel

On 24-02-20, 15:43, Fabio Estevam wrote:
> Hi Frieder,
> 
> On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
> <frieder.schrempf@kontron.de> wrote:
> >
> > From: Frieder Schrempf <frieder.schrempf@kontron.de>
> >
> > On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
> 
> I would suggest being a bit more specific than saying i.MX6.
> 
> I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
> so it would be better to specify it in the commit log.
> 
> imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
> it for imx6sx.

and use right subsystem tag dmaengine. Git log of the file should tell
you the right one to use :)

> 
> > the broken DMA support for UART6, we change the check for event_id0
> > to include '0' as a valid id.
> >
> > Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> Reviewed-by: Fabio Estevam <festevam@gmail.com>

-- 
~Vinod

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

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-25  6:12     ` Vinod Koul
  0 siblings, 0 replies; 14+ messages in thread
From: Vinod Koul @ 2020-02-25  6:12 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Linus Walleij, Sascha Hauer, linux-kernel, Schrempf Frieder,
	NXP Linux Team, Pengutronix Kernel Team, dmaengine, stable,
	Dan Williams, Shawn Guo, linux-arm-kernel

On 24-02-20, 15:43, Fabio Estevam wrote:
> Hi Frieder,
> 
> On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
> <frieder.schrempf@kontron.de> wrote:
> >
> > From: Frieder Schrempf <frieder.schrempf@kontron.de>
> >
> > On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
> 
> I would suggest being a bit more specific than saying i.MX6.
> 
> I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
> so it would be better to specify it in the commit log.
> 
> imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
> it for imx6sx.

and use right subsystem tag dmaengine. Git log of the file should tell
you the right one to use :)

> 
> > the broken DMA support for UART6, we change the check for event_id0
> > to include '0' as a valid id.
> >
> > Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> Reviewed-by: Fabio Estevam <festevam@gmail.com>

-- 
~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] 14+ messages in thread

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
  2020-02-24 18:43   ` Fabio Estevam
@ 2020-02-25  8:01     ` Schrempf Frieder
  -1 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-25  8:01 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Dan Williams, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul,
	stable, dmaengine, linux-arm-kernel, linux-kernel

Hi Fabio,

On 24.02.20 19:43, Fabio Estevam wrote:
> Hi Frieder,
> 
> On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
> <frieder.schrempf@kontron.de> wrote:
>>
>> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>>
>> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
> 
> I would suggest being a bit more specific than saying i.MX6.
> 
> I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
> so it would be better to specify it in the commit log.
> 
> imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
> it for imx6sx.

Sounds reasonable. I will change the commit message to refer to 
i.MX6UL/ULL/SX.

Actually one of our customers has a dts for i.MX6UL, that enables the 
DMA for UART6. The DMA not being enabled in imx6ul.dtsi doesn't mean no 
one is using it. Actually I have no idea why it's enabled by default for 
i.MX6SX and disabled by default for i.MX6UL.

Thanks,
Frieder

> 
>> the broken DMA support for UART6, we change the check for event_id0
>> to include '0' as a valid id.
>>
>> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
> 

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

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-25  8:01     ` Schrempf Frieder
  0 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-25  8:01 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Linus Walleij, Sascha Hauer, linux-kernel, stable, Vinod Koul,
	NXP Linux Team, Pengutronix Kernel Team, dmaengine, Dan Williams,
	Shawn Guo, linux-arm-kernel

Hi Fabio,

On 24.02.20 19:43, Fabio Estevam wrote:
> Hi Frieder,
> 
> On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
> <frieder.schrempf@kontron.de> wrote:
>>
>> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>>
>> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
> 
> I would suggest being a bit more specific than saying i.MX6.
> 
> I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
> so it would be better to specify it in the commit log.
> 
> imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
> it for imx6sx.

Sounds reasonable. I will change the commit message to refer to 
i.MX6UL/ULL/SX.

Actually one of our customers has a dts for i.MX6UL, that enables the 
DMA for UART6. The DMA not being enabled in imx6ul.dtsi doesn't mean no 
one is using it. Actually I have no idea why it's enabled by default for 
i.MX6SX and disabled by default for i.MX6UL.

Thanks,
Frieder

> 
>> the broken DMA support for UART6, we change the check for event_id0
>> to include '0' as a valid id.
>>
>> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
> 
_______________________________________________
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] 14+ messages in thread

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
  2020-02-25  6:12     ` Vinod Koul
@ 2020-02-25  8:03       ` Schrempf Frieder
  -1 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-25  8:03 UTC (permalink / raw)
  To: Vinod Koul, Fabio Estevam
  Cc: Dan Williams, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, stable,
	dmaengine, linux-arm-kernel, linux-kernel

On 25.02.20 07:12, Vinod Koul wrote:
> On 24-02-20, 15:43, Fabio Estevam wrote:
>> Hi Frieder,
>>
>> On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
>> <frieder.schrempf@kontron.de> wrote:
>>>
>>> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>>>
>>> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
>>
>> I would suggest being a bit more specific than saying i.MX6.
>>
>> I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
>> so it would be better to specify it in the commit log.
>>
>> imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
>> it for imx6sx.
> 
> and use right subsystem tag dmaengine. Git log of the file should tell
> you the right one to use :)

Sorry, my bad. I will fix it.

> 
>>
>>> the broken DMA support for UART6, we change the check for event_id0
>>> to include '0' as a valid id.
>>>
>>> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
>>
>> Reviewed-by: Fabio Estevam <festevam@gmail.com>
> 

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

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-25  8:03       ` Schrempf Frieder
  0 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-25  8:03 UTC (permalink / raw)
  To: Vinod Koul, Fabio Estevam
  Cc: Linus Walleij, Sascha Hauer, linux-kernel, stable,
	NXP Linux Team, Pengutronix Kernel Team, dmaengine, Dan Williams,
	Shawn Guo, linux-arm-kernel

On 25.02.20 07:12, Vinod Koul wrote:
> On 24-02-20, 15:43, Fabio Estevam wrote:
>> Hi Frieder,
>>
>> On Mon, Feb 24, 2020 at 2:22 PM Schrempf Frieder
>> <frieder.schrempf@kontron.de> wrote:
>>>
>>> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>>>
>>> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
>>
>> I would suggest being a bit more specific than saying i.MX6.
>>
>> I see UART6 is present on i.MX6UL/i.MX6SX, but not on i.MX6Q/i.MX6DL,
>> so it would be better to specify it in the commit log.
>>
>> imx6ul.dtsi does not have dma nodes under uart6, so I guess you fixed
>> it for imx6sx.
> 
> and use right subsystem tag dmaengine. Git log of the file should tell
> you the right one to use :)

Sorry, my bad. I will fix it.

> 
>>
>>> the broken DMA support for UART6, we change the check for event_id0
>>> to include '0' as a valid id.
>>>
>>> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
>>
>> Reviewed-by: Fabio Estevam <festevam@gmail.com>
> 
_______________________________________________
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] 14+ messages in thread

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
  2020-02-24 17:16 ` Schrempf Frieder
@ 2020-02-24 17:22   ` Schrempf Frieder
  -1 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-24 17:22 UTC (permalink / raw)
  To: Dan Williams, Fabio Estevam, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul
  Cc: dmaengine, linux-arm-kernel, linux-kernel

On 24.02.20 18:16, Schrempf Frieder wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
> the broken DMA support for UART6, we change the check for event_id0
> to include '0' as a valid id.
> 
> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
> Cc: stable@vger.kernel

Sorry, I messed up the stable tag. Will send again.

> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
> ---
>   drivers/dma/imx-sdma.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 066b21a32232..3d4aac97b1fc 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1331,7 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
>   
>   	sdma_channel_synchronize(chan);
>   
> -	if (sdmac->event_id0)
> +	if (sdmac->event_id0 >= 0)
>   		sdma_event_disable(sdmac, sdmac->event_id0);
>   	if (sdmac->event_id1)
>   		sdma_event_disable(sdmac, sdmac->event_id1);
> @@ -1631,7 +1631,7 @@ static int sdma_config(struct dma_chan *chan,
>   	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
>   
>   	/* Set ENBLn earlier to make sure dma request triggered after that */
> -	if (sdmac->event_id0) {
> +	if (sdmac->event_id0 >= 0) {
>   		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
>   			return -EINVAL;
>   		sdma_event_enable(sdmac, sdmac->event_id0);
> 

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

* Re: [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-24 17:22   ` Schrempf Frieder
  0 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-24 17:22 UTC (permalink / raw)
  To: Dan Williams, Fabio Estevam, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul
  Cc: dmaengine, linux-kernel, linux-arm-kernel

On 24.02.20 18:16, Schrempf Frieder wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
> the broken DMA support for UART6, we change the check for event_id0
> to include '0' as a valid id.
> 
> Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
> Cc: stable@vger.kernel

Sorry, I messed up the stable tag. Will send again.

> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
> ---
>   drivers/dma/imx-sdma.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 066b21a32232..3d4aac97b1fc 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1331,7 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
>   
>   	sdma_channel_synchronize(chan);
>   
> -	if (sdmac->event_id0)
> +	if (sdmac->event_id0 >= 0)
>   		sdma_event_disable(sdmac, sdmac->event_id0);
>   	if (sdmac->event_id1)
>   		sdma_event_disable(sdmac, sdmac->event_id1);
> @@ -1631,7 +1631,7 @@ static int sdma_config(struct dma_chan *chan,
>   	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
>   
>   	/* Set ENBLn earlier to make sure dma request triggered after that */
> -	if (sdmac->event_id0) {
> +	if (sdmac->event_id0 >= 0) {
>   		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
>   			return -EINVAL;
>   		sdma_event_enable(sdmac, sdmac->event_id0);
> 
_______________________________________________
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] 14+ messages in thread

* [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-24 17:16 ` Schrempf Frieder
  0 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-24 17:16 UTC (permalink / raw)
  To: Dan Williams, Fabio Estevam, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul
  Cc: Schrempf Frieder, stable, dmaengine, linux-arm-kernel, linux-kernel

From: Frieder Schrempf <frieder.schrempf@kontron.de>

On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
the broken DMA support for UART6, we change the check for event_id0
to include '0' as a valid id.

Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
Cc: stable@vger.kernel
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 drivers/dma/imx-sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 066b21a32232..3d4aac97b1fc 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1331,7 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
 
 	sdma_channel_synchronize(chan);
 
-	if (sdmac->event_id0)
+	if (sdmac->event_id0 >= 0)
 		sdma_event_disable(sdmac, sdmac->event_id0);
 	if (sdmac->event_id1)
 		sdma_event_disable(sdmac, sdmac->event_id1);
@@ -1631,7 +1631,7 @@ static int sdma_config(struct dma_chan *chan,
 	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
 
 	/* Set ENBLn earlier to make sure dma request triggered after that */
-	if (sdmac->event_id0) {
+	if (sdmac->event_id0 >= 0) {
 		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
 			return -EINVAL;
 		sdma_event_enable(sdmac, sdmac->event_id0);
-- 
2.17.1

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

* [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6
@ 2020-02-24 17:16 ` Schrempf Frieder
  0 siblings, 0 replies; 14+ messages in thread
From: Schrempf Frieder @ 2020-02-24 17:16 UTC (permalink / raw)
  To: Dan Williams, Fabio Estevam, Linus Walleij, NXP Linux Team,
	Pengutronix Kernel Team, Sascha Hauer, Shawn Guo, Vinod Koul
  Cc: dmaengine, stable, linux-arm-kernel, Schrempf Frieder, linux-kernel

From: Frieder Schrempf <frieder.schrempf@kontron.de>

On i.MX6 the DMA event for the RX channel of UART6 is '0'. To fix
the broken DMA support for UART6, we change the check for event_id0
to include '0' as a valid id.

Fixes: 1ec1e82f2510 ("dmaengine: Add Freescale i.MX SDMA support")
Cc: stable@vger.kernel
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 drivers/dma/imx-sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 066b21a32232..3d4aac97b1fc 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1331,7 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
 
 	sdma_channel_synchronize(chan);
 
-	if (sdmac->event_id0)
+	if (sdmac->event_id0 >= 0)
 		sdma_event_disable(sdmac, sdmac->event_id0);
 	if (sdmac->event_id1)
 		sdma_event_disable(sdmac, sdmac->event_id1);
@@ -1631,7 +1631,7 @@ static int sdma_config(struct dma_chan *chan,
 	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
 
 	/* Set ENBLn earlier to make sure dma request triggered after that */
-	if (sdmac->event_id0) {
+	if (sdmac->event_id0 >= 0) {
 		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
 			return -EINVAL;
 		sdma_event_enable(sdmac, sdmac->event_id0);
-- 
2.17.1

_______________________________________________
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] 14+ messages in thread

end of thread, other threads:[~2020-02-25  8:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 17:22 [PATCH] dma: imx-sdma: Fix the event id check to include RX event for UART6 Schrempf Frieder
2020-02-24 17:22 ` Schrempf Frieder
2020-02-24 18:43 ` Fabio Estevam
2020-02-24 18:43   ` Fabio Estevam
2020-02-25  6:12   ` Vinod Koul
2020-02-25  6:12     ` Vinod Koul
2020-02-25  8:03     ` Schrempf Frieder
2020-02-25  8:03       ` Schrempf Frieder
2020-02-25  8:01   ` Schrempf Frieder
2020-02-25  8:01     ` Schrempf Frieder
  -- strict thread matches above, loose matches on Subject: below --
2020-02-24 17:16 Schrempf Frieder
2020-02-24 17:16 ` Schrempf Frieder
2020-02-24 17:22 ` Schrempf Frieder
2020-02-24 17:22   ` Schrempf Frieder

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.