linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Jon Hunter <jonathanh@nvidia.com>,
	Robin Murphy <robin.murphy@arm.com>,
	joro@8bytes.org, Thierry Reding <treding@nvidia.com>
Cc: will@kernel.org, iommu@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org, baolu.lu@linux.intel.com,
	kevin.tian@intel.com, suravee.suthikulpanit@amd.com,
	vasant.hegde@amd.com, mjrosato@linux.ibm.com,
	schnelle@linux.ibm.com, linux-kernel@vger.kernel.org,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v4 05/16] iommu: Move bus setup to IOMMU device registration
Date: Wed, 19 Oct 2022 00:12:58 +0300	[thread overview]
Message-ID: <712c9e51-f589-b566-6194-259393180e43@gmail.com> (raw)
In-Reply-To: <41293685-54aa-6fa3-ca41-189fdbb7e8b0@nvidia.com>

18.10.2022 09:13, Jon Hunter пишет:
> 
> On 06/10/2022 16:27, Robin Murphy wrote:
>> On 2022-10-06 15:01, Jon Hunter wrote:
>>> Hi Robin,
>>>
>>> On 15/08/2022 17:20, Robin Murphy wrote:
>>>> Move the bus setup to iommu_device_register(). This should allow
>>>> bus_iommu_probe() to be correctly replayed for multiple IOMMU
>>>> instances,
>>>> and leaves bus_set_iommu() as a glorified no-op to be cleaned up next.
>>>>
>>>> At this point we can also handle cleanup better than just rolling back
>>>> the most-recently-touched bus upon failure - which may release devices
>>>> owned by other already-registered instances, and still leave devices on
>>>> other buses with dangling pointers to the failed instance. Now it's
>>>> easy
>>>> to clean up the exact footprint of a given instance, no more, no less.
>>>
>>>
>>> Since this change, I have noticed that the DRM driver on Tegra20 is
>>> failing to probe and I am seeing ...
>>>
>>>   tegra-gr2d 54140000.gr2d: failed to attach to domain: -19
>>>   drm drm: failed to initialize 54140000.gr2d: -19
>>>
>>> Bisect points to this change and reverting it fixes it. Let me know
>>> if you have any thoughts.
>>
>> Oh, apparently what's happened is that I've inadvertently enabled the
>> tegra-gart driver, since it seems that *wasn't* calling
>> bus_set_iommu() before. Looking at the history, it appears to have
>> been that way since c7e3ca515e78 ("iommu/tegra: gart: Do not register
>> with bus"), so essentially that driver has been broken and useless for
>> close to 8 years now :(
>>
>> Given that, I'd be inclined to "fix" it as below, or just give up and
>> delete the whole thing.
>>
>> Thanks,
>> Robin.
>>
>> ----->8-----
>> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
>> index 5c5cb5bee8b6..7b3f7fd6e527 100644
>> --- a/drivers/iommu/Kconfig
>> +++ b/drivers/iommu/Kconfig
>> @@ -230,6 +230,7 @@ config TEGRA_IOMMU_GART
>>       bool "Tegra GART IOMMU Support"
>>       depends on ARCH_TEGRA_2x_SOC
>>       depends on TEGRA_MC
>> +    depends on BROKEN
>>       select IOMMU_API
>>       help
>>         Enables support for remapping discontiguous physical memory
> 
> 
> Thanks Robin. This works for me.
> 
> Thierry, Dmitry, we need a fix for v6.1 and so OK with the above?

To me it is more a problem of the DRM driver that it doesn't support
GART. GART will require a special handling from the DRM driver anyways [1].

[1]
https://github.com/grate-driver/linux/blob/master/drivers/gpu/drm/grate/drm.c#L460

The GART driver itself isn't broken, it's working perfectly fine. It's
the DRM driver that should start caring about the GART presence, IMO.

  reply	other threads:[~2022-10-18 21:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 16:20 [PATCH v4 00/16] iommu: retire bus_set_iommu() Robin Murphy
2022-08-15 16:20 ` [PATCH v4 01/16] iommu/vt-d: Handle race between registration and device probe Robin Murphy
2022-08-15 16:20 ` [PATCH v4 02/16] iommu/amd: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 03/16] iommu/s390: Fail probe for non-PCI devices Robin Murphy
2022-08-15 16:20 ` [PATCH v4 04/16] iommu: Always register bus notifiers Robin Murphy
2022-08-18  7:34   ` Tian, Kevin
2022-09-07 18:50   ` Saravana Kannan
2022-09-07 20:27     ` Robin Murphy
2022-08-15 16:20 ` [PATCH v4 05/16] iommu: Move bus setup to IOMMU device registration Robin Murphy
2022-10-06 14:01   ` Jon Hunter
2022-10-06 15:27     ` Robin Murphy
2022-10-06 17:12       ` Thierry Reding
2022-10-06 18:43         ` Dmitry Osipenko
2022-10-18  6:13       ` Jon Hunter
2022-10-18 21:12         ` Dmitry Osipenko [this message]
2022-10-12 16:28   ` Alex Williamson
2022-10-13  1:08     ` Baolu Lu
2022-08-15 16:20 ` [PATCH v4 06/16] iommu/amd: Clean up bus_set_iommu() Robin Murphy
2022-08-15 16:20 ` [PATCH v4 07/16] iommu/arm-smmu: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 08/16] iommu/arm-smmu-v3: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 09/16] iommu/dart: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 10/16] iommu/exynos: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 11/16] iommu/ipmmu-vmsa: " Robin Murphy
2022-08-16  0:25   ` kernel test robot
2022-08-15 16:20 ` [PATCH v4 12/16] iommu/mtk: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 13/16] iommu/omap: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 14/16] iommu/tegra-smmu: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 15/16] iommu/virtio: " Robin Murphy
2022-08-15 16:20 ` [PATCH v4 16/16] iommu: " Robin Murphy
2022-09-07 12:27 ` [PATCH v4 00/16] iommu: retire bus_set_iommu() Joerg Roedel

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=712c9e51-f589-b566-6194-259393180e43@gmail.com \
    --to=digetx@gmail.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=robin.murphy@arm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=treding@nvidia.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.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).