linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: kusmabite-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Mikko Perttunen <cyndis-/1wQRMveznE@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	DRI Development
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Nicolas Chauvet <kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v2 09/22] drm/tegra: Don't use IOMMU on Tegra20
Date: Wed, 14 Jun 2017 13:22:46 +0300	[thread overview]
Message-ID: <16be88ba-808d-4d3e-533b-7dce4a2765e7@gmail.com> (raw)
In-Reply-To: <CABPQNSbMQMrahcvWnczywLDYVU0=Ns=FB6Yseisk-5L_8Y=rpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 14.06.2017 10:39, Erik Faye-Lund wrote:
> On Wed, Jun 14, 2017 at 1:15 AM, Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> There is no IOMMU on Tegra20, instead a GART would be picked as an IOMMU
>> provider.
>>
>> Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> Acked-by: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>
>> ---
>>  drivers/gpu/drm/tegra/drm.c | 3 ++-
>>  drivers/gpu/host1x/dev.c    | 3 ++-
>>  2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
>> index e999391aedc9..aa7988dcc28f 100644
>> --- a/drivers/gpu/drm/tegra/drm.c
>> +++ b/drivers/gpu/drm/tegra/drm.c
>> @@ -131,7 +131,8 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
>>         if (!tegra)
>>                 return -ENOMEM;
>>
>> -       if (iommu_present(&platform_bus_type)) {
>> +       if (iommu_present(&platform_bus_type) &&
>> +           !of_machine_is_compatible("nvidia,tegra20")) {
>>                 u64 carveout_start, carveout_end, gem_start, gem_end;
>>                 struct iommu_domain_geometry *geometry;
>>                 unsigned long order;
>> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
>> index f05ebb14fa63..6a805ed908c3 100644
>> --- a/drivers/gpu/host1x/dev.c
>> +++ b/drivers/gpu/host1x/dev.c
>> @@ -177,7 +177,8 @@ static int host1x_probe(struct platform_device *pdev)
>>                 return err;
>>         }
>>
>> -       if (iommu_present(&platform_bus_type)) {
>> +       if (iommu_present(&platform_bus_type) &&
>> +           !of_machine_is_compatible("nvidia,tegra20")) {
>>                 struct iommu_domain_geometry *geometry;
>>                 unsigned long order;
>>
> 
> This doesn't feel great... The commit message says there's no IOMMU,
> but iommu_present says otherwise. I know there's some more subtleties
> here, and the commit message does hint at this. But...
> 
> If we don't want to treat the GART as an IOMMU, shouldn't we somehow
> make sure iommu_present() doesn't return true in these cases (or
> perhaps make something like tegra_use_iommu(), with a comment
> explaining why we don't want to allow the GART to be treated like a
> proper IOMMU)? These seems to be the only Tegra-specific calls to
> iommu_present()...
> 
> That being said, the patch seems to have the right effect...
> 

We don't want to treat the GART as an IOMMU right now, but I'd want to change
that in the (near?) future, so it's a kinda trivial preparation patch that
restores the GART driver and these of_machine_is_compatible() are supposed to go
away later. Probably I should mention this in the commit message(?).

I think we can add a Tegra20 specific IOCTL for an allocation of GART-able
memory and use it for a stuff like opentegra's EXA, its fallback allocations
migration is a pita and reserved CMA is never enough =)

-- 
Dmitry

  parent reply	other threads:[~2017-06-14 10:22 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 23:15 [PATCH v2 00/22] Tegra DRM fixes Dmitry Osipenko
     [not found] ` <cover.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-13 23:15   ` [PATCH v2 01/22] drm/tegra: Fix lockup on a use of staging API Dmitry Osipenko
     [not found]     ` <d2616b82a1728d0953e84489cde40364999719f0.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  7:09       ` Erik Faye-Lund
2017-06-13 23:15   ` [PATCH v2 02/22] drm/tegra: Correct idr_alloc() minimum id Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 03/22] drm/tegra: Check for malformed offsets and sizes in the 'submit' IOCTL Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 04/22] drm/tegra: Correct copying of waitchecks and disable them " Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 05/22] drm/tegra: Check syncpoint ID " Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 06/22] drm/tegra: dc: Avoid reset asserts on Tegra20 Dmitry Osipenko
     [not found]     ` <1c7b0c7bf713401073d648f9f228fa152c094a5a.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  7:13       ` Erik Faye-Lund
2017-06-13 23:15   ` [PATCH v2 07/22] drm/tegra: dc: Apply clipping to the plane Dmitry Osipenko
     [not found]     ` <7adbe0c6e67115fa4fd201026533b7cb97fc44d2.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  7:20       ` Erik Faye-Lund
2017-06-13 23:15   ` [PATCH v2 08/22] drm/tegra: dc: Disable plane if it is invisible Dmitry Osipenko
2017-06-14  7:21     ` Erik Faye-Lund
2017-06-13 23:15   ` [PATCH v2 09/22] drm/tegra: Don't use IOMMU on Tegra20 Dmitry Osipenko
     [not found]     ` <d707bd34e268f9d8fb29bf510a9f17e5f943a635.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  7:39       ` Erik Faye-Lund
     [not found]         ` <CABPQNSbMQMrahcvWnczywLDYVU0=Ns=FB6Yseisk-5L_8Y=rpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-14 10:22           ` Dmitry Osipenko [this message]
     [not found]             ` <16be88ba-808d-4d3e-533b-7dce4a2765e7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14 22:24               ` Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 10/22] Revert "iommu/tegra: gart: Do not register with bus" Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 11/22] gpu: host1x: Initialize firewall class to the jobs one Dmitry Osipenko
     [not found]     ` <8c0a2417584ce51b716f2c286027bcb18fceda56.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  7:41       ` Erik Faye-Lund
2017-06-13 23:15   ` [PATCH v2 12/22] gpu: host1x: Correct host1x_job_pin() error handling Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 13/22] gpu: host1x: Do not leak BO's phys address to userspace Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 14/22] gpu: host1x: Forbid relocation address shifting in the firewall Dmitry Osipenko
     [not found]     ` <5e6f06d3e57db40c1c4947282ef7336369c3360f.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  6:50       ` Mikko Perttunen
     [not found]         ` <6db57dae-0de7-45a5-2ed5-1ebd84577742-/1wQRMveznE@public.gmane.org>
2017-06-14  9:06           ` Dmitry Osipenko
     [not found]             ` <3d723511-45f2-3c80-58fe-c9050624ac94-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14 11:47               ` Mikko Perttunen
     [not found]                 ` <bc4d8ea3-0fd7-85ad-be08-bc869d0e89a6-/1wQRMveznE@public.gmane.org>
2017-06-14 14:49                   ` Dmitry Osipenko
     [not found]                     ` <a18ec3c6-0fa1-4daa-3db4-c81124424cec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14 14:59                       ` Mikko Perttunen
2017-06-13 23:15   ` [PATCH v2 15/22] gpu: host1x: Forbid RESTART opcode " Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 16/22] gpu: host1x: Forbid unrelated SETCLASS " Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 17/22] gpu: host1x: Correct swapped arguments in the is_addr_reg() definition Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 18/22] gpu: host1x: Check waits in the firewall Dmitry Osipenko
     [not found]     ` <bd57829e74c6554c46ab761d013e6d9d3c39b693.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  7:47       ` Erik Faye-Lund
2017-06-13 23:15   ` [PATCH v2 19/22] gpu: host1x: Remove unused 'struct host1x_cmdbuf' Dmitry Osipenko
2017-06-13 23:15   ` [PATCH v2 20/22] gpu: host1x: Remove unused host1x_cdma_stop() definition Dmitry Osipenko
2017-06-13 23:16   ` [PATCH v2 21/22] gpu: host1x: Refactor channel allocation code Dmitry Osipenko
2017-06-13 23:16   ` [PATCH v2 22/22] gpu: host1x: At first try a non-blocking allocation for the gather copy Dmitry Osipenko
     [not found]     ` <036615566011ab4d52190439a12d943df9e704ef.1497394243.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14  7:56       ` Erik Faye-Lund
     [not found]         ` <CABPQNSZ8f8QqW4fJYCGfgf3q0pTyQ7NbS_=64x39kvrNDSyhdw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-14  8:32           ` Dmitry Osipenko
2017-06-14  8:44             ` Erik Faye-Lund

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=16be88ba-808d-4d3e-533b-7dce4a2765e7@gmail.com \
    --to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=cyndis-/1wQRMveznE@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=kusmabite-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@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).