<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/usb/usb_transfer.c, branch release/13.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>Factor out repeated code in the USB controller drivers to avoid bugs</title>
<updated>2022-03-17T12:25:56+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2021-07-10T16:17:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cd60f3f39a76d1d5c1a9859ce78c7b7052e1173b'/>
<id>cd60f3f39a76d1d5c1a9859ce78c7b7052e1173b</id>
<content type='text'>
computing the same isochronous start frame number over and over again.

PR:		257082
Sponsored by:	NVIDIA Networking
Approved by:	re (gjb)

(cherry picked from commit 8fc2a3c41791b205a107dc2bec16ac7514a57958)
(cherry picked from commit f52783fcf5cc60734121d061beef0d4ea47b224a)
(cherry picked from commit cf48d1f77126d8de4c03c4dd7c8502be2b5f1954)
(cherry picked from commit 99977369433de3eaec6907e51bcabc1dbb088628)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
computing the same isochronous start frame number over and over again.

PR:		257082
Sponsored by:	NVIDIA Networking
Approved by:	re (gjb)

(cherry picked from commit 8fc2a3c41791b205a107dc2bec16ac7514a57958)
(cherry picked from commit f52783fcf5cc60734121d061beef0d4ea47b224a)
(cherry picked from commit cf48d1f77126d8de4c03c4dd7c8502be2b5f1954)
(cherry picked from commit 99977369433de3eaec6907e51bcabc1dbb088628)
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: clean up empty lines in .c and .h files</title>
<updated>2020-09-01T21:26:44+00:00</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-09-01T21:26:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9dd3156e546b29b1e6c3047578e91b1d098af171'/>
<id>9dd3156e546b29b1e6c3047578e91b1d098af171</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>usb(4): Stop checking for failures from malloc(M_WAITOK).</title>
<updated>2020-07-22T14:32:47+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2020-07-22T14:32:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=94140f4781f83c9e98f582439ed69d000ff0323a'/>
<id>94140f4781f83c9e98f582439ed69d000ff0323a</id>
<content type='text'>
Handle the fact that parts of usb(4) can be compiled into the boot
loader, where M_WAITOK does not guarantee a successful allocation.

PR:		240545
Submitted by:	Andrew Reiter &lt;arr@watson.org&gt; (original version)
Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25706
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Handle the fact that parts of usb(4) can be compiled into the boot
loader, where M_WAITOK does not guarantee a successful allocation.

PR:		240545
Submitted by:	Andrew Reiter &lt;arr@watson.org&gt; (original version)
Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25706
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement helper function, usbd_get_max_frame_length(), which allows kernel</title>
<updated>2020-05-28T08:38:25+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2020-05-28T08:38:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=506a911bad51b9efde620fccd4448ff7d45146ec'/>
<id>506a911bad51b9efde620fccd4448ff7d45146ec</id>
<content type='text'>
device drivers to correctly predict the default USB transfer frame length.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
device drivers to correctly predict the default USB transfer frame length.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
</pre>
</div>
</content>
</entry>
<entry>
<title>Add own counter for cancelled USB transfers.</title>
<updated>2020-01-06T09:49:20+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2020-01-06T09:49:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6c110e86118f714f4b1cf7b66b0fca845cd697d7'/>
<id>6c110e86118f714f4b1cf7b66b0fca845cd697d7</id>
<content type='text'>
Do not count these as errors.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not count these as errors.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
</pre>
</div>
</content>
</entry>
<entry>
<title>Make USB statistics per device instead of per bus.</title>
<updated>2019-12-27T20:29:13+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2019-12-27T20:29:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7082625d976f0ad1b4207a12afe3c72e2acd9145'/>
<id>7082625d976f0ad1b4207a12afe3c72e2acd9145</id>
<content type='text'>
Bump the FreeBSD version due to structure change to
force recompilation of external USB modules.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bump the FreeBSD version due to structure change to
force recompilation of external USB modules.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
</pre>
</div>
</content>
</entry>
<entry>
<title>Add quirk for XHCI(4) controllers to support USB control transfers</title>
<updated>2019-09-20T11:28:45+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2019-09-20T11:28:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7fca0e69f608b36b0e5e2c9b5037ca2ec06a96de'/>
<id>7fca0e69f608b36b0e5e2c9b5037ca2ec06a96de</id>
<content type='text'>
above 1Kbyte.  It might look like some XHCI(4) controllers do not
support when the USB control transfer is split using a link TRB. The
next NORMAL TRB after the link TRB is simply failing with XHCI error
code 4. The quirk ensures we allocate a 64Kbyte buffer so that the
data stage TRB is not broken with a link TRB.

Found at:	EuroBSDcon 2019
MFC after:	1 week
Sponsored by:	Mellanox Technologies
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
above 1Kbyte.  It might look like some XHCI(4) controllers do not
support when the USB control transfer is split using a link TRB. The
next NORMAL TRB after the link TRB is simply failing with XHCI error
code 4. The quirk ensures we allocate a 64Kbyte buffer so that the
data stage TRB is not broken with a link TRB.

Found at:	EuroBSDcon 2019
MFC after:	1 week
Sponsored by:	Mellanox Technologies
</pre>
</div>
</content>
</entry>
<entry>
<title>sys/dev: further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-27T14:52:40+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-27T14:52:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=718cf2ccb9956613756ab15d7a0e28f2c8e91cab'/>
<id>718cf2ccb9956613756ab15d7a0e28f2c8e91cab</id>
<content type='text'>
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve USB polling mode by not locking any mutexes, asserting any</title>
<updated>2016-09-14T12:07:34+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2016-09-14T12:07:34+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0eb8d462321b9b88bc4dd2fe3e1aa5fc8f460bb6'/>
<id>0eb8d462321b9b88bc4dd2fe3e1aa5fc8f460bb6</id>
<content type='text'>
mutexes or using any callouts when active.

Trying to lock a mutex when KDB is active or the scheduler is stopped
can result in infinite wait loops. The same goes for calling callout
related functions which in turn lock mutexes.

If the USB controller at which a USB keyboard is connected is idle
when KDB is entered, polling the USB keyboard via USB will always
succeed. Else polling may fail depending on which state the USB
subsystem and USB interrupt handler is in. This is unavoidable unless
KDB can wait for USB interrupt threads to complete before stalling the
CPU(s).

Tested by:	Bruce Evans &lt;bde@freebsd.org&gt;
MFC after:	4 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mutexes or using any callouts when active.

Trying to lock a mutex when KDB is active or the scheduler is stopped
can result in infinite wait loops. The same goes for calling callout
related functions which in turn lock mutexes.

If the USB controller at which a USB keyboard is connected is idle
when KDB is entered, polling the USB keyboard via USB will always
succeed. Else polling may fail depending on which state the USB
subsystem and USB interrupt handler is in. This is unavoidable unless
KDB can wait for USB interrupt threads to complete before stalling the
CPU(s).

Tested by:	Bruce Evans &lt;bde@freebsd.org&gt;
MFC after:	4 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>Resolve deadlock between device_detach() and usbd_do_request_flags()</title>
<updated>2016-09-05T15:35:58+00:00</updated>
<author>
<name>Hans Petter Selasky</name>
<email>hselasky@FreeBSD.org</email>
</author>
<published>2016-09-05T15:35:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=64cb5e2a26932271783dd65ee739178f0a36b188'/>
<id>64cb5e2a26932271783dd65ee739178f0a36b188</id>
<content type='text'>
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by:	avos@
MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by:	avos@
MFC after:	1 week
</pre>
</div>
</content>
</entry>
</feed>
