lesavka/scripts/kernel/uvc-debug.patch

48 lines
1.4 KiB
Diff
Raw Normal View History

2026-01-22 15:23:25 -03:00
--- a/drivers/usb/gadget/function/uvc_video.c
+++ b/drivers/usb/gadget/function/uvc_video.c
2026-01-22 15:30:42 -03:00
@@ -763,12 +763,44 @@
2026-01-22 15:23:25 -03:00
{
int ret;
+ if (!video) {
+ pr_err("uvcg_video_enable: missing video\n");
+ return -EINVAL;
+ }
+
+ if (!video->uvc || !video->uvc->func.config ||
+ !video->uvc->func.config->cdev) {
+ pr_err("uvcg_video_enable: missing uvc/func/config video=%p uvc=%p\n",
+ video, video->uvc);
+ return -ENODEV;
+ }
+
if (video->ep == NULL) {
uvcg_info(&video->uvc->func,
"Video enable failed, device is uninitialized.\n");
return -ENODEV;
}
2026-01-22 15:30:42 -03:00
2026-01-22 15:23:25 -03:00
+ if (!video->kworker || !video->async_wq) {
+ uvcg_err(&video->uvc->func,
2026-01-22 15:30:42 -03:00
+ "Video enable failed, missing worker(s) kworker=%p async_wq=%p\n",
+ video->kworker, video->async_wq);
2026-01-22 15:23:25 -03:00
+ return -EINVAL;
+ }
+
+ if (!video->queue.queue.dev) {
+ uvcg_err(&video->uvc->func,
2026-01-22 15:30:42 -03:00
+ "Video enable failed, missing queue device\n");
2026-01-22 15:23:25 -03:00
+ return -EINVAL;
+ }
+
+ uvcg_info(&video->uvc->func,
2026-01-22 15:30:42 -03:00
+ "Video enable start: video=%p ep=%p kworker=%p async_wq=%p req_size=%u max_payload=%u requests=%u reqs_per_frame=%u use_sg=%u flags=0x%x\n",
+ video, video->ep, video->kworker, video->async_wq,
+ video->req_size, video->max_payload_size,
+ video->uvc_num_requests, video->reqs_per_frame,
+ video->queue.use_sg, video->queue.flags);
+
2026-01-22 15:23:25 -03:00
/*
* Safe to access request related fields without req_lock because
2026-01-22 15:30:42 -03:00
* this is the only thread currently active, and no other