Re: [PATCH 2/2] media: rcar-isp: Fail buffer preparation if the ConfigDMA buffer is full

From: Hyeonjun Hong

Date: Wed Dec 02 2026 - 11:43:53 EST


Hi Niklas,

On 2026-12-02 17:31:00 +0100, Niklas Söderlund wrote:
> ... This check while also setting the new overflow flag will return
> -ENOMEM ...
[...]
> ... Which will be propagated and returned here ...

I do not think it is propagated. The block handlers ignore the return
value of the write callback and return 0, e.g. rppx1_ccor_fill_params():

write(priv, mod->base + CCOR_COEFF_REG(0), 0x1000);
[...]
return 0;

None of the write() calls in the rppx1_*.c handlers is checked, so
rppx1_params() returns 0 after the buffer is full. In the userspace
model, with only patch 1/2 applied, 700 header-only CCOR_POST blocks
give 2047 pairs written and rppx1_params() == 0.

> I don't like adding a flag for this, and it's not needed...

Understood. Would you prefer one of these instead?

a) No flag, keep counting in the callback and check the count
afterwards:

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

and in risp_io_params_buffer_prepare():

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

b) Make the rppx1 block handlers check and return the result of
write(). That is the proper fix but touches about 170 call sites
in rppx1.

c) Drop patch 2/2 and leave it as is.

Thanks,
Hyeonjun