Re: [PATCH] iommu: __iommu_attach_group: check for non-NULL blocking_domain

From: Hans Verkuil

Date: Mon Sep 29 2025 - 08:18:54 EST


On 29/09/2025 14:07, Jason Gunthorpe wrote:
> On Mon, Sep 29, 2025 at 10:23:47AM +0200, Hans Verkuil wrote:
>
>> 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.
>
> It is papering over something, group->domain is not supposed to be
> NULL at this point.. That probably means the iommu driver has not been

It's group->blocking_domain that's NULL, not group->domain.

Regards,

Hans

> fully setup yet.
>
> This is ARM32? It should have gone down this path:
>
> static int iommu_get_default_domain_type(struct iommu_group *group,
> int target_type)
> {
> if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) {
> static_assert(!(IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) &&
> IS_ENABLED(CONFIG_IOMMU_DMA)));
> driver_type = IOMMU_DOMAIN_IDENTITY;
>
> And I thought there shouldn't be a way to get here:
>
>> drivers/media/platform/ti/omap3isp/isp.c, function isp_attach_iommu().
>
> With a NULL group->domain?
>
> Maybe it didn't call iommu_setup_default_domain() in the right
> sequence for some reason?
>
> Can you inspect around this?
>
> Jason