Message ID | 1512099124.17567.156.camel@mhfsdcap03 (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Chunfeng, On 11/30/2017 10:32 PM, Chunfeng Yun wrote: > Hi, > On Wed, 2017-11-29 at 10:52 -0500, Adam Wallis wrote: >> The xHCI driver currently has the IMOD set to 160, which >> translates to an IMOD interval of 40,000ns (160 * 250)ns >> >> Commit 0cbd4b34cda9 ("xhci: mediatek: support MTK xHCI host controller") >> introduced a QUIRK for the MTK platform to adjust this interval to 20, [..] >> #include "xhci-mvebu.h" >> #include "xhci-rcar.h" >> +#include "xhci-mtk.h" > Needn't it, MTK makes use of xhci-mtk.c but not xhci-plat.c > Thanks - I made this change in V3. [..] >> >> static struct hc_driver __read_mostly xhci_plat_hc_driver; >> >> @@ -269,6 +270,18 @@ static int xhci_plat_probe(struct platform_device *pdev) >> if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped")) >> xhci->quirks |= XHCI_BROKEN_PORT_PED; >> >> + /* >> + * imod_interval is the interrupt modulation value in nanoseconds. >> + * The increment interval is 8 times as much as that defined in >> + * the xHCI spec on MTK's controller. This quirk check exists to provide >> + * backwards compatibility, however, this should be pushed into >> + * the device tree files at some point in the future and >> + * checking the quirk should be removed from xhci_plat_probe. >> + */ >> + xhci->imod_interval = xhci->quirks & XHCI_MTK_HOST ? 5000 : 40000; > Can be moved into xhci-mtk.c for MTK quirk, like as following: > I moved this into V3 as suggested - could you test on an MTK platform (I don't have one available) to see if it performs as expected?
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 2d473e0..a03451b 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -699,6 +699,13 @@ static int xhci_mtk_probe(struct platform_device *pdev) goto power_off_phys; } + /* + * the increment interval is 8 times as much as that defined + * in xHCI spec on MTK's controller + */ + xhci->imod_interval = 5000; + device_property_read_u32(dev, "imod-interval", &xhci->imod_interval); + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto put_usb3_hcd;