Received: by 10.213.65.68 with SMTP id h4csp189087imn; Tue, 13 Mar 2018 00:29:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELtHcfNWYbYqhGc4qWhVq7kNa3/m/bLVGU8XYBy/lZqiR9H9FwdKlyRTYEAuw/4anFtkat3t X-Received: by 2002:a17:902:6b81:: with SMTP id p1-v6mr10992666plk.181.1520926172146; Tue, 13 Mar 2018 00:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520926172; cv=none; d=google.com; s=arc-20160816; b=owhqFiYN2oYPGKJvU9SDQNeWAhvKx32xS3oIhWhPYEFmcFltB0rEWaRNrlaxRvpzP2 nY6cr5QSVB8sXbioi5l3Sf1DU7CUtWp42WCbVglZ/KY/+ni4Gc4jsaxIJNl6XViYfjxc 5tijoM18R0OeMJu5c4OuEHMmRaXpsI0mmteOjvdjltkeYSi9GQzGZ2raRf8BPJE+yrUS z35XJG5Wt0cQO1nzBRc+mqJ4ziw1FlxSN0l6pN6Dwu59HObBfXA9lyUfJ2OcCHcK0+do gAP4kJ7V0823Zk8SpTK4xm/3aBU+pOQxT9SOTYRmIPMTo7l/x2SUpkNZbT7JP2/H1Bep BLqQ== 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=3R2hAeVQOlSxLgdFuATQ8cSNflDigwlFv5YYwHsY58I=; b=T1uBo4Y3p1zKMxxfqFmxrmgIbk2hzJlb2aO79WL2UW7v02hZxxKEqWedFVwxZZoM6m TskG0WPrMyq7sgstptRD7D+14MzvERcdp0lwKWoklkzA19dZHTUauJv3WJYAFqorOAcK 1jBZBGJtHpHpgN5z0tmk9jpGvudS8W/LRmbtDXLt6+JK2IaaOWBSIQGHN9/Ue1mDTK8w NFxl4Zqam1lKDbsEdnp63CB2151WfQt5G3Yx4yQxW7evnO6l7arUWhMyvr5MUS33Fncn IBB140YlwYtlW1cLHNYRAwAhwzvvQokylfCIAVxECASll9JWJ2xuH0e7GZbeXELcwyW6 s4CQ== 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 h4-v6si7405898pln.648.2018.03.13.00.29.18; Tue, 13 Mar 2018 00:29:32 -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 S1752163AbeCMH1b (ORCPT + 99 others); Tue, 13 Mar 2018 03:27:31 -0400 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 Received: by newverein.lst.de (Postfix, from userid 2407) id 10C5B7F12C; Tue, 13 Mar 2018 08:27:28 +0100 (CET) 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.