<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget/function/f_uvc.c, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-05-18T08:28:19Z</updated>
<entry>
<title>usb: gadget: uvc: allow for application to cleanly shutdown</title>
<updated>2022-05-18T08:28:19Z</updated>
<author>
<name>Dan Vacura</name>
</author>
<published>2022-05-03T20:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e10735ce87502b07e171727e574afdd6c0890a08'/>
<id>urn:sha1:e10735ce87502b07e171727e574afdd6c0890a08</id>
<content type='text'>
commit b81ac4395bbeaf36e078dea1a48c02dd97b76235 upstream.

Several types of kernel panics can occur due to timing during the uvc
gadget removal. This appears to be a problem with gadget resources being
managed by both the client application's v4l2 open/close and the UDC
gadget bind/unbind. Since the concept of USB_GADGET_DELAYED_STATUS
doesn't exist for unbind, add a wait to allow for the application to
close out.

Some examples of the panics that can occur are:

&lt;1&gt;[ 1147.652313] Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000028
&lt;4&gt;[ 1147.652510] Call trace:
&lt;4&gt;[ 1147.652514]  usb_gadget_disconnect+0x74/0x1f0
&lt;4&gt;[ 1147.652516]  usb_gadget_deactivate+0x38/0x168
&lt;4&gt;[ 1147.652520]  usb_function_deactivate+0x54/0x90
&lt;4&gt;[ 1147.652524]  uvc_function_disconnect+0x14/0x38
&lt;4&gt;[ 1147.652527]  uvc_v4l2_release+0x34/0xa0
&lt;4&gt;[ 1147.652537]  __fput+0xdc/0x2c0
&lt;4&gt;[ 1147.652540]  ____fput+0x10/0x1c
&lt;4&gt;[ 1147.652545]  task_work_run+0xe4/0x12c
&lt;4&gt;[ 1147.652549]  do_notify_resume+0x108/0x168

&lt;1&gt;[  282.950561][ T1472] Unable to handle kernel NULL pointer
dereference at virtual address 00000000000005b8
&lt;6&gt;[  282.953111][ T1472] Call trace:
&lt;6&gt;[  282.953121][ T1472]  usb_function_deactivate+0x54/0xd4
&lt;6&gt;[  282.953134][ T1472]  uvc_v4l2_release+0xac/0x1e4
&lt;6&gt;[  282.953145][ T1472]  v4l2_release+0x134/0x1f0
&lt;6&gt;[  282.953167][ T1472]  __fput+0xf4/0x428
&lt;6&gt;[  282.953178][ T1472]  ____fput+0x14/0x24
&lt;6&gt;[  282.953193][ T1472]  task_work_run+0xac/0x130

&lt;3&gt;[  213.410077][   T29] configfs-gadget gadget: uvc: Failed to queue
request (-108).
&lt;1&gt;[  213.410116][   T29] Unable to handle kernel NULL pointer
dereference at virtual address 0000000000000003
&lt;6&gt;[  213.413460][   T29] Call trace:
&lt;6&gt;[  213.413474][   T29]  uvcg_video_pump+0x1f0/0x384
&lt;6&gt;[  213.413489][   T29]  process_one_work+0x2a4/0x544
&lt;6&gt;[  213.413502][   T29]  worker_thread+0x350/0x784
&lt;6&gt;[  213.413515][   T29]  kthread+0x2ac/0x320
&lt;6&gt;[  213.413528][   T29]  ret_from_fork+0x10/0x30

Signed-off-by: Dan Vacura &lt;w36195@motorola.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20220503201039.71720-1-w36195@motorola.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: ensure the vdev is unset</title>
<updated>2021-10-21T10:58:57Z</updated>
<author>
<name>Michael Grzeschik</name>
</author>
<published>2021-10-17T21:50:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4ce9ed835bcaf4cd3230a53a79645986c25ce0f'/>
<id>urn:sha1:e4ce9ed835bcaf4cd3230a53a79645986c25ce0f</id>
<content type='text'>
Since the uvc video device is created on demand, we have to ensure
that the struct is always zeroed. Otherwise the previous settings
might collide with the new values.

Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20211017215017.18392-7-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: rename function to be more consistent</title>
<updated>2021-10-21T10:58:03Z</updated>
<author>
<name>Michael Tretter</name>
</author>
<published>2021-10-17T21:50:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e6bab2b66329b40462fb1bed6f98bc3fcf543a1c'/>
<id>urn:sha1:e6bab2b66329b40462fb1bed6f98bc3fcf543a1c</id>
<content type='text'>
When enabling info debugging for the uvc gadget, the bind and unbind
infos use different formats. Change the unbind to visually match the
bind.

Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Paul Elder &lt;paul.elder@ideasonboard.com&gt;
Signed-off-by: Michael Tretter &lt;m.tretter@pengutronix.de&gt;
Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20211017215017.18392-3-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: set v4l2_dev-&gt;dev in f_uvc</title>
<updated>2021-07-27T13:59:18Z</updated>
<author>
<name>Michael Grzeschik</name>
</author>
<published>2021-06-28T15:53:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b9b82d3d0dbc45ee6b4817c7a7275a65152301f5'/>
<id>urn:sha1:b9b82d3d0dbc45ee6b4817c7a7275a65152301f5</id>
<content type='text'>
The v4l2_dev has no corresponding device to it. We will
point it to the gadget's dev.

