linux/drivers/usb/cdns3
Pawel Laszczak f073d10cd5 usb: cdns3: remove fetched trb from cache before dequeuing
commit 1301c7b9f7 upstream.

After doorbell DMA fetches the TRB. If during dequeuing request
driver changes NORMAL TRB to LINK TRB but doesn't delete it from
controller cache then controller will handle cached TRB and packet
can be lost.

The example scenario for this issue looks like:
1. queue request - set doorbell
2. dequeue request
3. send OUT data packet from host
4. Device will accept this packet which is unexpected
5. queue new request - set doorbell
6. Device lost the expected packet.

By setting DFLUSH controller clears DRDY bit and stop DMA transfer.

Fixes: 7733f6c32e ("usb: cdns3: Add Cadence USB3 DRD Driver")
cc: <stable@vger.kernel.org>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20221115100039.441295-1-pawell@cadence.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-24 07:22:46 +01:00
..
Kconfig
Makefile
cdns3-debug.h
cdns3-ep0.c
cdns3-gadget.c
cdns3-gadget.h
cdns3-imx.c
cdns3-pci-wrap.c
cdns3-plat.c
cdns3-ti.c
cdns3-trace.c
cdns3-trace.h
cdnsp-debug.h
cdnsp-ep0.c
cdnsp-gadget.c
cdnsp-gadget.h
cdnsp-mem.c
cdnsp-pci.c
cdnsp-ring.c
cdnsp-trace.c
cdnsp-trace.h
core.c
core.h
drd.c
drd.h
gadget-export.h
host-export.h
host.c