summaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/cdns3-gadget.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-05 07:39:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-05 07:39:02 +0200
commitd37537a1f7cf09e304fe7993cb5e732534a0fb22 (patch)
treef9894c8e18496941e28499b7fc1ccb01569db526 /drivers/usb/cdns3/cdns3-gadget.c
parent243ff7e6a03533fd5f34036b4a2c297d844ffdc0 (diff)
parent9561de3a55bed6bdd44a12820ba81ec416e705a7 (diff)
downloadlinux-stable-d37537a1f7cf09e304fe7993cb5e732534a0fb22.tar.gz
linux-stable-d37537a1f7cf09e304fe7993cb5e732534a0fb22.tar.bz2
linux-stable-d37537a1f7cf09e304fe7993cb5e732534a0fb22.zip
Merge 6.4-rc5 into usb-next
We need the USB fixes in here are well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-gadget.c')
-rw-r--r--drivers/usb/cdns3/cdns3-gadget.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index 27199198cc26..ea19253fd2d0 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -2098,6 +2098,19 @@ int cdns3_ep_config(struct cdns3_endpoint *priv_ep, bool enable)
else
priv_ep->trb_burst_size = 16;
+ /*
+ * In versions preceding DEV_VER_V2, for example, iMX8QM, there exit the bugs
+ * in the DMA. These bugs occur when the trb_burst_size exceeds 16 and the
+ * address is not aligned to 128 Bytes (which is a product of the 64-bit AXI
+ * and AXI maximum burst length of 16 or 0xF+1, dma_axi_ctrl0[3:0]). This
+ * results in data corruption when it crosses the 4K border. The corruption
+ * specifically occurs from the position (4K - (address & 0x7F)) to 4K.
+ *
+ * So force trb_burst_size to 16 at such platform.
+ */
+ if (priv_dev->dev_ver < DEV_VER_V2)
+ priv_ep->trb_burst_size = 16;
+
mult = min_t(u8, mult, EP_CFG_MULT_MAX);
buffering = min_t(u8, buffering, EP_CFG_BUFFERING_MAX);
maxburst = min_t(u8, maxburst, EP_CFG_MAXBURST_MAX);