From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:56398 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483AbeCMH13 (ORCPT ); Tue, 13 Mar 2018 03:27:29 -0400 Date: Tue, 13 Mar 2018 08:27:28 +0100 From: "hch@lst.de" To: Nipun Gupta Cc: Sinan Kaya , "hch@lst.de" , "robin.murphy@arm.com" , "linux@armlinux.org.uk" , "gregkh@linuxfoundation.org" , "m.szyprowski@samsung.com" , "bhelgaas@google.com" , "dmitry.torokhov@gmail.com" , "rafael.j.wysocki@intel.com" , "jarkko.sakkinen@linux.intel.com" , "linus.walleij@linaro.org" , "johan@kernel.org" , "msuchanek@suse.de" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-pci@vger.kernel.org" , Bharat Bhushan , Leo Li Subject: Re: [PATCH] dma-mapping: move dma configuration to bus infrastructure Message-ID: <20180313072727.GA32191@lst.de> References: <1520868292-2479-1-git-send-email-nipun.gupta@nxp.com> <6a76df69-8c6c-52a6-0afd-fd0b8d2ff703@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-pci-owner@vger.kernel.org List-ID: On Tue, Mar 13, 2018 at 04:22:53AM +0000, Nipun Gupta wrote: > > Isn't this one or the other one but not both? > > > > Something like: > > > > if (dev->of_node) > > of_dma_deconfigure(dev); > > else > > acpi_dma_deconfigure(dev); > > > > should work. > > I understand your point. Seems reasonable as we should not expect > the 'of/acpi DMA deconfigure' API to not fail when they are not configured. > > But, here we would also need to get dma_device (just as we get in > 'pci_dma_configure') and need a check on it as for PCI there 'of_node' > is present in the dma_dev. Both of_dma_deconfigure and acpi_dma_deconfigure just end up calling arch_teardown_dma_ops. So my preference would be to just remove of_dma_deconfigure and acpi_dma_deconfigure and call arch_teardown_dma_ops as a prep patch before this one.