<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb, branch v5.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-10-31T17:57:54Z</updated>
<entry>
<title>usb: dwc3: gadget: fix race when disabling ep with cancelled xfers</title>
<updated>2019-10-31T17:57:54Z</updated>
<author>
<name>Felipe Balbi</name>
<email>felipe.balbi@linux.intel.com</email>
</author>
<published>2019-10-31T09:07:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d8eca64eec7103ab1fbabc0a187dbf6acfb2af93'/>
<id>urn:sha1:d8eca64eec7103ab1fbabc0a187dbf6acfb2af93</id>
<content type='text'>
When disabling an endpoint which has cancelled requests, we should
make sure to giveback requests that are currently pending in the
cancelled list, otherwise we may fall into a situation where command
completion interrupt fires after endpoint has been disabled, therefore
causing a splat.

Fixes: fec9095bdef4 "usb: dwc3: gadget: remove wait_end_transfer"
Reported-by: Roger Quadros &lt;rogerq@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20191031090713.1452818-1-felipe.balbi@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: gadget: Fix g_audio use case when connected to Super-Speed host</title>
<updated>2019-10-30T13:39:07Z</updated>
<author>
<name>Roger Quadros</name>
<email>rogerq@ti.com</email>
</author>
<published>2019-10-30T12:16:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=94e259f81a714c96f381d362228fc4743db49742'/>
<id>urn:sha1:94e259f81a714c96f381d362228fc4743db49742</id>
<content type='text'>
Take into account gadget driver's speed limit when programming
controller speed.

Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Roger Quadros &lt;rogerq@ti.com&gt;
Acked-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Link: https://lore.kernel.org/r/20191030121607.21739-1-rogerq@ti.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: cdns3: gadget: reset EP_CLAIMED flag while unloading</title>
<updated>2019-10-30T11:52:13Z</updated>
<author>
<name>Sanket Parmar</name>
<email>sparmar@cadence.com</email>
</author>
<published>2019-10-29T12:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5c8d290634a470600e1ce61733ec54d05a897e8'/>
<id>urn:sha1:f5c8d290634a470600e1ce61733ec54d05a897e8</id>
<content type='text'>
EP_CLAIMED flag is used to track the claimed endpoints. While unloading the
module, Reset EP_CLAIMED flag for all enabled endpoints. So that it can be
reused.

Signed-off-by: Sanket Parmar &lt;sparmar@cadence.com&gt;
Acked-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Reviewed-by: Roger Quadros &lt;rogerq@ti.com&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20191029122441.5816-1-sparmar@cadence.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: whiteheat: fix line-speed endianness</title>
<updated>2019-10-30T09:06:32Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2019-10-29T10:23:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=84968291d7924261c6a0624b9a72f952398e258b'/>
<id>urn:sha1:84968291d7924261c6a0624b9a72f952398e258b</id>
<content type='text'>
Add missing endianness conversion when setting the line speed so that
this driver might work also on big-endian machines.

Also use an unsigned format specifier in the corresponding debug
message.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20191029102354.2733-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: serial: whiteheat: fix potential slab corruption</title>
<updated>2019-10-30T09:06:31Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2019-10-29T10:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1251dab9e0a2c4d0d2d48370ba5baa095a5e8774'/>
<id>urn:sha1:1251dab9e0a2c4d0d2d48370ba5baa095a5e8774</id>
<content type='text'>
Fix a user-controlled slab buffer overflow due to a missing sanity check
on the bulk-out transfer buffer used for control requests.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://lore.kernel.org/r/20191029102354.2733-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: gadget: Reject endpoints with 0 maxpacket value</title>
<updated>2019-10-29T08:56:18Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-10-28T14:54:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54f83b8c8ea9b22082a496deadf90447a326954e'/>
<id>urn:sha1:54f83b8c8ea9b22082a496deadf90447a326954e</id>
<content type='text'>
Endpoints with a maxpacket length of 0 are probably useless.  They
can't transfer any data, and it's not at all unlikely that a UDC will
crash or hang when trying to handle a non-zero-length usb_request for
such an endpoint.  Indeed, dummy-hcd gets a divide error when trying
to calculate the remainder of a transfer length by the maxpacket
value, as discovered by the syzbot fuzzer.

Currently the gadget core does not check for endpoints having a
maxpacket value of 0.  This patch adds a check to usb_ep_enable(),
preventing such endpoints from being used.

As far as I know, none of the gadget drivers in the kernel tries to
create an endpoint with maxpacket = 0, but until now there has been
nothing to prevent userspace programs under gadgetfs or configfs from
doing it.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: syzbot+8ab8bf161038a8768553@syzkaller.appspotmail.com
CC: &lt;stable@vger.kernel.org&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;

Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.1910281052370.1485-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>UAS: Revert commit 3ae62a42090f ("UAS: fix alignment of scatter/gather segments")</title>
<updated>2019-10-28T16:53:39Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-10-23T15:34:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1186f86a71130a7635a20843e355bb880c7349b2'/>
<id>urn:sha1:1186f86a71130a7635a20843e355bb880c7349b2</id>
<content type='text'>
Commit 3ae62a42090f ("UAS: fix alignment of scatter/gather segments"),
copying a similar commit for usb-storage, attempted to solve a problem
involving scatter-gather I/O and USB/IP by setting the
virt_boundary_mask for mass-storage devices.

