From c451e3744b35669e8dfb5f6c98c4a91a3e604504 Mon Sep 17 00:00:00 2001 From: John Youn Date: Mon, 14 Nov 2016 12:32:45 -0800 Subject: [PATCH] usb: dwc3: Workaround for irq mask issue This is a workaround for STAR 9000961433 which affects only version 3.00a of the DWC_usb3 core. This prevents the controller interrupt from being masked while handling events. Enabling interrupt moderation allows us to work around this issue because once the GEVNTCOUNT.count is written the IRQ is immediately deasserted and won't be asserted again until GEVNTCOUNT.EHB is cleared. Signed-off-by: John Youn Signed-off-by: Felipe Balbi Change-Id: I18d507ec98401341d08537cd347aefd940c24da0 Git-commit: 28632b44d129cd2dc677475197a01cced307cfc5 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git [hemantk@codeaurora.org: Moved WA to dwc3_core_init()] Signed-off-by: Hemant Kumar Signed-off-by: Mayank Rana --- drivers/usb/dwc3/core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index bcd698017711..ccc1aa8172c1 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -670,6 +670,16 @@ int dwc3_core_init(struct dwc3 *dwc) } } + /* + * Workaround for STAR 9000961433 which affects only version + * 3.00a of the DWC_usb3 core. This prevents the controller + * interrupt from being masked while handling events. IMOD + * allows us to work around this issue. Enable it for the + * affected version. + */ + if (!dwc->imod_interval && (dwc->revision == DWC3_REVISION_300A)) + dwc->imod_interval = 1; + ret = dwc3_core_reset(dwc); if (ret) goto err0; -- 2.11.0