In use cases where a camera needs to use the UVC_QUIRK_MJPEG_NO_EOF, erroneous frames that do not conform to MJPEG standards are correctly being marked as erroneous. However, when using the camera in a product, manufacturers usually want to enable the quirk in order to pass the buffers into user space. To do this, they have to enable the uvc_no_drop parameter. To avoid the extra steps to configure the kernel in such a way, enable the no_drop parameter by default to comply with this use case. Signed-off-by: Isaac Scott <isaac.scott@xxxxxxxxxxxxxxxx> --- drivers/media/usb/uvc/uvc_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 947c4bf6bfeb..45028b45906a 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -1948,6 +1948,13 @@ int uvc_register_video_device(struct uvc_device *dev, { int ret; + /* + * If the MJPEG stream occasionally loses the EOF marker, we set the + * no_drop parameter by default to avoid dropping frames erroneously. + */ + if (dev->quirks & UVC_QUIRK_MJPEG_NO_EOF) + uvc_no_drop_param = 1; + /* Initialize the video buffers queue. */ ret = uvc_queue_init(queue, type, !uvc_no_drop_param); if (ret) -- 2.43.0