Thread (1 message) 1 message, 1 author, 2017-09-25

[PATCH 2/2] of: configure DMA for host1x devices

From: Thierry Reding <hidden>
Date: 2017-09-25 07:44:48
Also in: linux-devicetree, linux-tegra

On Sun, Sep 24, 2017 at 12:04:54PM +0300, Mikko Perttunen wrote:
quoted hunk
Devices in the host1x bus rely on the old behavior of of_dma_configure
to set up DMA ops. Add a check for them into of_dma_configure.

We must do the check using a string comparison instead of using
pointers since the host1x bus can be compiled into a module.

Fixes: 723288836628 ("of: restrict DMA configuration")
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/of/device.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 64b710265d39..12368418cd33 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -104,6 +104,9 @@ int of_dma_configure(struct device *dev, struct device_node *np)
 		if (!dev_is_pci(dev) &&
 #ifdef CONFIG_ARM_AMBA
 		    dev->bus != &amba_bustype &&
+#endif
+#if IS_ENABLED(CONFIG_TEGRA_HOST1X)
+		    !(dev->bus && !strcmp("host1x", dev->bus->name)) &&
 #endif
 		    dev->bus != &platform_bus_type)
 			return ret == -ENODEV ? 0 : ret;
Maybe a slightly better solution would be to add a dev_is_host1x()
function that returns dev->bus == &host1x_bus_type if TEGRA_HOST1X is
enabled and returns false otherwise. That way we can have a "proper"
check for the bus type and avoid the #if in this file.

It's slightly more complicated because of the dependencies between the
DT and Tegra DRM trees, but I'm sure we can get Rob to either give his
Acked-by on the drivers/of/device.c change or carry the Tegra DRM patch
in the DT tree.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170925/9c58ca02/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help