From: Chen Changcheng <chenchangcheng@kylinos.cn>
To: laurent.pinchart@ideasonboard.com
Cc: chenchangcheng@kylinos.cn, hansg@kernel.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
mchehab@kernel.org
Subject: Re: [PATCH] media: uvcvideo: Fail probe when no video device is registered
Date: Fri, 6 Nov 2026 10:26:24 +0800 [thread overview]
Message-ID: <20261106022624.42438-1-chenchangcheng@kylinos.cn> (raw)
In-Reply-To: <20261104074103.GA3896730@killaraus.ideasonboard.com>
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@blueye.no/
Thank you for your review. Sorry for wasting your time.
--
Regards
Chen Changcheng
prev parent reply other threads:[~2026-11-06 2:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 2:21 Chen Changcheng
2026-11-04 6:04 ` Laurent Pinchart
2026-11-04 7:21 ` Chen Changcheng
2026-11-04 7:41 ` Laurent Pinchart
2026-11-06 2:26 ` Chen Changcheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261106022624.42438-1-chenchangcheng@kylinos.cn \
--to=chenchangcheng@kylinos.cn \
--cc=hansg@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®