From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [02/15] ARM: pxa: add dma slave map From: Robert Jarzmik Message-Id: <87d0ze4w18.fsf@belgarion.home> Date: Wed, 04 Apr 2018 21:21:55 +0200 To: Arnd Bergmann Cc: Daniel Mack , Haojian Zhuang , Vinod Koul , Linux ARM , Linux Kernel Mailing List , dmaengine@vger.kernel.org List-ID: QXJuZCBCZXJnbWFubiA8YXJuZEBhcm5kYi5kZT4gd3JpdGVzOgoKPiBPbiBUdWUsIEFwciAzLCAy MDE4IGF0IDEwOjE5IFBNLCBSb2JlcnQgSmFyem1payA8cm9iZXJ0LmphcnptaWtAZnJlZS5mcj4g d3JvdGU6Cj4+IC4uLiBjaG9wIGNob3AgcmVtb3ZpbmcgdW5uZWVkZWQgcmVjaXBpZW50cyAuLi4u Cj4+Cj4+IEFybmQgQmVyZ21hbm4gPGFybmRAYXJuZGIuZGU+IHdyaXRlczoKPj4+IEl0IHN0aWxs IGZlZWxzIG9kZCB0byBtZSB0aGF0IHRoZXJlIGlzIGFuIGVudHJ5IGluIHRoZSBzbGF2ZSBtYXAg Zm9yCj4+PiBhIGRldmljZSB0aGF0IGRvZXMgbm90IGhhdmUgYSByZXF1ZXN0IGxpbmUuIEhvd2V2 ZXIsIGl0IGFsc28gc2VlbXMKPj4+IHRoYXQgdGhlIGVudGlyZSBjb2RlIGluIHRob3NlIHR3byBk cml2ZXJzIHRoYXQgZGVhbHMgd2l0aCBETUEgaXMgc3BlY2lmaWMKPj4+IHRvIFBYQSBhbnl3YXks IHNvIG1heWJlIGl0IGNhbiBiZSBkb25lIGRpZmZlcmVudGx5OiBpbnN0ZWFkIG9mCj4+PiBjYWxs aW5nIGRtYV9yZXF1ZXN0X3NsYXZlX2NoYW5uZWxfY29tcGF0KCkgb3IgZG1hX3JlcXVlc3RfY2hh bigpCj4+PiB3aXRoIGEgZmFrZSByZXF1ZXN0IGxpb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lIGNhbGxlZCBpbiBweGFfZG1hIGRyaXZlciwgYW5kIHRoZXJlZm9y ZSB0aGUgbGFzdAo+PiAgICByZXF1ZXN0b3Igb2YgdGhlIGNoYW5uZWwgd2lsbCBiZSB1c2VkLCB3 aGljaCBpcyBiYWQuCj4KPiBDYW4ndCB5b3UganVzdCByZXNldCB0aG9zZSBpbiBweGFkX2ZyZWVf Y2hhbl9yZXNvdXJjZXMoKT8KSSBjYW4sIGxldCdzIHNlZSB3aGF0IGhhcHBlbnMgbmV4dCAuLi4K CkNoZWVycy4K From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752448AbeDDTW1 (ORCPT ); Wed, 4 Apr 2018 15:22:27 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:29942 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbeDDTWH (ORCPT ); Wed, 4 Apr 2018 15:22:07 -0400 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Wed, 04 Apr 2018 21:22:04 +0200 X-ME-IP: 86.201.130.131 From: Robert Jarzmik To: Arnd Bergmann Cc: Daniel Mack , Haojian Zhuang , Vinod Koul , Linux ARM , Linux Kernel Mailing List , dmaengine@vger.kernel.org Subject: Re: [PATCH 02/15] ARM: pxa: add dma slave map References: <20180402142656.26815-1-robert.jarzmik@free.fr> <20180402142656.26815-3-robert.jarzmik@free.fr> <87tvss48ti.fsf@belgarion.home> <87h8os3uwa.fsf@belgarion.home> X-URL: http://belgarath.falguerolles.org/ Date: Wed, 04 Apr 2018 21:21:55 +0200 In-Reply-To: (Arnd Bergmann's message of "Wed, 4 Apr 2018 12:18:58 +0200") Message-ID: <87d0ze4w18.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann writes: > On Tue, Apr 3, 2018 at 10:19 PM, Robert Jarzmik wrote: >> ... chop chop removing unneeded recipients .... >> >> Arnd Bergmann writes: >>> 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 > > Right, but it could just always use a static priority, right? Yes, an implicit default priority. I'm not a big fan of implicit parameters, yet I can do it. >> - 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. > > Can't you just reset those in pxad_free_chan_resources()? I can, let's see what happens next ... Cheers. -- Robert From mboxrd@z Thu Jan 1 00:00:00 1970 From: robert.jarzmik@free.fr (Robert Jarzmik) Date: Wed, 04 Apr 2018 21:21:55 +0200 Subject: [PATCH 02/15] ARM: pxa: add dma slave map In-Reply-To: (Arnd Bergmann's message of "Wed, 4 Apr 2018 12:18:58 +0200") References: <20180402142656.26815-1-robert.jarzmik@free.fr> <20180402142656.26815-3-robert.jarzmik@free.fr> <87tvss48ti.fsf@belgarion.home> <87h8os3uwa.fsf@belgarion.home> Message-ID: <87d0ze4w18.fsf@belgarion.home> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Arnd Bergmann writes: > On Tue, Apr 3, 2018 at 10:19 PM, Robert Jarzmik wrote: >> ... chop chop removing unneeded recipients .... >> >> Arnd Bergmann writes: >>> 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 > > Right, but it could just always use a static priority, right? Yes, an implicit default priority. I'm not a big fan of implicit parameters, yet I can do it. >> - 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. > > Can't you just reset those in pxad_free_chan_resources()? I can, let's see what happens next ... Cheers. -- Robert