]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
usb: cdns3: gadget: toggle cycle bit before reset endpoint
authorPeter Chen <peter.chen@nxp.com>
Wed, 19 Feb 2020 14:14:55 +0000 (22:14 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 13 Mar 2020 12:26:56 +0000 (13:26 +0100)
commitaba9e2548af06590f0abb063740cab3c9fe37ed3
tree86b6481ff1db3e1c2553c80376e91866e7441fd5
parent4a2ebd5d2ab461a76fcded4e4d07928ec28d16f3
usb: cdns3: gadget: toggle cycle bit before reset endpoint

BugLink: https://bugs.launchpad.net/bugs/1867178
commit 4bf2dd65135a2d7fe202f7c10d65b51bcf645ac6 upstream.

If there are TRBs pending during reset endpoint operation, the
DMA will advance after reset operation, but it isn't expected,
since the data is not yet available (For OUT, the data is not
yet available). After the data is ready, there won't be any
interrupt since the EP_TRADDR already points to next TRB entry
and doorbell is not set.

To fix it, it toggles cycle bit before reset operation, and restores
it after reset, it could avoid unexpected DMA advance due to
cycle bit is for software during the endpoint reset operation.

Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200219141455.23257-3-peter.chen@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/usb/cdns3/gadget.c