diff mbox series

[09/13] usb: ehci-mx6: Fix USB QTD data buffer error

Message ID 20200916125705.4341-10-peng.fan@nxp.com
State New
Headers show
Series ehci-mx6: update and fix | expand

Commit Message

Peng Fan Sept. 16, 2020, 12:57 p.m. UTC
From: Ye Li <ye.li@nxp.com>


Some iMX6 platforms will meet "EHCI timed out on TD" when reading
or writing data to USB disk. The root cause is last QTD reports
data buffer error.
Accroding to RM, this event indicates that an overrun of incoming
data or a underrun of outgoing data has occurred for this transaction.
This would generally be caused by the host controller not being able
to access required data buffers in memory within necessary latency
requirements.

Follow kernel's method to fix the issue by disabling stream mode

Signed-off-by: Ye Li <ye.li@nxp.com>

Reviewed-by: Peter Chen <peter.chen@nxp.com>

Signed-off-by: Peng Fan <peng.fan@nxp.com>

---
 drivers/usb/host/ehci-mx6.c | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.28.0

Comments

Marek Vasut Sept. 16, 2020, 1:42 p.m. UTC | #1
On 9/16/20 2:57 PM, peng.fan@nxp.com wrote:
> From: Ye Li <ye.li@nxp.com>

> 

> Some iMX6 platforms will meet "EHCI timed out on TD" when reading

> or writing data to USB disk. The root cause is last QTD reports

> data buffer error.

> Accroding to RM, this event indicates that an overrun of incoming

> data or a underrun of outgoing data has occurred for this transaction.

> This would generally be caused by the host controller not being able

> to access required data buffers in memory within necessary latency

> requirements.


How do you even trigger this in U-Boot ?
diff mbox series

Patch

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index de0b0c3156..aa0c1c355d 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -488,6 +488,11 @@  int ehci_hcd_init(int index, enum usb_init_type init,
 		board_ehci_power(index, (type == USB_INIT_DEVICE) ? 0 : 1);
 	if (type != init)
 		return -ENODEV;
+
+	if (is_mx6dqp() || is_mx6dq() || is_mx6sdl() ||
+		((is_mx6sl() || is_mx6sx()) && type == USB_INIT_HOST))
+		setbits_le32(&ehci->usbmode, SDIS);
+
 	if (type == USB_INIT_DEVICE)
 		return 0;
 
@@ -542,6 +547,10 @@  static int mx6_init_after_reset(struct ehci_ctrl *dev)
 	}
 #endif
 
+	if (is_mx6dqp() || is_mx6dq() || is_mx6sdl() ||
+		((is_mx6sl() || is_mx6sx()) && type == USB_INIT_HOST))
+		setbits_le32(&ehci->usbmode, SDIS);
+
 	if (type == USB_INIT_DEVICE)
 		return 0;