Subject: Re: [PATCH v3 05/11] iommu: Change group->devices to RCU-protected list

From: Nicolin Chen <[email-masked]>
Date: Thu, 23 Apr 2026 20:08:59 -0700

On Fri, Apr 24, 2026 at 10:53:49AM +0800, Baolu Lu wrote:
> On 4/17/26 07:28, Nicolin Chen wrote:
> 	    mutex_unlock(&group->mutex);
>             /*
>              * FIXME: Mis-locked because the ops->probe_finalize() call-back
>              * of some IOMMU drivers calls arm_iommu_attach_device() which
>              * in-turn might call back into IOMMU core code, where it tries
>              * to take group->mutex, resulting in a deadlock.
>              */
>              for_each_group_device(group, gdev)
>                         iommu_group_do_probe_finalize(gdev->dev);
>         }
> 
>         return 0;
> }
> 
> Will the change above trigger a lockdep splat due to this "mis-locked"
> case?"

Oh, I missed this one. That's a good finding!

Perhaps we can just change it to list_for_each_entry_rcu holding
rcu_read_lock() and drop the FIXME.

Thanks!
Nicolin