Linux IOMMU Development
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: iommu@lists.linux.dev
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH] iommu: __iommu_attach_group: check for non-NULL blocking_domain
Date: Tue, 7 Oct 2025 11:38:08 +0200	[thread overview]
Message-ID: <1f920cc2-625c-48af-a6d0-a505980fbeaa@kernel.org> (raw)
In-Reply-To: <9a3ebe9b-518e-49ef-b87d-925d951a446f@kernel.org>

Hi all,

On 29/09/2025 10:23, Hans Verkuil wrote:
> Loading the omap3isp driver fails in __iommu_attach_group:
> group->blocking_domain is NULL, and so the check
> group->domain != group->blocking_domain is always true and it
> returns -EBUSY.
> 
> Only return -EBUSY if group->blocking_domain is non-NULL.
> 
> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
> Fixes: 0286300e6045 ("iommu: iommu_group_claim_dma_owner() must always assign a domain")
> ---

So just ignore this patch :-)

Today I dropped this patch from my branch, and retested on my Beagle xM and it all
worked fine.

I suspect that it might be related to the fact that I started testing with the Beagle
board (so not the xM variant), and I hit the issue there. But the Beagle board doesn't
have the connector for the camera, so later I switched to the xM variant. But I probably
never tried running it on the xM without that iommu patch until today.

In two weeks time I have access to my Beagle board again and I'll experiment a bit
to see if my theory is correct.

Apologies for all the noise.

Regards,

	Hans

> Since I am unfamiliar with the iommu core code, I am uncertain whether I am
> just papering over a bug elsewhere, or whether this is really the correct solution.
> 
> The omap3isp code in question is here:
> 
> drivers/media/platform/ti/omap3isp/isp.c, function isp_attach_iommu().
> 
> This omap3isp code predates the addition of blocking_domain and it used to work
> before that feature was added.
> 
> I've tested this patch with my Beagle XM board.
> 
> If this patch is addressing the issue in the wrong place, then advise
> on what the correct solution is would be very much appreciated!
> 
> I have a bunch of media omap3isp cleanup patches pending, but there is no point in
> posting those until this issue is resolved.
> 
> Regards,
> 
> 	Hans
> ---
>  drivers/iommu/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 060ebe330ee1..0ab1671ee850 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -2220,7 +2220,7 @@ static int __iommu_attach_group(struct iommu_domain *domain,
>  	struct device *dev;
> 
>  	if (group->domain && group->domain != group->default_domain &&
> -	    group->domain != group->blocking_domain)
> +	    group->blocking_domain && group->domain != group->blocking_domain)
>  		return -EBUSY;
> 
>  	dev = iommu_group_first_dev(group);


      parent reply	other threads:[~2025-10-07  9:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29  8:23 [PATCH] iommu: __iommu_attach_group: check for non-NULL blocking_domain Hans Verkuil
2025-09-29 12:07 ` Jason Gunthorpe
2025-09-29 12:18   ` Hans Verkuil
2025-09-29 13:02     ` Jason Gunthorpe
2025-09-29 13:30       ` Hans Verkuil
2025-09-29 13:53         ` Jason Gunthorpe
2025-09-30 10:28         ` Robin Murphy
2025-10-01  6:03         ` Sakari Ailus
2025-10-01 15:44           ` Jason Gunthorpe
2025-10-07  9:38 ` Hans Verkuil [this message]

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=1f920cc2-625c-48af-a6d0-a505980fbeaa@kernel.org \
    --to=hverkuil+cisco@kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sakari.ailus@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox