linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: mtk-xhci: Set the XHCI_NO_64BIT_SUPPORT quirk
@ 2019-10-10  7:50 Tomasz Figa
  2019-10-10  8:45 ` Chunfeng Yun
  2019-10-10  9:07 ` Nicolas Boichat
  0 siblings, 2 replies; 12+ messages in thread
From: Tomasz Figa @ 2019-10-10  7:50 UTC (permalink / raw)
  To: linux-usb
  Cc: Mathias Nyman, Greg Kroah-Hartman, Matthias Brugger,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support, open list, Chunfeng Yun,
	Changqi Hu, Nicolas Boichat, Shik Chen, Tomasz Figa

MediaTek XHCI host controller does not support 64-bit addressing despite
the AC64 bit of HCCPARAMS1 register being set. The platform-specific
glue sets the DMA mask to 32 bits on its own, but it has no effect,
because xhci_gen_setup() overrides it according to hardware
capabilities.

Use the XHCI_NO_64BIT_SUPPORT quirk to tell the XHCI core to force
32-bit DMA mask instead.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
---
 drivers/usb/host/xhci-mtk.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index b18a6baef204a..4d101d52cc11b 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -395,6 +395,11 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
 	xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
 	if (mtk->lpm_support)
 		xhci->quirks |= XHCI_LPM_SUPPORT;
+	/*
+	 * MTK host controller does not support 64-bit addressing, despite
+	 * having the AC64 bit of the HCCPARAMS1 register set.
+	 */
+	xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
 }
 
 /* called during probe() after chip reset completes */
@@ -488,11 +493,6 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 		goto disable_clk;
 	}
 
-	/* Initialize dma_mask and coherent_dma_mask to 32-bits */
-	ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
-	if (ret)
-		goto disable_clk;
-
 	hcd = usb_create_hcd(driver, dev, dev_name(dev));
 	if (!hcd) {
 		ret = -ENOMEM;
-- 
2.23.0.581.g78d2f28ef7-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-11-07  4:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10  7:50 [PATCH] usb: mtk-xhci: Set the XHCI_NO_64BIT_SUPPORT quirk Tomasz Figa
2019-10-10  8:45 ` Chunfeng Yun
2019-10-10  9:00   ` Tomasz Figa
2019-10-10 10:59     ` Chunfeng Yun
2019-10-11  4:35       ` Tomasz Figa
2019-10-11  6:53         ` Chunfeng Yun
2019-10-30  8:14         ` Chunfeng Yun
2019-11-07  4:26           ` Tomasz Figa
2019-10-10  9:07 ` Nicolas Boichat
2019-10-10  9:11   ` Tomasz Figa
2019-10-10  9:37     ` Nicolas Boichat
2019-10-10 10:09       ` Tomasz Figa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).