Re: [PATCH v3] rust: iommu: add device lifetime to IoPageTable

From: Alice Ryhl

Date: Thu Jul 09 2026 - 11:48:00 EST


On Fri, Jul 03, 2026 at 05:28:44PM -0700, Deborah Brouwer wrote:
> Currently, using a raw IoPageTable is unsafe because the returned
> IoPageTable is not tied to the device driver binding lifetime.
>
> Since device drivers now receive a lifetime parameter <'bound>
> representing the interval during which a device driver is bound to its bus
> device, add a lifetime parameter to IoPageTable. This ensures that
> the returned IoPageTable cannot outlive the bus device binding.
>
> Also remove the option to create a page table as a device resource since
> currently Devres is not compatible with resources that have a lifetime
> parameter. This option can be restored once the lifetime-aware
> wrapper for devres is available and if a use-case appears for it.
>
> Suggested-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
> Signed-off-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>

Joerg, this patch is a dependency for this other series:
https://lore.kernel.org/rust-for-linux/20260708-fw-boot-b4-v5-0-7792ab68e359@xxxxxxxxxxxxx

Would it be okay with you if I apply this patch via drm-rust-next
together with the thing it's a dependency of?

It cleanly merges together with 'rust: iommu: replace core::mem::zeroed
with Zeroable::zeroed' that you already picked up, so taking them
through separate trees will not lead to a merge conflict.

Alice