Re: [PATCH 2/4] rust: dma: tie CoherentHandle to the device's bound lifetime

From: Gary Guo

Date: Thu Sep 03 2026 - 09:43:23 EST


On Sun Aug 30, 2026 at 8:37 PM BST, Danilo Krummrich wrote:
> Add a lifetime parameter to CoherentHandle that ties the DMA allocation
> to the device's bound scope, ensuring it is freed before the device is
> unbound.
>
> DMA allocations carry device resources (e.g. IOMMU mappings) that must
> not outlive the device's bound lifetime. Without a lifetime parameter,
> there was no compile-time enforcement that a CoherentHandle is dropped
> before the device is unbound.
>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> drivers/gpu/nova-core/fb.rs | 2 +-
> rust/kernel/dma.rs | 20 ++++++++++----------
> 2 files changed, 11 insertions(+), 11 deletions(-)