diff mbox series

[v2] dmaengine: imx-sdma: Fix the event id check to include RX event for UART6

Message ID 20200225082139.7646-1-frieder.schrempf@kontron.de (mailing list archive)
State Mainlined
Commit 25962e1a7f1d522f1b57ead2f266fab570042a70
Headers show
Series [v2] dmaengine: imx-sdma: Fix the event id check to include RX event for UART6 | expand

Commit Message

Frieder Schrempf Feb. 25, 2020, 8:23 a.m. UTC
From: Frieder Schrempf <frieder.schrempf@kontron.de>

On i.MX6UL/ULL and i.MX6SX the DMA event id 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>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
---
Changes in v2:
  * Be more specific about the affected SoCs in the commit message
  * Fix the prefix in the subject to 'dmaengine'
  * Add Fabio's R-b tag
---
 drivers/dma/imx-sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vinod Koul Feb. 25, 2020, 8:45 a.m. UTC | #1
On 25-02-20, 08:23, Schrempf Frieder wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
> 
> On i.MX6UL/ULL and i.MX6SX the DMA event id 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.

Applied, thanks
diff mbox series

Patch

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);