[PATCH 1/2] media: cedrus: fail buffer allocations that do not fit with -ENOMEM

Jernej Škrabec jernej.skrabec at gmail.com
Thu Nov 26 09:21:32 PST 2026


Dne četrtek, 19. november 2026 ob 17:34:47 Srednjeevropski standardni čas je Arun Iyengar via B4 Relay napisal(a):
> From: Arun Iyengar <aiyengar1990 at gmail.com>
> 
> vb2-dma-contig allocates with GFP_KERNEL, so a buffer pool that does
> not fit in memory invokes the OOM killer. Set __GFP_RETRY_MAYFAIL on
> both queues: the request returns fewer buffers or -ENOMEM instead.

This is correct only for IOMMU allocation. CMA fails directly.

Please update commit message.

Best regards,
Jernej

> 
> Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
> ---
>  drivers/staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> index ad4ec3490775..9b2d24e77fdb 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> @@ -602,6 +602,7 @@ int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
>  	src_vq->dev = ctx->dev->dev;
>  	src_vq->supports_requests = true;
>  	src_vq->requires_requests = true;
> +	src_vq->gfp_flags = __GFP_RETRY_MAYFAIL;
>  
>  	ret = vb2_queue_init(src_vq);
>  	if (ret)
> @@ -616,6 +617,7 @@ int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
>  	dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
>  	dst_vq->lock = &ctx->dev->dev_mutex;
>  	dst_vq->dev = ctx->dev->dev;
> +	dst_vq->gfp_flags = __GFP_RETRY_MAYFAIL;
>  
>  	return vb2_queue_init(dst_vq);
>  }
> 
> 







More information about the linux-arm-kernel mailing list