All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Robin Murphy <robin.murphy@arm.com>, thierry.reding@gmail.com
Cc: jonathanh@nvidia.com, dri-devel@lists.freedesktop.org,
	linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org
Subject: Re: [PATCH v2] drm/tegra: Stop using iommu_present()
Date: Wed, 11 May 2022 14:08:59 +0300	[thread overview]
Message-ID: <a0c7e954-ee3f-74fd-cfea-9b6dbce924dc@collabora.com> (raw)
In-Reply-To: <63c021c4-57de-38fe-e48f-a308088d235b@arm.com>

On 5/4/22 14:52, Robin Murphy wrote:
> On 2022-05-04 01:52, Dmitry Osipenko wrote:
>> On 4/11/22 16:46, Robin Murphy wrote:
>>> @@ -1092,6 +1092,19 @@ static bool host1x_drm_wants_iommu(struct
>>> host1x_device *dev)
>>>       struct host1x *host1x = dev_get_drvdata(dev->dev.parent);
>>>       struct iommu_domain *domain;
>>>   +    /* For starters, this is moot if no IOMMU is available */
>>> +    if (!device_iommu_mapped(&dev->dev))
>>> +        return false;
>>
>> Unfortunately this returns false on T30 with enabled IOMMU because we
>> don't use IOMMU for Host1x on T30 [1] to optimize performance. We can't
>> change it until we will update drivers to support Host1x-dedicated
>> buffers.
> 
> Huh, so is dev->dev here not the DRM device? If it is, and
> device_iommu_mapped() returns false, then the later iommu_attach_group()
> call is going to fail anyway, so there's not much point allocating a
> domain. If it's not, then what the heck is host1x_drm_wants_iommu()
> actually testing for?

The dev->dev is the host1x device and it's the DRM device.

The iommu_attach_group() is called for the DRM sub-devices (clients in
the Tegra driver), which are the devices sitting on the host1x bus.

There is no single GPU device on Tegra, instead it's composed of
independent GPU engines and display controllers that are connected to
the host1x bus.

Host1x also has channel DMA engines that are used by DRM driver. We
don't have dedicated devices for the host1x DMA, there is single host1x
driver that manages host1x bus and DMA.

-- 
Best regards,
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Robin Murphy <robin.murphy@arm.com>, thierry.reding@gmail.com
Cc: linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org,
	dri-devel@lists.freedesktop.org, jonathanh@nvidia.com
Subject: Re: [PATCH v2] drm/tegra: Stop using iommu_present()
Date: Wed, 11 May 2022 14:08:59 +0300	[thread overview]
Message-ID: <a0c7e954-ee3f-74fd-cfea-9b6dbce924dc@collabora.com> (raw)
In-Reply-To: <63c021c4-57de-38fe-e48f-a308088d235b@arm.com>

On 5/4/22 14:52, Robin Murphy wrote:
> On 2022-05-04 01:52, Dmitry Osipenko wrote:
>> On 4/11/22 16:46, Robin Murphy wrote:
>>> @@ -1092,6 +1092,19 @@ static bool host1x_drm_wants_iommu(struct
>>> host1x_device *dev)
>>>       struct host1x *host1x = dev_get_drvdata(dev->dev.parent);
>>>       struct iommu_domain *domain;
>>>   +    /* For starters, this is moot if no IOMMU is available */
>>> +    if (!device_iommu_mapped(&dev->dev))
>>> +        return false;
>>
>> Unfortunately this returns false on T30 with enabled IOMMU because we
>> don't use IOMMU for Host1x on T30 [1] to optimize performance. We can't
>> change it until we will update drivers to support Host1x-dedicated
>> buffers.
> 
> Huh, so is dev->dev here not the DRM device? If it is, and
> device_iommu_mapped() returns false, then the later iommu_attach_group()
> call is going to fail anyway, so there's not much point allocating a
> domain. If it's not, then what the heck is host1x_drm_wants_iommu()
> actually testing for?

