On Wed, Feb 11, 2026 at 05:37:05PM -0800, Deborah Brouwer wrote:
> From: Beata Michalska <[email protected]>
> 
> Configure the device DMA mask during probe using the GPU's physical
> address capability reported in GpuInfo. This ensures DMA allocations
> use an appropriate address mask.
> 
> Signed-off-by: Beata Michalska <[email protected]>
> Co-developed-by: Deborah Brouwer <[email protected]>
> Signed-off-by: Deborah Brouwer <[email protected]>

Reviewed-by: Alice Ryhl <[email protected]>

> +        // SAFETY: No concurrent DMA allocations or mappings can be made 
> because
> +        // the device is still being probed and therefore isn't being used by
> +        // other threads of execution.
> +        unsafe {
> +            
> pdev.dma_set_mask_and_coherent(DmaMask::try_new(gpu_info.pa_bits())?)?;
> +        }

Nit: We usually move the semicolon outside of unsafe blocks:

unsafe { pdev.dma_set_mask_and_coherent(DmaMask::try_new(gpu_info.pa_bits())?)? 
};

Most of the time, this allows rustfmt to format the unsafe block on one
line like the above (but it depends on line length).

Reply via email to