Re: [PATCH 1/2] media: rcar-isp: Account for the header in the ConfigDMA bounds check

From: Hyeonjun Hong

Date: Wed Dec 02 2026 - 11:39:03 EST


Hi Niklas,

Thanks for the review.

On 2026-12-02 17:26:45 +0100, Niklas Söderlund wrote:
> Nice catch, but could you move the magic values to defines, maybe
> something like,
>
> #define RISP_IO_PARAMS_HEADER_SIZE 8
> #define RISP_IO_PARAMS_MAX_PAIRS ((RISP_IO_PARAMS_BUF_SIZE - RISP_IO_PARAMS_HEADER_SIZE) / 8)
>
> And use them here?

Will do in v2. The check then becomes

if (desc->count >= RISP_IO_PARAMS_MAX_PAIRS)
return -ENOMEM;

and I will also update the comment above RISP_IO_PARAMS_BUF_SIZE, which
says 2048 pairs.

One related question, also in the cover letter: risp_core_job_prepare()
in core.c rejects the buffer if

pairs > (RISP_IO_PARAMS_BUF_SIZE - 8) / 16

which is 1023, i.e. it counts 16 bytes per pair. Should that become
RISP_IO_PARAMS_MAX_PAIRS as well? If so I can add a patch for it to v2.

Thanks,
Hyeonjun