Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683765 > unrolled thread

[PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

Started byPaul Kocialkowski <contact@paulk.fr>
First post2017-07-09 18:40 +0200
Last post2017-07-11 17:20 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124 Paul Kocialkowski <contact@paulk.fr> - 2017-07-09 18:40 +0200
    Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on  tegra124 Thierry Reding <thierry.reding@gmail.com> - 2017-07-10 07:30 +0200
      Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on  tegra124 Paul Kocialkowski <contact@paulk.fr> - 2017-07-10 08:10 +0200
    Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on  tegra124 Paul Kocialkowski <contact@paulk.fr> - 2017-07-11 11:00 +0200
      Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on  tegra124 Marcel Ziswiler <marcel.ziswiler@toradex.com> - 2017-07-11 17:00 +0200
        Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on  tegra124 Paul Kocialkowski <contact@paulk.fr> - 2017-07-11 17:10 +0200
          Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on  tegra124 Marcel Ziswiler <marcel.ziswiler@toradex.com> - 2017-07-11 17:20 +0200

#1683765 — [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

FromPaul Kocialkowski <contact@paulk.fr>
Date2017-07-09 18:40 +0200
Subject[PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124
Message-ID<u1npw-1Bs-17@gated-at.bofh.it>
This registers the host1x node with the SMMU (as HC swgroup) to allow
the host1x code to attach to it. It avoid failing the probe sequence,
which resulted in the tegra drm driver not probing and thus nothing
being displayed on-screen.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
 arch/arm/boot/dts/tegra124.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 187a36c6d0fc..b3b89befffeb 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -85,6 +85,7 @@
 		clocks = <&tegra_car TEGRA124_CLK_HOST1X>;
 		resets = <&tegra_car 28>;
 		reset-names = "host1x";
+		iommus = <&mc TEGRA_SWGROUP_HC>;
 
 		#address-cells = <2>;
 		#size-cells = <2>;
-- 
2.13.1

[toc] | [next] | [standalone]


#1683960 — Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

FromThierry Reding <thierry.reding@gmail.com>
Date2017-07-10 07:30 +0200
SubjectRe: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124
Message-ID<u1zqG-Qc-5@gated-at.bofh.it>
In reply to#1683765

[Multipart message — attachments visible in raw view] — view raw

On Sun, Jul 09, 2017 at 07:36:14PM +0300, Paul Kocialkowski wrote:
> This registers the host1x node with the SMMU (as HC swgroup) to allow
> the host1x code to attach to it. It avoid failing the probe sequence,
> which resulted in the tegra drm driver not probing and thus nothing
> being displayed on-screen.
> 
> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> ---
>  arch/arm/boot/dts/tegra124.dtsi | 1 +
>  1 file changed, 1 insertion(+)

Thanks for tracking this down. However, I don't think this is an
appropriate fix for v4.12 because it requires an update to the DTB in
order to preserve functionality, which means we've broken DT ABI. The
proper fix I think needs to be to make usage of the IOMMU completely
optional in the host1x driver.

So I think what happens without this DT change is that the call to
iommu_attach_device() fails and we have no way to recover from that. I
think what we need to do is to free the domain in that case and make
sure we can continue without one. It's probably best to add an error
message, or maybe a warning to make sure people are aware.

Do you have the time to address this? If not, perhaps Mikko can take a
look?

Thierry

[toc] | [prev] | [next] | [standalone]


#1683973 — Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

FromPaul Kocialkowski <contact@paulk.fr>
Date2017-07-10 08:10 +0200
SubjectRe: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124
Message-ID<u1A3o-1hK-13@gated-at.bofh.it>
In reply to#1683960

[Multipart message — attachments visible in raw view] — view raw

Le lundi 10 juillet 2017 à 07:21 +0200, Thierry Reding a écrit :
> On Sun, Jul 09, 2017 at 07:36:14PM +0300, Paul Kocialkowski wrote:
> > This registers the host1x node with the SMMU (as HC swgroup) to
> > allow
> > the host1x code to attach to it. It avoid failing the probe
> > sequence,
> > which resulted in the tegra drm driver not probing and thus nothing
> > being displayed on-screen.
> > 
> > Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> > ---
> >  arch/arm/boot/dts/tegra124.dtsi | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Thanks for tracking this down. However, I don't think this is an
> appropriate fix for v4.12 because it requires an update to the DTB in
> order to preserve functionality, which means we've broken DT ABI. The
> proper fix I think needs to be to make usage of the IOMMU completely
> optional in the host1x driver.

I see, that makes sense.

> So I think what happens without this DT change is that the call to
> iommu_attach_device() fails and we have no way to recover from that.

That is exactly what is happening, indeed.

> I think what we need to do is to free the domain in that case and make
> sure we can continue without one. It's probably best to add an error
> message, or maybe a warning to make sure people are aware.

By freeing the domain, do you mean continuing without IOMMU support?
If so, then we should make sure to only behave that way for -ENODEV and
generally still fail for other errors.

> Do you have the time to address this? If not, perhaps Mikko can take a
> look?

I can craft a patch this evening, but if someone else wants to work on
it earlier, they are totally welcome to do it!

-- 
Paul Kocialkowski,

developer of free digital technology and hardware support.

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

[toc] | [prev] | [next] | [standalone]


#1684897 — Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

FromPaul Kocialkowski <contact@paulk.fr>
Date2017-07-11 11:00 +0200
SubjectRe: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124
Message-ID<u1Zbt-8vM-41@gated-at.bofh.it>
In reply to#1683765
On Sun, 2017-07-09 at 19:36 +0300, Paul Kocialkowski wrote:
> This registers the host1x node with the SMMU (as HC swgroup) to allow
> the host1x code to attach to it. It avoid failing the probe sequence,
> which resulted in the tegra drm driver not probing and thus nothing
> being displayed on-screen.

Fixes: 404bfb78daf3 ("gpu: host1x: Add IOMMU support")

> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> ---
>  arch/arm/boot/dts/tegra124.dtsi | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/tegra124.dtsi
> b/arch/arm/boot/dts/tegra124.dtsi
> index 187a36c6d0fc..b3b89befffeb 100644
> --- a/arch/arm/boot/dts/tegra124.dtsi
> +++ b/arch/arm/boot/dts/tegra124.dtsi
> @@ -85,6 +85,7 @@
>  		clocks = <&tegra_car TEGRA124_CLK_HOST1X>;
>  		resets = <&tegra_car 28>;
>  		reset-names = "host1x";
> +		iommus = <&mc TEGRA_SWGROUP_HC>;
>  
>  		#address-cells = <2>;
>  		#size-cells = <2>;
-- 
Paul Kocialkowski,

developer of free digital technology and hardware support

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

[toc] | [prev] | [next] | [standalone]


#1685111 — Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

FromMarcel Ziswiler <marcel.ziswiler@toradex.com>
Date2017-07-11 17:00 +0200
SubjectRe: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124
Message-ID<u24NQ-3B4-19@gated-at.bofh.it>
In reply to#1684897
On Tue, 2017-07-11 at 11:50 +0300, Paul Kocialkowski wrote:
> On Sun, 2017-07-09 at 19:36 +0300, Paul Kocialkowski wrote:
> > This registers the host1x node with the SMMU (as HC swgroup) to
> > allow
> > the host1x code to attach to it. It avoid failing the probe
> > sequence,
> > which resulted in the tegra drm driver not probing and thus nothing
> > being displayed on-screen.
> 
> Fixes: 404bfb78daf3 ("gpu: host1x: Add IOMMU support")
> 
> > Signed-off-by: Paul Kocialkowski <contact-
> > W9ppeneeCTY@public.gmane.org>

Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Apalis TK1, Jetson-TK1

> > ---
> >  arch/arm/boot/dts/tegra124.dtsi | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/boot/dts/tegra124.dtsi
> > b/arch/arm/boot/dts/tegra124.dtsi
> > index 187a36c6d0fc..b3b89befffeb 100644
> > --- a/arch/arm/boot/dts/tegra124.dtsi
> > +++ b/arch/arm/boot/dts/tegra124.dtsi
> > @@ -85,6 +85,7 @@
> >  		clocks = <&tegra_car TEGRA124_CLK_HOST1X>;
> >  		resets = <&tegra_car 28>;
> >  		reset-names = "host1x";
> > +		iommus = <&mc TEGRA_SWGROUP_HC>;
> >  
> >  		#address-cells = <2>;
> >  		#size-cells = <2>;

So I take it we still will need this one moving forward, correct?

How about tegra30, I guess the same applies there, isn't it? Should I
send a patch or are you guys doing that?

[toc] | [prev] | [next] | [standalone]


#1685114 — Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

FromPaul Kocialkowski <contact@paulk.fr>
Date2017-07-11 17:10 +0200
SubjectRe: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124
Message-ID<u24Xw-3TD-5@gated-at.bofh.it>
In reply to#1685111
On Tue, 2017-07-11 at 14:54 +0000, Marcel Ziswiler wrote:
> On Tue, 2017-07-11 at 11:50 +0300, Paul Kocialkowski wrote:
> > On Sun, 2017-07-09 at 19:36 +0300, Paul Kocialkowski wrote:
> > > This registers the host1x node with the SMMU (as HC swgroup) to
> > > allow
> > > the host1x code to attach to it. It avoid failing the probe
> > > sequence,
> > > which resulted in the tegra drm driver not probing and thus
> > > nothing
> > > being displayed on-screen.
> > 
> > Fixes: 404bfb78daf3 ("gpu: host1x: Add IOMMU support")
> > 
> > > Signed-off-by: Paul Kocialkowski <contact-
> > > W9ppeneeCTY@public.gmane.org>
> 
> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Tested-on: Apalis TK1, Jetson-TK1
> 
> > > ---
> > >  arch/arm/boot/dts/tegra124.dtsi | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/tegra124.dtsi
> > > b/arch/arm/boot/dts/tegra124.dtsi
> > > index 187a36c6d0fc..b3b89befffeb 100644
> > > --- a/arch/arm/boot/dts/tegra124.dtsi
> > > +++ b/arch/arm/boot/dts/tegra124.dtsi
> > > @@ -85,6 +85,7 @@
> > >  		clocks = <&tegra_car TEGRA124_CLK_HOST1X>;
> > >  		resets = <&tegra_car 28>;
> > >  		reset-names = "host1x";
> > > +		iommus = <&mc TEGRA_SWGROUP_HC>;
> > >  
> > >  		#address-cells = <2>;
> > >  		#size-cells = <2>;
> 
> So I take it we still will need this one moving forward, correct?

Yes, this one actually enables the IOMMU while the other one handles the
failure to attach the IOMMU without brinding the whole drm driver down.

So it's best to actually make use of the feature!

> How about tegra30, I guess the same applies there, isn't it? Should I
> send a patch or are you guys doing that?

I don't have any tegra hardware aside of tegra124, so that's all I can
contribute to. I don't know if others have looked into the same type of
issue happening on either newer or older platforms.

Cheers,

-- 
Paul Kocialkowski,

developer of free digital technology and hardware support

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

[toc] | [prev] | [next] | [standalone]


#1685131 — Re: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124

FromMarcel Ziswiler <marcel.ziswiler@toradex.com>
Date2017-07-11 17:20 +0200
SubjectRe: [PATCH] ARM: tegra: Register host1x node with iommu binding on tegra124
Message-ID<u257h-3Yz-247@gated-at.bofh.it>
In reply to#1685114
On Tue, 2017-07-11 at 18:05 +0300, Paul Kocialkowski wrote:
> On Tue, 2017-07-11 at 14:54 +0000, Marcel Ziswiler wrote:
> > On Tue, 2017-07-11 at 11:50 +0300, Paul Kocialkowski wrote:
> > > On Sun, 2017-07-09 at 19:36 +0300, Paul Kocialkowski wrote:
> > > > This registers the host1x node with the SMMU (as HC swgroup) to
> > > > allow
> > > > the host1x code to attach to it. It avoid failing the probe
> > > > sequence,
> > > > which resulted in the tegra drm driver not probing and thus
> > > > nothing
> > > > being displayed on-screen.
> > > 
> > > Fixes: 404bfb78daf3 ("gpu: host1x: Add IOMMU support")
> > > 
> > > > Signed-off-by: Paul Kocialkowski <contact-
> > > > W9ppeneeCTY@public.gmane.org>
> > 
> > Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> > Tested-on: Apalis TK1, Jetson-TK1
> > 
> > > > ---
> > > >  arch/arm/boot/dts/tegra124.dtsi | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/arch/arm/boot/dts/tegra124.dtsi
> > > > b/arch/arm/boot/dts/tegra124.dtsi
> > > > index 187a36c6d0fc..b3b89befffeb 100644
> > > > --- a/arch/arm/boot/dts/tegra124.dtsi
> > > > +++ b/arch/arm/boot/dts/tegra124.dtsi
> > > > @@ -85,6 +85,7 @@
> > > >  		clocks = <&tegra_car TEGRA124_CLK_HOST1X>;
> > > >  		resets = <&tegra_car 28>;
> > > >  		reset-names = "host1x";
> > > > +		iommus = <&mc TEGRA_SWGROUP_HC>;
> > > >  
> > > >  		#address-cells = <2>;
> > > >  		#size-cells = <2>;
> > 
> > So I take it we still will need this one moving forward, correct?
> 
> Yes, this one actually enables the IOMMU while the other one handles
> the
> failure to attach the IOMMU without brinding the whole drm driver
> down.
> 
> So it's best to actually make use of the feature!
> 
> > How about tegra30, I guess the same applies there, isn't it? Should
> > I
> > send a patch or are you guys doing that?
> 
> I don't have any tegra hardware aside of tegra124, so that's all I
> can
> contribute to. I don't know if others have looked into the same type
> of
> issue happening on either newer or older platforms.

OK, as we happen to still selling Apalis/Colibri T30 and me having
Beaver as well as Cardhu available for testing I can cook something up,
test and send it along. First tries indicate it working on 4.12 but
somehow crashing during memory allocation on -next. We'll see.

> Cheers,

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web