linux/drivers/usb/dwc2
Phil Elwell 75a41ce46b usb: dwc2: Fix gadget DMA unmap direction
The dwc2 gadget support maps and unmaps DMA buffers as necessary. When
mapping and unmapping it uses the direction of the endpoint to select
the direction of the DMA transfer, but this fails for Control OUT
transfers because the unmap occurs after the endpoint direction has
been reversed for the status phase.

A possible solution would be to unmap the buffer before the direction
is changed, but a safer, less invasive fix is to remember the buffer
direction independently of the endpoint direction.

Fixes: fe0b94abcd ("usb: dwc2: gadget: manage ep0 state in software")
Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Link: https://lore.kernel.org/r/20210506112200.2893922-1-phil@raspberrypi.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10 14:51:01 +02:00
..
core_intr.c usb: dwc2: Get rid of useless error checks in suspend interrupt 2021-04-22 11:55:34 +02:00
core.c usb: dwc2: Get rid of useless error checks in suspend interrupt 2021-04-22 11:55:34 +02:00
core.h usb: dwc2: Fix gadget DMA unmap direction 2021-05-10 14:51:01 +02:00
debug.h USB: dwc2: Use the correct style for SPDX License Identifier 2020-05-05 10:58:50 +03:00
debugfs.c usb: dwc2: Add STM32 related debugfs entries 2021-03-10 09:37:15 +01:00
drd.c usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
gadget.c usb: dwc2: Fix gadget DMA unmap direction 2021-05-10 14:51:01 +02:00
hcd_ddma.c usb: dwc2: Modify dwc2_readl/writel functions prototype 2018-07-30 10:39:16 +03:00
hcd_intr.c usb: dwc2: Make "trimming xfer length" a debug message 2021-01-26 18:42:15 +01:00
hcd_queue.c usb: dwc2: add parenthess and space around * 2021-04-02 15:39:59 +02:00
hcd.c usb: dwc2: Add hibernation exiting flow by system resume 2021-04-22 11:55:34 +02:00
hcd.h USB: dwc2: Use the correct style for SPDX License Identifier 2020-05-05 10:58:50 +03:00
hw.h usb: dwc2: Update enter and exit partial power down functions 2021-04-09 15:16:38 +02:00
Kconfig usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
Makefile usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
params.c usb: dwc2: Enable RPi in ACPI mode 2021-04-22 10:55:54 +02:00
pci.c usb: dwc2: pci: Drop the empty quirk function 2021-02-04 15:40:19 +01:00
platform.c usb: dwc2: Add exit hibernation mode before removing drive 2021-04-22 11:55:34 +02:00