Signed-off-by: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20210628155311.16762-4-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: webcam: Invalid size of Processing Unit Descriptor</title>
<updated>2021-03-18T08:02:27Z</updated>
<author>
<name>Pawel Laszczak</name>
</author>
<published>2021-03-15T07:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6a154ec9ef6762c774cd2b50215c7a8f0f08a862'/>
<id>urn:sha1:6a154ec9ef6762c774cd2b50215c7a8f0f08a862</id>
<content type='text'>
According with USB Device Class Definition for Video Device the
Processing Unit Descriptor bLength should be 12 (10 + bmControlSize),
but it has 11.

Invalid length caused that Processing Unit Descriptor Test Video form
CV tool failed. To fix this issue patch adds bmVideoStandards into
uvc_processing_unit_descriptor structure.

The bmVideoStandards field was added in UVC 1.1 and it wasn't part of
UVC 1.0a.

Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Reviewed-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Link: https://lore.kernel.org/r/20210315071748.29706-1-pawell@gli-login.cadence.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: add bInterval checking for HS mode</title>
<updated>2021-03-18T08:02:27Z</updated>
<author>
<name>Pawel Laszczak</name>
</author>
<published>2021-03-08T12:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=26adde04acdff14a1f28d4a5dce46a8513a3038b'/>
<id>urn:sha1:26adde04acdff14a1f28d4a5dce46a8513a3038b</id>
<content type='text'>
Patch adds extra checking for bInterval passed by configfs.
The 5.6.4 chapter of USB Specification (rev. 2.0) say:
"A high-bandwidth endpoint must specify a period of 1x125 µs
(i.e., a bInterval value of 1)."

The issue was observed during testing UVC class on CV.
I treat this change as improvement because we can control
bInterval by configfs.

Reviewed-by: Peter Chen &lt;peter.chen@kernel.org&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Pawel Laszczak &lt;pawell@cadence.com&gt;
Link: https://lore.kernel.org/r/20210308125338.4824-1-pawell@gli-login.cadence.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: Fix the wrong v4l2_device_unregister call</title>
<updated>2020-10-02T06:57:45Z</updated>
<author>
<name>Zqiang</name>
</author>
<published>2020-09-27T08:01:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f0c485663d5976acb1cb490981a4763a215df75e'/>
<id>urn:sha1:f0c485663d5976acb1cb490981a4763a215df75e</id>
<content type='text'>
If an error occurred before calling the 'v4l2_device_register' func,
and then goto error, but no need to call 'v4l2_device_unregister'
func.

Signed-off-by: Zqiang &lt;qiang.zhang@windriver.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: gadget: uvc: rename VFL_TYPE_GRABBER to _VIDEO</title>
<updated>2020-02-24T15:52:45Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2020-02-03T11:41:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0ceba5502258c28362bffe1ceb259128ef77ad86'/>
<id>urn:sha1:0ceba5502258c28362bffe1ceb259128ef77ad86</id>
<content type='text'>
'GRABBER' is a weird name, all other types map to the /dev
device names. Rename to 'VIDEO' to be consistent with the
other types.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: usb/gadget/f_uvc: set device_caps in struct video_device</title>
<updated>2019-06-05T12:47:44Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2019-06-04T11:19:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1397e3ec0cff0110a1d9c1b1d5fd2c79bfe72fc9'/>
<id>urn:sha1:1397e3ec0cff0110a1d9c1b1d5fd2c79bfe72fc9</id>
<content type='text'>
Instead of filling in the struct v4l2_capability device_caps
field, fill in the struct video_device device_caps field.

That way the V4L2 core knows what the capabilities of the
video device are.

But this only really works if all drivers use this, so convert
this UVC gadget driver.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Acked-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: uvc: Remove uvc_set_trace_param() function</title>
<updated>2018-09-25T15:48:07Z</updated>
<author>
<name>Laurent Pinchart</name>
</author>
<published>2018-09-18T11:26:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d865d00db9e69eb2e6f7c4166e33e5047de497bc'/>
<id>urn:sha1:d865d00db9e69eb2e6f7c4166e33e5047de497bc</id>
<content type='text'>
The function is never called, remove it.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Kieran Bingham &lt;kieran.bingham@ideasonboard.com&gt;
</content>
</entry>
</feed>
