[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180313073448.GA32269@lst.de>
Date: Tue, 13 Mar 2018 08:34:48 +0100
From: Christoph Hellwig <hch@....de>
To: Nipun Gupta <nipun.gupta@....com>
Cc: hch@....de, robin.murphy@....com, linux@...linux.org.uk,
gregkh@...uxfoundation.org, m.szyprowski@...sung.com,
bhelgaas@...gle.com, 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
> +int amba_dma_configure(struct device *dev)
> +{
> + enum dev_dma_attr attr;
> + int ret = 0;
> +
> + if (dev->of_node) {
> + ret = of_dma_configure(dev, dev->of_node);
> + } else if (has_acpi_companion(dev)) {
> + attr = acpi_get_dma_attr(to_acpi_device_node(dev->fwnode));
> + if (attr != DEV_DMA_NOT_SUPPORTED)
> + ret = acpi_dma_configure(dev, attr);
> + }
> +
> + return ret;
This code sniplet is duplicated so many times that I think we should
just have some sort of dma_common_configure() for it that the various
busses can use.
> +void amba_dma_deconfigure(struct device *dev)
> +{
> + of_dma_deconfigure(dev);
> + acpi_dma_deconfigure(dev);
> +}
As mention in my previous reply I think we don't even need a deconfigure
callback at this point - just remove the ACPI and OF wrappers and
clear the dma ops.
Also in this series we should replace the force_dma flag by use of the
proper method, e.g. give a force parameter to of_dma_configure and the
new dma_common_configure helper that the busses that want it can set.
Powered by blists - more mailing lists