linux/drivers/usb
Pratham Pratap dad2aff3e8 usb: dwc3: gadget: Update chain bit correctly when using sg list
If scatter-gather operation is allowed, a large USB request is split
into multiple TRBs. For preparing TRBs for sg list, driver iterates
over the list and creates TRB for each sg and mark the chain bit to
false for the last sg. The current IOMMU driver is clubbing the list
of sgs which shares a page boundary into one and giving it to USB driver.
With this the number of sgs mapped it not equal to the the number of sgs
passed. Because of this USB driver is not marking the chain bit to false
since it couldn't iterate to the last sg. This patch addresses this issue
by marking the chain bit to false if it is the last mapped sg.

At a practical level, this patch resolves USB transfer stalls
seen with adb on dwc3 based db845c, pixel3 and other qcom
hardware after functionfs gadget added scatter-gather support
around v4.20.

Credit also to Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
who implemented a very similar fix to this issue.

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Yang Fei <fei.yang@intel.com>
Cc: Thinh Nguyen <thinhn@synopsys.com>
Cc: Tejas Joglekar <tejas.joglekar@synopsys.com>
Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Cc: Jack Pham <jackp@codeaurora.org>
Cc: Todd Kjos <tkjos@google.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Linux USB List <linux-usb@vger.kernel.org>
Cc: stable <stable@vger.kernel.org> #4.20+
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
[jstultz: Slight tweak to remove sg_is_last() usage, reworked
          commit message, minor comment tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Link: https://lore.kernel.org/r/20200302214443.55783-1-john.stultz@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-04 10:58:16 +01:00
..
atm USB driver fixes for 5.5-rc2 2019-12-14 12:40:39 -08:00
c67x00
cdns3 usb: cdns3: gadget: toggle cycle bit before reset endpoint 2020-03-04 10:56:26 +01:00
chipidea usb: chipidea: add inline for ci_hdrc_host_driver_init if host is not defined 2020-01-22 07:54:27 +01:00
class compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
common usb: common: usb-conn-gpio: Don't log an error on probe deferral 2019-12-10 11:41:20 +01:00
core usb: core: port: do error out if usb_autopm_get_interface() fails 2020-03-04 10:58:16 +01:00
dwc2 usb: dwc2: Fix SET/CLEAR_FEATURE and GET_STATUS flows 2020-02-11 08:45:45 +02:00
dwc3 usb: dwc3: gadget: Update chain bit correctly when using sg list 2020-03-04 10:58:16 +01:00
early remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
gadget USB: fixes for v5.6-rc1 2020-02-13 08:31:21 -08:00
host xhci: Fix memory leak when caching protocol extended capability PSI tables - take 2 2020-02-12 09:51:09 -08:00
image
isp1760 remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
misc usb: usb251xb: fix regulator probe and error handling 2020-03-04 10:56:26 +01:00
mon usb: mon: Fix a deadlock in usbmon between mmap and read 2019-12-10 11:41:20 +01:00
mtu3 Merge 5.4-rc6 into usb-next 2019-11-04 06:41:09 +01:00
musb usb: musb: fix spelling mistake: "periperal" -> "peripheral" 2020-01-21 19:58:45 +01:00
phy usb: phy: tegra: Add clarifying comments about the shared registers 2020-02-10 11:12:15 -08:00
renesas_usbhs phy: for 5.6 2020-01-17 07:52:26 +01:00
roles remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
serial USB: serial: ch341: fix receiver regression 2020-02-10 10:10:35 +01:00
storage usb: storage: Add quirk for Samsung Fit flash 2020-03-04 10:56:26 +01:00
typec USB/Thunderbolt/PHY driver updates for 5.6-rc1 2020-01-29 10:09:44 -08:00
usbip usbip: Fix error path of vhci_recv_ret_submit() 2019-12-17 16:36:33 +01:00
Kconfig
Makefile
usb-skeleton.c