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

Sakari Ailus
2025-06-05T09:51:39Z

Hi Hans,

On Thu, Jun 05, 2025 at 11:37:54AM +0200, Hans Verkuil wrote:
> >>>> @@ -499,3 +501,35 @@ void media_request_object_complete(struct media_request_object *obj)
> >>>>   media_request_put(req);
> >>>>  }
> >>>>  EXPORT_SYMBOL_GPL(media_request_object_complete);
> >>>> +
> >>>> +void media_request_manual_complete(struct media_request *req)
> >>>> +{
> >>>> + unsigned long flags;
> >>>
> >>> I'd declare flags as last.
> >>>
> >>>> + bool completed = false;
> >>>> +
> >>>> + if (WARN_ON(!req))
> >>>> + return;
> >>>> + if (WARN_ON(!req->manual_completion))
> >>>> + return;
> >>>
> >>> I think I'd use WARN_ON_ONCE() consistently: this is a driver (or
> >>> framework) bug and telling once about it is very probably enough.
> >>
> >> Just to be sure, you only mean for the two checks above ? Or did
> >> you mean for the entire function ?
> >
> > For the entire function. I thought that if this is user-triggerable, the
> > amount of data ending up in logs could be very large.
>
> 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.

--
Regards,

Sakari Ailus