On Wed, 11 Feb 2026 17:37:09 -0800
Deborah Brouwer <[email protected]> wrote:
> +
> +impl Mmu {
> + pub(crate) fn new(
> + pdev: &platform::Device,
> + iomem: ArcBorrow<'_, Devres<IoMem>>,
> + gpu_info: &GpuInfo,
> + ) -> Result<Arc<Mmu>> {
Maybe the Mmu should be wrapped in a Devres, like we do with other HW
components that require the underlying device to be bound to access
registers. I mean, we do have iomem wrapper into a Devres, so maybe
that's not needed, dunno.
> + let slot_count = gpu_info.as_present.count_ones().try_into()?;
> + let as_manager = AddressSpaceManager::new(pdev, iomem,
> gpu_info.as_present)?;
> + let mmu_init = try_pin_init!(Self{
> + as_manager <- new_mutex!(SlotManager::new(as_manager,
> slot_count)?),
> + });
> + Arc::pin_init(mmu_init, GFP_KERNEL)
> + }