Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753645AbbFDP62 (ORCPT ); Thu, 4 Jun 2015 11:58:28 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:58650 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbbFDP6X (ORCPT ); Thu, 4 Jun 2015 11:58:23 -0400 Message-ID: <5570758E.6030302@ti.com> Date: Thu, 4 Jun 2015 18:58:06 +0300 From: Peter Ujfalusi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Vinod Koul CC: Geert Uytterhoeven , Tony Lindgren , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Dan Williams , , "linux-serial@vger.kernel.org" , "linux-omap@vger.kernel.org" , Linux MMC List , , linux-spi , Linux Media Mailing List , ALSA Development Mailing List Subject: Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason() References: <1432646768-12532-1-git-send-email-peter.ujfalusi@ti.com> <1432646768-12532-3-git-send-email-peter.ujfalusi@ti.com> <20150529093317.GF3140@localhost> <20150529101846.GG3140@localhost> <55687892.7050606@ti.com> <20150602125535.GS3140@localhost> In-Reply-To: <20150602125535.GS3140@localhost> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4242 Lines: 90 Vinod, On 06/02/2015 03:55 PM, Vinod Koul wrote: > On Fri, May 29, 2015 at 05:32:50PM +0300, Peter Ujfalusi wrote: >> On 05/29/2015 01:18 PM, Vinod Koul wrote: >>> On Fri, May 29, 2015 at 11:42:27AM +0200, Geert Uytterhoeven wrote: >>>> On Fri, May 29, 2015 at 11:33 AM, Vinod Koul wrote: >>>>> On Tue, May 26, 2015 at 04:25:57PM +0300, Peter Ujfalusi wrote: >>>>>> dma_request_slave_channel_compat() 'eats' up the returned error codes which >>>>>> prevents drivers using the compat call to be able to do deferred probing. >>>>>> >>>>>> The new wrapper is identical in functionality but it will return with error >>>>>> code in case of failure and will pass the -EPROBE_DEFER to the caller in >>>>>> case dma_request_slave_channel_reason() returned with it. >>>>> This is okay but am worried about one more warpper, how about fixing >>>>> dma_request_slave_channel_compat() >>>> >>>> Then all callers of dma_request_slave_channel_compat() have to be >>>> modified to handle ERR_PTR first. >>>> >>>> The same is true for (the existing) dma_request_slave_channel_reason() >>>> vs. dma_request_slave_channel(). >>> Good point, looking again, I think we should rather fix >>> dma_request_slave_channel_reason() as it was expected to return err code and >>> add new users. Anyway users of this API do expect the reason... >> >> Hrm, they are for different use.dma_request_slave_channel()/_reason() is for >> drivers only working via DT or ACPI while >> dma_request_slave_channel_compat()/_reason() is for drivers expected to run in >> DT/ACPI or legacy mode as well. >> >> I added the dma_request_slave_channel_compat_reason() because OMAP/daVinci >> drivers are using this to request channels - they need to support DT and >> legacy mode. > I think we should hide these things behind the API and do this behind the > hood for ACPI/DT systems. > > Also it makes sense to use right API and mark rest as depricated So to convert the dma_request_slave_channel_compat() and not to create _reason variant? Or to have single API to request channel? The problem with that is that we need different parameters for legacy and DT for example. >> >> But it is doable to do this for both the non _compat and _compat version: >> 1. change all users to check IS_ERR_OR_NULL(chan) >> return the PTR_ERR if not NULL, or do whatever the driver was doing in case >> of chan == NULL. >> 2. change the non _compat and _compat versions to do the same as the _reason >> variants, #define the _reason ones to the non _reason names >> 3. Rename the _reason use to non _reason function in drivers >> 4. Remove the #defines for the _reason functions >> 5. Change the IS_ERR_OR_NULL(chan) to IS_ERR(chan) in all drivers >> The result: >> Both dma_request_slave_channel() and dma_request_slave_channel_compat() will >> return ERR_PTR in case of failure or in success they will return the pinter to >> chan. >> >> Is this what you were asking? >> It is a bit broader than what this series was doing: taking care of >> OMAP/daVinci drivers for deferred probing regarding to dmaengine ;) > Yes but it would make sense right? I know it is a larger work but then we > wouldn't want another dma_request_slave_xxx API, at some point we have stop > it exapnding, perhpas now :) Yes, it make sense to get rid if the _reason() things and have the dma_request_slave_channel() and dma_request_slave_channel_compat() return with error code One thing we need to do for this is to change the error codes coming back from the _dt() and _acpi() calls when we boot in legacy mode. Right now the only error code which comes back is -ENODEV and -EPROBE_DEFER. We need to differentiate between 'real' errors and from the fact that we did not booted with DT or the ACPI is not available. IMHO if we boot with DT and the channel request fails with other than -EPROBE_DEFER we should not go and try to get the channel via legacy API. > Yes I am all ears to stage this work and not do transition gardually.. > -- P?ter -- 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/