linux-stable/drivers/usb/storage
Alan Stern 9a97694961 usb-storage: Revert commit 747668dbc0 ("usb-storage: Set virt_boundary_mask to avoid SG overflows")
Commit 747668dbc0 ("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
09324d32d2 ("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 ea44d19076 ("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 747668dbc0.

Reported-and-tested-by: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>
Link: https://marc.info/?l=linux-usb&m=157134199501202&w=2
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Seth Bollinger <Seth.Bollinger@digi.com>
CC: <stable@vger.kernel.org>
Fixes: 747668dbc0 ("usb-storage: Set virt_boundary_mask to avoid SG overflows")
Acked-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.1910211145520.1673-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-28 17:52:44 +01:00
..
alauda.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
cypress_atacb.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
datafab.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
debug.c USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
debug.h usb-storage: remove single-use define for debugging 2019-09-10 10:30:53 +02:00
ene_ub6250.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
freecom.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
initializers.c USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
initializers.h USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
isd200.c Modules updates for v5.4 2019-09-22 10:34:46 -07:00
jumpshot.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
karma.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
onetouch.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
option_ms.c
option_ms.h
protocol.c USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
protocol.h USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
realtek_cr.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
scsiglue.c usb-storage: Revert commit 747668dbc0 ("usb-storage: Set virt_boundary_mask to avoid SG overflows") 2019-10-28 17:52:44 +01:00
scsiglue.h USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
sddr09.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
sddr55.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
shuttle_usbat.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
sierra_ms.c usb: sierra: fix a missing check of device_create_file 2019-03-26 16:42:52 +09:00
sierra_ms.h
transport.c USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
transport.h USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
uas-detect.h
uas.c usb-storage: export symbols in USB_STORAGE namespace 2019-09-10 10:30:57 +02:00
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h usb-storage: Add new JMS567 revision to unusual_devs 2019-08-21 09:45:49 -07:00
unusual_ene_ub6250.h
unusual_freecom.h
unusual_isd200.h
unusual_jumpshot.h
unusual_karma.h
unusual_onetouch.h
unusual_realtek.h USB: usb-storage: Add new ID to ums-realtek 2019-06-05 11:52:42 +02:00
unusual_sddr09.h
unusual_sddr55.h
unusual_uas.h usb-storage: Add compatibility quirk flags for G-Technologies G-Drive 2018-05-24 18:19:39 +02:00
unusual_usbat.h
usb.c USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
usb.h USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00
usual-tables.c USB: storage: remove invalid URL from drivers 2018-01-23 10:22:34 +01:00