mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Eric Auger <eric.auger@redhat.com>,
	eric.auger.pro@gmail.com, rafael@kernel.org, bhelgaas@google.com,
	jgg@ziepe.ca, lpieralisi@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, lenb@kernel.org,
	jean-philippe@linaro.org, jsnitsel@redhat.com
Subject: Re: [RFC] iommu: Fix virtio-iommu probing
Date: Thu, 14 Aug 2025 15:53:43 +0100	[thread overview]
Message-ID: <e3935099-6e29-493d-8587-64ceca8a20e9@arm.com> (raw)
In-Reply-To: <20250814141758.2140641-1-eric.auger@redhat.com>

On 14/08/2025 3:17 pm, Eric Auger wrote:
> Commit bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper
> probe path") broke virtio-iommu probing and no iommu group are
> produced anymore.
> 
> When probe_iommu_group() gets called viommu_probe_device() fails
> because viommu_get_by_fwnode(fwspec->iommu_fwnode) returns NULL.

...which it's not supposed to. And *now* I remember, we never got this 
finished, did we?

https://lore.kernel.org/linux-iommu/9beaed48da83a0882dba153e65e6cfd0a8e21482.1742484773.git.robin.murphy@arm.com/

Thanks,
Robin.

> So it seems we need to restore the original iommu_probe_device
> call site in acpi_iommu_configure_id() to get a chance to probe
> the device again.
> 
> Maybe this defeats the whole purpose of the original commit but
> at least it fixes the virtio-iommu probing.
> 
> Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path")
> Cc: stable@vger.kernel.org # v6.15+
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> 
> ---
> 
> I also tested smmu probing and this seems to work fine.
> ---
>   drivers/acpi/scan.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index fb1fe9f3b1a3..9f4efa8f75a6 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -1632,6 +1632,13 @@ static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
>   		err = viot_iommu_configure(dev);
>   	mutex_unlock(&iommu_probe_device_lock);
>   
> +	/*
> +	 * If we have reason to believe the IOMMU driver missed the initial
> +	 * iommu_probe_device() call for dev, replay it to get things in order.
> +	 */
> +	if (!err && dev->bus)
> +		err = iommu_probe_device(dev);
> +
>   	return err;
>   }
>   


  reply	other threads:[~2025-08-14 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 14:17 Eric Auger
2025-08-14 14:53 ` Robin Murphy [this message]
2025-08-14 15:19   ` Eric Auger
2025-08-14 15:28     ` Robin Murphy
2025-08-14 15:34       ` Eric Auger

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=e3935099-6e29-493d-8587-64ceca8a20e9@arm.com \
    --to=robin.murphy@arm.com \
    --cc=bhelgaas@google.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=jean-philippe@linaro.org \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=rafael@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

all inboxes | Powered by JetHome®