Re: [PATCH 5/9] drm/panfrost: Handle page mapping failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Oct 2024 00:31:40 +0100
Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx> wrote:

> -			ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot,
> +			ret = ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot,
>  				       GFP_KERNEL, &mapped);
> +			if (ret) {
> +				/* Unmap everything we mapped and bail out */
> +				mmu_unmap_range(mapped, start_iova, is_heap, ops);
> +				return ret;
> +			}

I'm pretty sure you don't need to know whether this is a heap BO or not
in that path. All you need to do is unmap what you've already mapped,
which gives you some guarantees:

- the pages you unmap must be present (no need to iova_to_phys())
- unmapping one 2M page at a time is not needed, because you know where
  the mapped region starts/ends, so you don't need this
  "is-this-the-end-of-the-heap-buffer" check that forces us to scan 2M
  at a time




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux