On 28/08/2025 21:01, Chia-I Wu wrote:
> Fail early from panthor_vm_bind_prepare_op_ctx instead of late from
> ops->map_pages.
> 
> Signed-off-by: Chia-I Wu <olva...@gmail.com>
> Reviewed-by: Boris Brezillon <boris.brezil...@collabora.com>

Reviewed-by: Steven Price <steven.pr...@arm.com>

I'll push this to drm-misc-next.

Thanks,
Steve

> ---
>  drivers/gpu/drm/panthor/panthor_mmu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c 
> b/drivers/gpu/drm/panthor/panthor_mmu.c
> index bad720f23eb70..6dec4354e3789 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.c
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.c
> @@ -1222,7 +1222,7 @@ static int panthor_vm_prepare_map_op_ctx(struct 
> panthor_vm_op_ctx *op_ctx,
>           (flags & DRM_PANTHOR_VM_BIND_OP_TYPE_MASK) != 
> DRM_PANTHOR_VM_BIND_OP_TYPE_MAP)
>               return -EINVAL;
>  
> -     /* Make sure the VA and size are aligned and in-bounds. */
> +     /* Make sure the VA and size are in-bounds. */
>       if (size > bo->base.base.size || offset > bo->base.base.size - size)
>               return -EINVAL;
>  
> @@ -2447,7 +2447,7 @@ panthor_vm_bind_prepare_op_ctx(struct drm_file *file,
>       int ret;
>  
>       /* Aligned on page size. */
> -     if (!IS_ALIGNED(op->va | op->size, vm_pgsz))
> +     if (!IS_ALIGNED(op->va | op->size | op->bo_offset, vm_pgsz))
>               return -EINVAL;
>  
>       switch (op->flags & DRM_PANTHOR_VM_BIND_OP_TYPE_MASK) {

Reply via email to