]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - drivers/usb/cdns3/gadget.c
usb: cdns3: Fix dequeue implementation.
authorPawel Laszczak <pawell@cadence.com>
Sun, 13 Oct 2019 09:20:20 +0000 (10:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Oct 2019 18:07:44 +0000 (20:07 +0200)
commitf616c3bda47e314ddb797e969f27081f3c33e3b3
tree60772d2e6f6734ed5cc3aa6768df7439449a942d
parentfd47a417e75e2506eb3672ae569b1c87e3774155
usb: cdns3: Fix dequeue implementation.

Dequeuing implementation in cdns3_gadget_ep_dequeue gets first request from
deferred_req_list and changed TRB associated with it to LINK TRB.
This approach is incorrect because deferred_req_list contains requests
that have not been placed on hardware RING.  In this case driver should
just giveback this request to gadget driver.

The patch implements new approach that first checks where dequeuing
request is located and only when it's on Transfer Ring then changes TRB
associated with it to LINK TRB.
During processing completed transfers such LINK TRB will be ignored.

Reported-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/1570958420-22196-1-git-send-email-pawell@cadence.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/cdns3/gadget.c