Re: [PATCH v3 0/2] iommu/virtio: Probe fixes for proper driver state

Will Deacon <[email protected]> Fri, 24 Jul 2026 13:33:52 +0100
Newsgroups dev.linux.lists.iommu
Message-ID <amNbsGS9MNCENBBk@willie-the-truck>
On Fri, Jul 24, 2026 at 10:33:33AM +0800, Xiong Weimin wrote:
> From: Xiong Weimin <[email protected]>
> Subject: [PATCH v3 0/2] iommu/virtio: Probe fixes for proper driver state
> To: [email protected]
> Cc: [email protected], [email protected], [email protected]
> In-Reply-To: <[email protected]>
> References: <[email protected]>
> 
> This is v3 of the patch series. v2 is now obsolete.
> 
> Changes since v2:
> - Rebased onto latest upstream
> - Patch 3 ("Reject short event buffers") has been dropped as it was
>   independently submitted by Xu Rao
> - As suggested by Will Deacon, modified viommu_init_vqs() to take vdev
>   instead of viommu, since they are now linked via vdev->priv

Two more things here:

1. Please don't send patches as attachments. Go and read
   Documentation/process/submitting-patches.rst to understand how this
   it supposed to work.

2. You shouldn't add random Reviewed-by tags if they haven't been
   explicitly provided by the individual. For example:

> From fda59717330fd907f1cd3fdbba7e0b0888b54524 Mon Sep 17 00:00:00 2001
> From: xiongweimin <[email protected]>
> Date: Thu, 23 Jul 2026 11:18:50 +0800
> Subject: [PATCH v3 1/2] iommu/virtio: Set driver data before enabling
>  virtqueues
> To: [email protected]
> Cc: [email protected],
>     [email protected],
>     [email protected]
> 
> The event virtqueue callback retrieves the driver state through
> vq->vdev->priv. viommu_probe() currently initializes that pointer only
> after virtio_device_ready() and after the event queue is populated.
> 
> Store the driver data before creating the virtqueues so callbacks always
> see initialized driver state once the device is made ready. Clear the
> pointer again on probe failure.
> 
> As suggested by Will Deacon, pass vdev instead of viommu to
> viommu_init_vqs(), since we already linked them together.
> 
> Suggested-by: Will Deacon <[email protected]>
> Signed-off-by: Xiong Weimin <[email protected]>
> Reviewed-by: Will Deacon <[email protected]>

I did not provide this tag ^^^.

> From 3f94f2266bc35c31234b19c1e9acb847ff7e445c Mon Sep 17 00:00:00 2001
> From: xiongweimin <[email protected]>
> Date: Thu, 23 Jul 2026 11:19:07 +0800
> Subject: [PATCH v3 2/2] iommu/virtio: Handle iommu_device_register() failures
> To: [email protected]
> Cc: [email protected],
>     [email protected],
>     [email protected]
> 
> Check the return value of iommu_device_register() and properly clean up
> sysfs entries on failure. This ensures that the device sysfs directory
> is removed if registration fails.
> 
> Reviewed-by: Will Deacon <[email protected]>

^^^ or this one.

Will