From mboxrd@z Thu Jan 1 00:00:00 1970 From: robert.jarzmik@free.fr (Robert Jarzmik) Date: Tue, 03 Apr 2018 22:19:33 +0200 Subject: [PATCH 02/15] ARM: pxa: add dma slave map In-Reply-To: (Arnd Bergmann's message of "Tue, 3 Apr 2018 17:39:08 +0200") References: <20180402142656.26815-1-robert.jarzmik@free.fr> <20180402142656.26815-3-robert.jarzmik@free.fr> <87tvss48ti.fsf@belgarion.home> Message-ID: <87h8os3uwa.fsf@belgarion.home> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org ... chop chop removing unneeded recipients .... Arnd Bergmann writes: > Ok, I looked at the driver in more detail now and found the scary parts. > So it's using the async DMA interface to do synchronous DMA in > interrupt context in order to transfer the rx data faster than an readsl() > would, correct? That's correct, at least for the smc91x. > It still feels odd to me that there is an entry in the slave map for > a device that does not have a request line. However, it also seems > that the entire code in those two drivers that deals with DMA is specific > to PXA anyway, so maybe it can be done differently: instead of > calling dma_request_slave_channel_compat() or dma_request_chan() > with a fake request line, how about calling dma_request_channel() > with an NULL filter function and data, and have the driver handle > the empty data case the same way as the rq=-1 case today? Okay, in this case : - the channel priority cannot be passed anymore - and I don't see how this can work : dma_request_channel() __dma_request_channel() find_candidate() private_candidate(mask, device, fn, fn_param); /* Here, fn == NULL and fn_param == NULL as per your proposal */ This function will find the first available dma channel, all right, but no function will be called in pxa_dma driver, and therefore the last requestor of the channel will be used, which is bad. >> If you think it's worth it, what is the driving benefit behind ? > It seems a bit cleaner to only register the tables for the dma lines that > are actually present on a given chip. Okay, let's do this. Cheers. -- Robert