public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Ben Dooks <ben.dooks@codethink.co.uk>
Cc: Stefan Agner <stefan@agner.ch>,
	digetx@gmail.com, dri-devel@lists.freedesktop.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-tegra-owner@vger.kernel.org
Subject: Re: [PATCH] gpu: host1x: fix compile error when IOMMU API is not available
Date: Thu, 11 Apr 2019 10:30:17 +0200	[thread overview]
Message-ID: <20190411083017.GB4633@ulmo> (raw)
In-Reply-To: <7371b1573ddd0b127713724ef5051a6f@codethink.co.uk>

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

On Thu, Apr 11, 2019 at 09:23:13AM +0100, Ben Dooks wrote:
> 
> 
> On 2019-04-10 23:47, Stefan Agner wrote:
> > In case the IOMMU API is not available compiling host1x fails with
> > the following error:
> >   In file included from drivers/gpu/host1x/hw/host1x06.c:27:
> >   drivers/gpu/host1x/hw/channel_hw.c: In function
> > ‘host1x_channel_set_streamid’:
> >   drivers/gpu/host1x/hw/channel_hw.c:118:30: error: implicit
> > declaration of function
> >     ‘dev_iommu_fwspec_get’; did you mean ‘iommu_fwspec_free’?
> > [-Werror=implicit-function-declaration]
> >   struct iommu_fwspec *spec =
> > dev_iommu_fwspec_get(channel->dev->parent);
> >                               ^~~~~~~~~~~~~~~~~~~~
> >                               iommu_fwspec_free
> > 
> > Fixes: de5469c21ff9 ("gpu: host1x: Program the channel stream ID")
> > Signed-off-by: Stefan Agner <stefan@agner.ch>
> 
> would it be better to provide something like this i nthe header that
> defines dev_iommu_fwspec_get() to be:
> 
> static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
> { return NULL; }
> 
> although returning an PTR_ERR would have been better.

I don't think there's really a large number of failures here. Either
your device has an IOMMU fwspec or it doesn't.

But yes, I think it'd be better to have the above static inline dummy in
iommu.h, but I'll apply this for now in the hopes of getting it in
before v5.1 final.

Thierry

> 
> > ---
> >  drivers/gpu/host1x/hw/channel_hw.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/host1x/hw/channel_hw.c
> > b/drivers/gpu/host1x/hw/channel_hw.c
> > index 27101c04a827..4030d64916f0 100644
> > --- a/drivers/gpu/host1x/hw/channel_hw.c
> > +++ b/drivers/gpu/host1x/hw/channel_hw.c
> > @@ -114,7 +114,7 @@ static inline void synchronize_syncpt_base(struct
> > host1x_job *job)
> > 
> >  static void host1x_channel_set_streamid(struct host1x_channel *channel)
> >  {
> > -#if HOST1X_HW >= 6
> > +#if IS_ENABLED(CONFIG_IOMMU_API) &&  HOST1X_HW >= 6
> >  	struct iommu_fwspec *spec =
> > dev_iommu_fwspec_get(channel->dev->parent);
> >  	u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;

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

  reply	other threads:[~2019-04-11  8:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10 22:47 [PATCH] gpu: host1x: fix compile error when IOMMU API is not available Stefan Agner
2019-04-11  8:23 ` Ben Dooks
2019-04-11  8:30   ` Thierry Reding [this message]
2019-04-11 10:06     ` Mikko Perttunen
2019-04-11 11:31       ` Dmitry Osipenko
2019-04-11 15:37         ` Thierry Reding
2019-04-11 10:57   ` Stefan Agner

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=20190411083017.GB4633@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=ben.dooks@codethink.co.uk \
    --cc=digetx@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra-owner@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=stefan@agner.ch \
    /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