usb: xhci-plat: check hcc_params after add hcd
authorWilliam Wu <wulf@rock-chips.com>
Fri, 30 Dec 2016 11:45:49 +0000 (19:45 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 3 Jan 2017 08:59:27 +0000 (16:59 +0800)
The commit 4ac53087d6d4 ("usb: xhci: plat: Create both
HCDs before adding them") move add hcd to the end of
probe, this cause hcc_params uninitiated, because xHCI
driver sets hcc_params in xhci_gen_setup() called from
usb_add_hcd().

This patch checks the Maximum Primary Stream Array Size
in the hcc_params register after add hcd.

Change-Id: I5a05ca6a8ac25e914752914abb70612849cc175e
Signed-off-by: William Wu <wulf@rock-chips.com>
drivers/usb/host/xhci-plat.c

index 87a6199dc83c9d26f10f49f44a04a9768641b9e3..8f54e5b97a045c3efffd4c181d7cfb3c00b4910b 100644 (file)
@@ -172,9 +172,6 @@ static int xhci_plat_probe(struct platform_device *pdev)
                        (pdata && pdata->usb3_lpm_capable))
                xhci->quirks |= XHCI_LPM_SUPPORT;
 
-       if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
-               xhci->shared_hcd->can_do_streams = 1;
-
        hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
        if (IS_ERR(hcd->usb_phy)) {
                ret = PTR_ERR(hcd->usb_phy);
@@ -195,6 +192,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
        if (ret)
                goto dealloc_usb2_hcd;
 
+       if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
+               xhci->shared_hcd->can_do_streams = 1;
+
        return 0;