The dev->dev is the host1x device and it's the DRM device.

The iommu_attach_group() is called for the DRM sub-devices (clients in
the Tegra driver), which are the devices sitting on the host1x bus.

There is no single GPU device on Tegra, instead it's composed of
independent GPU engines and display controllers that are connected to
the host1x bus.

Host1x also has channel DMA engines that are used by DRM driver. We
don't have dedicated devices for the host1x DMA, there is single host1x
driver that manages host1x bus and DMA.

-- 
Best regards,
Dmitry
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Robin Murphy <robin.murphy@arm.com>, thierry.reding@gmail.com
Cc: linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org,
	dri-devel@lists.freedesktop.org, jonathanh@nvidia.com
Subject: Re: [PATCH v2] drm/tegra: Stop using iommu_present()
Date: Wed, 11 May 2022 14:08:59 +0300	[thread overview]
Message-ID: <a0c7e954-ee3f-74fd-cfea-9b6dbce924dc@collabora.com> (raw)
In-Reply-To: <63c021c4-57de-38fe-e48f-a308088d235b@arm.com>

On 5/4/22 14:52, Robin Murphy wrote:
> On 2022-05-04 01:52, Dmitry Osipenko wrote:
>> On 4/11/22 16:46, Robin Murphy wrote:
>>> @@ -1092,6 +1092,19 @@ static bool host1x_drm_wants_iommu(struct
>>> host1x_device *dev)
>>>       struct host1x *host1x = dev_get_drvdata(dev->dev.parent);
>>>       struct iommu_domain *domain;
>>>   +    /* For starters, this is moot if no IOMMU is available */
>>> +    if (!device_iommu_mapped(&dev->dev))
>>> +        return false;
>>
>> Unfortunately this returns false on T30 with enabled IOMMU because we
>> don't use IOMMU for Host1x on T30 [1] to optimize performance. We can't
>> change it until we will update drivers to support Host1x-dedicated
>> buffers.
> 
> Huh, so is dev->dev here not the DRM device? If it is, and
> device_iommu_mapped() returns false, then the later iommu_attach_group()
> call is going to fail anyway, so there's not much point allocating a
> domain. If it's not, then what the heck is host1x_drm_wants_iommu()
> actually testing for?

The dev->dev is the host1x device and it's the DRM device.

The iommu_attach_group() is called for the DRM sub-devices (clients in
the Tegra driver), which are the devices sitting on the host1x bus.

There is no single GPU device on Tegra, instead it's composed of
independent GPU engines and display controllers that are connected to
the host1x bus.

Host1x also has channel DMA engines that are used by DRM driver. We
don't have dedicated devices for the host1x DMA, there is single host1x
driver that manages host1x bus and DMA.

-- 
Best regards,
Dmitry

  reply	other threads:[~2022-05-11 11:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 13:46 [PATCH v2] drm/tegra: Stop using iommu_present() Robin Murphy
2022-04-11 13:46 ` Robin Murphy
2022-04-11 13:46 ` Robin Murphy
2022-04-13 22:34 ` Dmitry Osipenko
2022-04-13 22:34   ` Dmitry Osipenko
2022-04-13 22:34   ` Dmitry Osipenko
2022-05-04  0:52 ` Dmitry Osipenko
2022-05-04  0:52   ` Dmitry Osipenko
2022-05-04  0:52   ` Dmitry Osipenko
2022-05-04 11:52   ` Robin Murphy
2022-05-04 11:52     ` Robin Murphy
2022-05-04 11:52     ` Robin Murphy
2022-05-11 11:08     ` Dmitry Osipenko [this message]
2022-05-11 11:08       ` Dmitry Osipenko
2022-05-11 11:08       ` Dmitry Osipenko

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=a0c7e954-ee3f-74fd-cfea-9b6dbce924dc@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=thierry.reding@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.