dmaengine: imx-sdma: implement channel termination via worker
PATCH 3/4 dmaengine: imx-sdma: implement channel termination via worker
Hi Robin,
Am Mittwoch, den 12.09.2018, 09:47 +0000 schrieb Robin Gong:
Quoted 6 lines
My testcase is simple loopback test as attached. Are you sure your serial port running in DMA mode? By default, DMA not enabled on i.mx7d, you can enable it in uart device node of dts as below:
+ dmas = <&sdma 32 4 0>, <&sdma 33 4 0>;
+ dma-names = "rx", "tx"
Please flow below command(ttymxc5 on i.mx7d-sdb board) to run loopback test:
./mxc_uart_stress_test.out/dev/ttymxc52000000 D L 100 100 L
Thanks. With this testcase I was able to reproduce the issue on i.MX6. The v2 patchset I just sent out fixed this, so should hopefully be good enough to go in now.
Regards,
Lucas
Quoted 108 lines
Quoted 108 lines
-----Original Message-----
Quoted 1 line
Quoted 1 line
From: Lucas Stach <[email protected]>
Sent: 2018年9月12日 17:22
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
To: Robin Gong <[email protected]>; Vinod Koul <[email protected]>
Cc: [email protected]; dl-linux-imx <[email protected]>;[email protected]; [email protected]
Subject: Re: [PATCH 3/4] dmaengine: imx-sdma: implement channel termination via workerHi Robin,
Am Dienstag, den 11.09.2018, 08:18 +0000 schrieb Robin Gong:
Quoted 3 lines
Hi Lucas,
I have quick test for UART, seems this patch set broke uart function
on i.mx7d, I believe it should be same on other i.mx6 family. Could you doublecheck it?
Can you describe your testcase and the issue you've seen in more detail? I'm running this patch series on a system that does a lot of communication with an UART attached Co-processor and I'm not seeing any issues.
Regards,
LucasQuoted 83 lines
Quoted 83 lines
-----Original Message-----
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
From: Lucas Stach <[email protected]>
Sent: 2018年9月10日 17:59
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
To: Robin Gong <[email protected]>; Vinod Koul <[email protected]>
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Cc [email protected]; dl-linux-imx <[email protected]>;[email protected]; [email protected]
Subject: Re: [PATCH 3/4] dmaengine: imx-sdma: implement channel termination via workerAm Dienstag, den 04.09.2018, 02:36 +0000 schrieb Robin Gong:
Quoted 59 lines
Quoted 51 lines
-----Original Message-----
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
From: Lucas Stach <[email protected]>
Sent: 2018年9月3日 21:12
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
To: Robin Gong <[email protected]>; Vinod Koul <[email protected]
rg>
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Cc: [email protected]; dl-linux-imx <[email protected]> ; [email protected]; [email protected]
Subject: Re: [PATCH 3/4] dmaengine: imx-sdma: implement channel termination via worker
Am Montag, den 03.09.2018, 08:59 +0000 schrieb Robin Gong:
Quoted 40 lines
Quoted 39 lines
-----Original Message-----
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
From: Lucas Stach <[email protected]>
Sent: 2018年9月3日 16:41
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
To: Robin Gong <[email protected]>; Vinod Koul <vkoul@kern
el.o
rg>Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Cc: [email protected]; dl-linux-imx <linux-imx@nxp.
com>
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Subject: Re: [PATCH 3/4] dmaengine: imx-sdma: implement channel termination via worker
Hi Robin,
Am Freitag, den 31.08.2018, 09:49 +0000 schrieb Robin Gong:
Quoted 9 lines
Hi Lucas,
Seems I miss your previous mail. Thanks for your patch,
but if move most jobs ofsdma_disable_channel_with_delay()into worker, that will bring another race condition that upper driver such as Audio terminate channel and free resource of dma channel without really channel stop, if dma transfer done interrupt come after that, oops or kernel cash may be caught.
Leave 'sdmac->desc= NULL' in the
sdma_disable_channel_with_delay()may fix such potential issue.No, there is no such issue. The audio channel terminate will call
dmaengine_terminate_sync(), which internally callsdmaengine_terminate_async()and then does admaengine_synchronize().
As this patchset implements thedevice_synchronizefunction in the sdma driver, this will wait for the worker to finish its execution, so there is no race condition to worry about here.Regards,
LucasQuoted 7 lines
Quoted 2 lines
Yes, but how about other drivers which not call
dmaengine_terminate_sync()?Please read the dmaengine documentation.
device_terminate_allhas no requirement that the transfer is actually canceled when the call returns. If the caller needs a guarantee that the channel is stopped it _must_ calldevice_synchronize.Quoted 4 lines
I know that, but the fact is some driver still use
dmaengine_terminate_all()such as
Spi/uart driver. My concern is how to avoid to break their function.They should simply be fixed to not use a deprecated function. Both of those are only using
device_terminate_allin error or shutdown paths, so the risk of races is pretty minimal even with the current code. And I think the SPI driver is trivial to fix, as we can just use theterminate_syncvariant there. The UART driver is a bit more tricky.Regards,
Lucas