[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <HE1PR0401MB24250A8631823FB3108EA62CE6D20@HE1PR0401MB2425.eurprd04.prod.outlook.com>
Date: Tue, 13 Mar 2018 04:22:53 +0000
From: Nipun Gupta <nipun.gupta@....com>
To: Sinan Kaya <okaya@...eaurora.org>, "hch@....de" <hch@....de>,
"robin.murphy@....com" <robin.murphy@....com>,
"linux@...linux.org.uk" <linux@...linux.org.uk>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>
CC: "dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
"rafael.j.wysocki@...el.com" <rafael.j.wysocki@...el.com>,
"jarkko.sakkinen@...ux.intel.com" <jarkko.sakkinen@...ux.intel.com>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"johan@...nel.org" <johan@...nel.org>,
"msuchanek@...e.de" <msuchanek@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
Bharat Bhushan <bharat.bhushan@....com>,
Leo Li <leoyang.li@....com>
Subject: RE: [PATCH] dma-mapping: move dma configuration to bus infrastructure
> -----Original Message-----
> From: Sinan Kaya [mailto:okaya@...eaurora.org]
> Sent: Monday, March 12, 2018 22:14
> To: Nipun Gupta <nipun.gupta@....com>; hch@....de;
> robin.murphy@....com; linux@...linux.org.uk; gregkh@...uxfoundation.org;
> m.szyprowski@...sung.com; bhelgaas@...gle.com
> Cc: dmitry.torokhov@...il.com; rafael.j.wysocki@...el.com;
> jarkko.sakkinen@...ux.intel.com; linus.walleij@...aro.org; johan@...nel.org;
> msuchanek@...e.de; linux-kernel@...r.kernel.org; iommu@...ts.linux-
> foundation.org; linux-pci@...r.kernel.org
> Subject: Re: [PATCH] dma-mapping: move dma configuration to bus
> infrastructure
>
> On 3/12/2018 11:24 AM, Nipun Gupta wrote:
> > + if (dma_dev->of_node) {
> > + ret = of_dma_configure(dev, dma_dev->of_node);
> > + } else if (has_acpi_companion(dma_dev)) {
> > + attr = acpi_get_dma_attr(to_acpi_device_node(dma_dev-
> >fwnode));
> > + if (attr != DEV_DMA_NOT_SUPPORTED)
> > + ret = acpi_dma_configure(dev, attr);
> > + }
> > +
> > + pci_put_host_bridge_device(bridge);
> > +
> > + return ret;
> > +}
> > +
> > +void pci_dma_deconfigure(struct device *dev)
> > +{
> > + of_dma_deconfigure(dev);
> > + acpi_dma_deconfigure(dev);
> > +}
>
> 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.
Ill update this in v2, and also make similar changes for platform and AMBA bus.
Thanks,
Nipun
>
> --
> Sinan Kaya
> Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
> Technologies, Inc.
> Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux
> Foundation Collaborative Project.
Powered by blists - more mailing lists