Re: [PATCH v3 1/5] media: mc: add manual request completion

Sakari Ailus
2025-06-09T09:55:52Z

Hi,

On Thu, Jun 05, 2025 at 08:41:45AM -0400, Nicolas Dufresne wrote:
> Hi Hans, Sakari,
>
> Le jeudi 05 juin 2025 à 09:48 +0000, Sakari Ailus a écrit :
> > > It's not user-triggerable, if this happens, then it is a driver bug.
> >
> > If there is a driver bug, it could well be user-triggerable, wouldn't it?
> > Testing may not uncover all such cases.
>
> You are both right, if the driver is not used, the warning will never
> trigger. I was worried of the hit of a thread safe ONCE implementation,
> but WARN_ONCE is simply not, it can warn few time before it stops if
> called from multiple CPUs at the same time. In that specific function,
> I can move all the checks inside the lock to make it truly once.
>
> Now its up to you, I don't have strong preference. These are driver errors,
> and usually quite critical. They are not bug_on simply because we have a
> crash free resolution, but its probably not functional anymore.

I'd prefer _ONCE variants, I wonder what Hans thinks.

--
Regards,

Sakari Ailus