devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	hch-jcswGhMUV9g@public.gmane.org,
	robin.murphy-5wv7dgnIgG8@public.gmane.org,
	robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/2] of: configure DMA for host1x devices
Date: Mon, 25 Sep 2017 09:44:48 +0200	[thread overview]
Message-ID: <20170925074448.GB12494@ulmo.fritz.box> (raw)
In-Reply-To: <20170924090454.28116-2-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]

On Sun, Sep 24, 2017 at 12:04:54PM +0300, Mikko Perttunen wrote:
> 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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-09-25  7:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-24  9:04 [PATCH 1/2] gpu: host1x: Call of_dma_configure after setting bus Mikko Perttunen
     [not found] ` <20170924090454.28116-1-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-09-24  9:04   ` [PATCH 2/2] of: configure DMA for host1x devices Mikko Perttunen
     [not found]     ` <20170924090454.28116-2-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2017-09-25  7:44       ` Thierry Reding [this message]
     [not found]         ` <20170925074448.GB12494-m5CkvRiFyV9wFLYp8hBm2A@public.gmane.org>
2017-09-25 12:26           ` Robin Murphy
     [not found]             ` <dd8e9524-1d91-2c8b-a753-086d3ad9f9c9-5wv7dgnIgG8@public.gmane.org>
2017-09-25 12:47               ` Christoph Hellwig
2017-09-25 18:26               ` Mikko Perttunen
2017-09-26 11:27               ` Thierry Reding
2017-10-11 13:06               ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170925074448.GB12494@ulmo.fritz.box \
    --to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).