Received: by 10.213.65.68 with SMTP id h4csp1448876imn; Wed, 21 Mar 2018 10:51:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELvSLPno4c5t1c/ndGRhX1D0bj6gMEAIc/QybNnXik4B1iuzwmyuAkEZRGkWrXecwThSNW5p X-Received: by 10.99.113.94 with SMTP id b30mr15462579pgn.196.1521654689088; Wed, 21 Mar 2018 10:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521654689; cv=none; d=google.com; s=arc-20160816; b=QLHn59+aMOktteO90yf2VBuzQBceRE9bUla6O4yQXa2COKPpKyJ3XAp4e5SoMzF3KK 5tezQPhKdbhpQvfkNvxUGjMS/afU4yOkznWNS5epPg71QYl3uVMCDXiA0FvpnQQg0JnN XkRFItJ0WgtFpnTD6pstjQbwBaO9T5UQXKiu20FUULN4jhfN/BvvJ2qgIG30jDHSC6Be 1CmtWRf3Hxv/9YolYutbi/enuX1NMYvbZePWlnfzq6mQnlgiuRAa5jh93tGpH/MxnYsb /Hg4AsYPD/RGUpYQp4sAEl1r2+j9jeXMXl/y2XU29Y8IkyGjW2QbiKQ7B5wWEhzJHP0B c7nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=kTKDEeGK9zHAjEWwiYCfReufVwAR142wE5zoDr5eT+8=; b=tLa1iw6KdM+g9KDUxIO1DRbbOV8Y5tCzjgrzU+wVmMrRdnlgPhwT/pJyDxHqEKYLH+ y2LShJdVKwE6cjys9cN0rG9XUC2UnD05i6ASBrjRhAUSqWmLB9ZxgBGOgN3fORfgP0KZ /snmIziqjIfKcVZMiYJqHRYpR9CBGBE5iNfodjF7gjjuV+gCPyVc9Gcp7cx4doqhCWOD DZxAJG0SYzgoFLm5jYteSN89dw/NAe2enrNBIR0wcJSjBv5tuNKw4qJQzM3J0/A1JbFG QpPk2x1SSEAckHZ+BEMDgFh+V4VEwOampUf8uqT1HcfTiv6AItRxJXjClJv+SphIbNn8 kcfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16si3011432pgv.255.2018.03.21.10.51.13; Wed, 21 Mar 2018 10:51:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbeCURt3 (ORCPT + 99 others); Wed, 21 Mar 2018 13:49:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57070 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbeCURt0 (ORCPT ); Wed, 21 Mar 2018 13:49:26 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2524A1107; Wed, 21 Mar 2018 17:49:25 +0000 (UTC) Date: Wed, 21 Mar 2018 18:49:24 +0100 From: Greg KH To: Nipun Gupta Cc: "robin.murphy@arm.com" , "hch@lst.de" , "linux@armlinux.org.uk" , "m.szyprowski@samsung.com" , "bhelgaas@google.com" , "zajec5@gmail.com" , "andy.gross@linaro.org" , "david.brown@linaro.org" , "dan.j.williams@intel.com" , "vinod.koul@intel.com" , "thierry.reding@gmail.com" , "robh+dt@kernel.org" , "frowand.list@gmail.com" , "jarkko.sakkinen@linux.intel.com" , "rafael.j.wysocki@intel.com" , "dmitry.torokhov@gmail.com" , "johan@kernel.org" , "msuchanek@suse.de" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-wireless@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , "linux-soc@vger.kernel.org" , "dmaengine@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linux-tegra@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-pci@vger.kernel.org" , Bharat Bhushan , Leo Li Subject: Re: [PATCH v2 2/2] drivers: remove force dma flag from buses Message-ID: <20180321174924.GA11141@kroah.com> References: <1520868292-2479-1-git-send-email-nipun.gupta@nxp.com> <1521615323-4752-1-git-send-email-nipun.gupta@nxp.com> <1521615323-4752-2-git-send-email-nipun.gupta@nxp.com> <20180321093525.GT14085@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 04:28:46PM +0000, Nipun Gupta wrote: > > > > -----Original Message----- > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > Sent: Wednesday, March 21, 2018 15:05 > > To: Nipun Gupta > > Cc: robin.murphy@arm.com; hch@lst.de; linux@armlinux.org.uk; > > m.szyprowski@samsung.com; bhelgaas@google.com; zajec5@gmail.com; > > andy.gross@linaro.org; david.brown@linaro.org; dan.j.williams@intel.com; > > vinod.koul@intel.com; thierry.reding@gmail.com; robh+dt@kernel.org; > > frowand.list@gmail.com; jarkko.sakkinen@linux.intel.com; > > rafael.j.wysocki@intel.com; dmitry.torokhov@gmail.com; johan@kernel.org; > > msuchanek@suse.de; linux-kernel@vger.kernel.org; iommu@lists.linux- > > foundation.org; linux-wireless@vger.kernel.org; linux-arm- > > msm@vger.kernel.org; linux-soc@vger.kernel.org; dmaengine@vger.kernel.org; > > dri-devel@lists.freedesktop.org; linux-tegra@vger.kernel.org; > > devicetree@vger.kernel.org; linux-pci@vger.kernel.org; Bharat Bhushan > > ; Leo Li > > Subject: Re: [PATCH v2 2/2] drivers: remove force dma flag from buses > > > > On Wed, Mar 21, 2018 at 12:25:23PM +0530, Nipun Gupta wrote: > > > With each bus implementing its own DMA configuration callback, > > > there is no need for bus to explicitly have force_dma in its > > > global structure. This patch modifies of_dma_configure API to > > > accept an input parameter which specifies if implicit DMA > > > configuration is required even when it is not described by the > > > firmware. > > > > Having to "remember" what that bool variable means on the end of the > > function call is a royal pain over time, right? > > > > Why not just create a new function: > > dma_common_configure_force(dma) > > that always does this? Leave "dma_common_configure()" alone, and then > > wrap the old code with these two helper functions that call the 'core' > > code with the bool set properly? > > > > That way you do not have to "know" what that parameter is, the function > > name just documents it automatically, so when you see it in the > > bus-specific code, no need to go and have to hunt for anything. And if > > you are reading the dma core code, it's obvious what is happening as the > > functions are all right there. > > How about we do not pass any flag in 'dma_common_configure()', and inside this > API we pass "true" to 'of_dma_configure()'? I am saying this because currently > both the busses (platform and AMBA) which uses 'dma_common_configure()' passes > "true" value. If we create additional 'dma_common_configure_force()', then > 'dma_common_configure()' will not be used anytime and will become redundant. > > If someday new busses come and they needs to use similar functionality which > 'dma_common_configure()' provides, but with passing "false" to 'of_dma_configure()', > then what you suggests of having two separate such API's will be more reasonable > and can be implemented? If that makes things "simple", yes, sounds good. greg k-h