Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756098AbbKRPIB (ORCPT ); Wed, 18 Nov 2015 10:08:01 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:54117 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755977AbbKRPH4 (ORCPT ); Wed, 18 Nov 2015 10:07:56 -0500 From: Arnd Bergmann To: Peter Ujfalusi Cc: Vinod Koul , Geert Uytterhoeven , Tony Lindgren , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Dan Williams , dmaengine@vger.kernel.org, "linux-serial@vger.kernel.org" , "linux-omap@vger.kernel.org" , Linux MMC List , linux-crypto@vger.kernel.org, linux-spi , Linux Media Mailing List , ALSA Development Mailing List Subject: Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason() Date: Wed, 18 Nov 2015 16:07:42 +0100 Message-ID: <6358656.jIv3GGCCXu@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <564C8E1F.8010501@ti.com> References: <1432646768-12532-1-git-send-email-peter.ujfalusi@ti.com> <6347063.Gd6coh6hX8@wuerfel> <564C8E1F.8010501@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:zkMeze0uFf986TCTdh2iI6BQX7vGwjR7tRrMXc+8bxb+olk1Hcd qiuYCVpxMq/LRg/4q+R0/ApJVrI1WwaUECbK/XFmKpEbZTpC5Rq2EmF7OwAqg+ZaPIC9CNe OCF+IULYRyR739ftgJtyV2lWZuW2w/WDTT2uPqo5eYvmyME81LvgpqHpKwtXHYTJXo8hB7O orzJoetVXPkm7B6l8MCog== X-UI-Out-Filterresults: notjunk:1;V01:K0:WKeqNIstzBc=:XYdoYHwdDQTTSrLYs+BQyD elDHIDyC1AiSfWULoSGvg8nGeDjEPst/Ve4Rl835dDNHwN/45Hp42ERY/vBSfuytG9kUh+jwy FVmwQrN4HoKLObdTFIGZqQ7hB3S9c0Nszes2JmnRZMtTAgRNPJfTpadI58BkmOwAJIwrpYeLp Umv/x+KR43/kjVGIQnSc3AFHDa9WF9GYAbTWo2CqN7o6SBQzMTrK7dCrnzaJwTCx5gI2W4/6f daf72bz2GzciLoLK0vrIp8H3VrSlwDtM5Gaosok9qk4xfx3EVa7XEzHObMRAJmy6hGxZey0f6 MvvyfarYVcJ09qpSFoO7bRQRUmq3XguysuyDIPxWMoq6nYcAKP5YUoobyC/v5Qr2MM43aG9+p MZcKEcH833OfxOf+uT76UjDblfYvTA81AuQFXUG0TzKrxzOZaqPT9DeX48ikgOdat9znNOg5x 2A4x3cOHht7D6abw+Pe6QRHxYEsVbcJEqHHBnSRxDTS/zisA9lBgbwOsgYjOuEpcrC/qtt4qK BWQcf4S8K6R6trJ9zW7MH8FLSewTavksA0DBETEwRVURP/fRX3hkhE2xXsaTecVViEEbMlFFV VmB8MhFJxEm6JnXXrwYiqsuKbf8mOmLgGtp6FCvoRPbttXwb0nD+QFLrzuakuJdWISCdT1MrN q7OhswycYQF87uk8VBbmAK4Mpes1yBFaE/HninbFEyrWLm7uhxSIrnENBfjyGFNC5lPeJxLmo dKEsvh0ZkGEAtKuP Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2615 Lines: 53 On Wednesday 18 November 2015 16:41:35 Peter Ujfalusi wrote: > On 11/18/2015 04:29 PM, Arnd Bergmann wrote: > > On Wednesday 18 November 2015 16:21:26 Peter Ujfalusi wrote: > >> 2. non slave channel requests, where only the functionality matters, like > >> memcpy, interleaved, memset, etc. > >> We could have a simple: > >> dma_request_channel(mask); > >> > >> But looking at the drivers using dmaengine legacy dma_request_channel() API: > >> Some sets DMA_INTERRUPT or DMA_PRIVATE or DMA_SG along with DMA_SLAVE: > >> drivers/misc/carma/carma-fpga.c DMA_INTERRUPT|DMA_SLAVE|DMA_SG > >> drivers/misc/carma/carma-fpga-program.c DMA_MEMCPY|DMA_SLAVE|DMA_SG > >> drivers/media/platform/soc_camera/mx3_camera.c DMA_SLAVE|DMA_PRIVATE > >> sound/soc/intel/common/sst-firmware.c DMA_SLAVE|DMA_MEMCPY > >> > >> as examples. > >> Not sure how valid are these... I just had a look myself. carma has been removed fortunately in linux-next, so we don't have to worry about that any more. I assume that the sst-firmware.c case is a mistake, it should just use a plain DMA_SLAVE and not DMA_MEMCPY. Aside from these, everyone else uses either DMA_CYCLIC in addition to DMA_SLAVE, which seems valid, or they use DMA_PRIVATE, which I think is redundant in slave drivers and can be removed. > > It's usually not much harder to separate out the legacy case from > > the normal dma_request_slave_channel_reason(), so those drivers don't > > really need to use the unified compat API. > > The current dma_request_slave_channel()/_reason() is not the 'legacy' API. > Currently there is no way to get the reason why the dma channel request fails > when using the _compat() version of the API, which is used by drivers which > can be used in DT or in legacy mode as well. Sure, they all could have local > if(){}else{} for handling this, but it is not a nice thing. > > As it was discussed instead of adding the _reason() version for the _compat > call, we should simplify the dmaengine API for getting the channel and at the > same time we will have ERR_PTR returned instead of NULL. What I meant was that we don't need to handle them with the unified simple interface. The users of DMA_CYCLIC can just keep using an internal helper that only deals with the legacy case, or use dma_request_slave() or whatever is the new API for the DT case. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/