Re: [PATCH] media: uvcvideo: Fail probe when no video device is registered
From: Chen Changcheng
Date: Thu Nov 05 2026 - 21:27:24 EST
Hi Laurent Pinchart,
The main reason is still that the userspace app uses a hotkey to call the unbind and bind nodes.
When the key is pressed continuously and very rapidly for a period of time,
the previously described problem occurs. Previously I made the following patch:
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index e289cc71ba98..c08bad211408 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1973,7 +1973,6 @@ static void uvc_delete(struct kref *kref)
struct uvc_streaming *streaming;
streaming = list_entry(p, struct uvc_streaming, list);
- usb_driver_release_interface(&uvc_driver, streaming->intf);
uvc_stream_delete(streaming);
}
@@ -2021,6 +2020,9 @@ static void uvc_unregister_video(struct uvc_device *dev)
if (media_devnode_is_registered(dev->mdev.devnode))
media_device_unregister(&dev->mdev);
#endif
+
+ list_for_each_entry(stream, &dev->streams, list)
+ usb_driver_release_interface(&uvc_driver, stream->intf);
}
int uvc_register_video_device(struct uvc_device *dev,
However, the testers found that the preview screen went black,
so I considered whether there were other feasible solutions.
Later it turned out to be caused by the app itself.
After fixing the app, I tested it myself yesterday,
and the above modification works normally.
But I found a similar piece of code/patch in the community at the following link:
https://lore.kernel.org/all/20261022-uvc-release-intfs-v2-1-901bc1c47cfb@xxxxxxxxx/
Thank you for your review. Sorry for wasting your time.
--
Regards
Chen Changcheng