linux_dsm_epyc7002/drivers/usb/storage
Yoshihiro Shimoda d74ffae8b8 usb-storage: Add a limitation for blk_queue_max_hw_sectors()
This patch fixes an issue that the following error happens on
swiotlb environment:

	xhci-hcd ee000000.usb: swiotlb buffer is full (sz: 524288 bytes), total 32768 (slots), used 1338 (slots)

On the kernel v5.1, block settings of a usb-storage with SuperSpeed
were the following so that the block layer will allocate buffers
up to 64 KiB, and then the issue didn't happen.

	max_segment_size = 65536
	max_hw_sectors_kb = 1024

After the commit 09324d32d2 ("block: force an unlimited segment
size on queues with a virt boundary") is applied, the block settings
are the following. So, the block layer will allocate buffers up to
1024 KiB, and then the issue happens:

	max_segment_size = 4294967295
	max_hw_sectors_kb = 1024

To fix the issue, the usb-storage driver checks the maximum size of
a mapping for the device and then adjusts the max_hw_sectors_kb
if required. After this patch is applied, the block settings will
be the following, and then the issue doesn't happen.

	max_segment_size = 4294967295
	max_hw_sectors_kb = 256

Fixes: 09324d32d2 ("block: force an unlimited segment size on queues with a virt boundary")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/1563793105-20597-1-git-send-email-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-25 10:40:02 +02:00
..
alauda.c
cypress_atacb.c
datafab.c
debug.c
debug.h
ene_ub6250.c USB: ene_usb6250: add missing indentation 2018-11-23 16:13:14 +01:00
freecom.c
initializers.c
initializers.h
isd200.c USB: STORAGE: ISD200 Fixed coding style issue "space required in for loop" 2018-09-20 15:10:29 +02:00
jumpshot.c
karma.c USB: storage: karma: add whitespace after declarations 2019-01-22 09:08:17 +01:00
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile treewide: prefix header search paths with $(srctree)/ 2019-05-18 11:49:57 +09:00
onetouch.c
option_ms.c
option_ms.h
protocol.c
protocol.h
realtek_cr.c USB: core: Fix bug caused by duplicate interface PM usage counter 2019-04-19 21:15:13 +02:00
scsiglue.c usb-storage: Add a limitation for blk_queue_max_hw_sectors() 2019-07-25 10:40:02 +02:00
scsiglue.h
sddr09.c
sddr55.c
shuttle_usbat.c
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
transport.h
uas-detect.h
uas.c UAS: fix alignment of scatter/gather segments 2019-04-30 17:51:42 +02:00
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h USB: storage: add quirk for SMI SM3350 2019-01-07 17:23:30 +01: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
unusual_usbat.h
usb.c
usb.h
usual-tables.c