However, it now turns out that the analogous change in usb-storage
interacted badly with commit 09324d32d2a0 ("block: force an unlimited
segment size on queues with a virt boundary"), which was added later.
A typical error message is:

	ehci-pci 0000:00:13.2: swiotlb buffer is full (sz: 327680 bytes),
	total 32768 (slots), used 97 (slots)

There is no longer any reason to keep the virt_boundary_mask setting
in the uas driver.  It was needed in the first place only for
handling devices with a block size smaller than the maxpacket size and
where the host controller was not capable of fully general
scatter-gather operation (that is, able to merge two SG segments into
a single USB packet).  But:

	High-speed or slower connections never use a bulk maxpacket
	value larger than 512;

	The SCSI layer does not handle block devices with a block size
	smaller than 512 bytes;

	All the host controllers capable of SuperSpeed operation can
	handle fully general SG;

	Since commit ea44d190764b ("usbip: Implement SG support to
	vhci-hcd and stub driver") was merged, the USB/IP driver can
	also handle SG.

Therefore all supported device/controller combinations should be okay
with no need for any special virt_boundary_mask.  So in order to head
off potential problems similar to those affecting usb-storage, this
patch reverts commit 3ae62a42090f.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: Oliver Neukum &lt;oneukum@suse.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Fixes: 3ae62a42090f ("UAS: fix alignment of scatter/gather segments")
Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.1910231132470.1878-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb-storage: Revert commit 747668dbc061 ("usb-storage: Set virt_boundary_mask to avoid SG overflows")</title>
<updated>2019-10-28T16:52:44Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-10-21T15:48:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9a976949613132977098fc49510b46fa8678d864'/>
<id>urn:sha1:9a976949613132977098fc49510b46fa8678d864</id>
<content type='text'>
Commit 747668dbc061 ("usb-storage: Set virt_boundary_mask to avoid SG
overflows") attempted to solve a problem involving scatter-gather I/O
and USB/IP by setting the virt_boundary_mask for mass-storage devices.

However, it now turns out that this interacts badly with commit
09324d32d2a0 ("block: force an unlimited segment size on queues with a
virt boundary"), which was added later.  A typical error message is:

	ehci-pci 0000:00:13.2: swiotlb buffer is full (sz: 327680 bytes),
	total 32768 (slots), used 97 (slots)

There is no longer any reason to keep the virt_boundary_mask setting
for usb-storage.  It was needed in the first place only for handling
devices with a block size smaller than the maxpacket size and where
the host controller was not capable of fully general scatter-gather
operation (that is, able to merge two SG segments into a single USB
packet).  But:

	High-speed or slower connections never use a bulk maxpacket
	value larger than 512;

	The SCSI layer does not handle block devices with a block size
	smaller than 512 bytes;

	All the host controllers capable of SuperSpeed operation can
	handle fully general SG;

	Since commit ea44d190764b ("usbip: Implement SG support to
	vhci-hcd and stub driver") was merged, the USB/IP driver can
	also handle SG.

Therefore all supported device/controller combinations should be okay
with no need for any special virt_boundary_mask.  So in order to fix
the swiotlb problem, this patch reverts commit 747668dbc061.

Reported-and-tested-by: Piergiorgio Sartor &lt;piergiorgio.sartor@nexgo.de&gt;
Link: https://marc.info/?l=linux-usb&amp;m=157134199501202&amp;w=2
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: Seth Bollinger &lt;Seth.Bollinger@digi.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Fixes: 747668dbc061 ("usb-storage: Set virt_boundary_mask to avoid SG overflows")
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.1910211145520.1673-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbip: Fix free of unallocated memory in vhci tx</title>
<updated>2019-10-28T16:51:06Z</updated>
<author>
<name>Suwan Kim</name>
<email>suwan.kim027@gmail.com</email>
</author>
<published>2019-10-22T09:30:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4d8257754c3300ea2a465dadf8d2b02c713c920'/>
<id>urn:sha1:d4d8257754c3300ea2a465dadf8d2b02c713c920</id>
<content type='text'>
iso_buffer should be set to NULL after use and free in the while loop.
In the case of isochronous URB in the while loop, iso_buffer is
allocated and after sending it to server, buffer is deallocated. And
then, if the next URB in the while loop is not a isochronous pipe,
iso_buffer still holds the previously deallocated buffer address and
kfree tries to free wrong buffer address.

Fixes: ea44d190764b ("usbip: Implement SG support to vhci-hcd and stub driver")
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Reported-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Suwan Kim &lt;suwan.kim027@gmail.com&gt;
Reviewed-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Acked-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20191022093017.8027-1-suwan.kim027@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: xhci: fix __le32/__le64 accessors in debugfs code</title>
<updated>2019-10-28T16:47:08Z</updated>
<author>
<name>Ben Dooks (Codethink)</name>
<email>ben.dooks@codethink.co.uk</email>
</author>
<published>2019-10-25T14:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5501d5c29a2e684640507cfee428178d6fd82ca'/>
<id>urn:sha1:d5501d5c29a2e684640507cfee428178d6fd82ca</id>
<content type='text'>
It looks like some of the xhci debug code is passing u32 to functions
directly from __le32/__le64 fields.
Fix this by using le{32,64}_to_cpu() on these to fix the following
sparse warnings;

xhci-debugfs.c:205:62: warning: incorrect type in argument 1 (different base types)
xhci-debugfs.c:205:62:    expected unsigned int [usertype] field0
xhci-debugfs.c:205:62:    got restricted __le32
xhci-debugfs.c:206:62: warning: incorrect type in argument 2 (different base types)
xhci-debugfs.c:206:62:    expected unsigned int [usertype] field1
xhci-debugfs.c:206:62:    got restricted __le32
...

[Trim down commit message, sparse warnings were similar -Mathias]
Cc: &lt;stable@vger.kernel.org&gt; # 4.15+
Signed-off-by: Ben Dooks &lt;ben.dooks@codethink.co.uk&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/1572013829-14044-4-git-send-email-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
