usb: xhci: tegra: Fix SS device detection as HS
Ajay Gupta [Tue, 30 Apr 2013 21:33:09 +0000 (14:33 -0700)]
commit "usb: xhci: tegra: save leakage power if SS link suspended"
has broken SS device enumeration where we see some SS device gets
detected as HS initially and then later detected as SS.

If ELPG exit happens due to main hcd bus_suspebd call first then
RX_IDLE_OVRD would not be cleared causing SS device getting
detected as HS. Fixing this by making sure RD_IDLE_OVRD is cleared
before loading firmware

Bug 1279725

Change-Id: Ic6c66e36622b8c092bbf6dee765ff216eac0cb64
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/224357
(cherry picked from commit 78f03ef681bde8f7d155670747e1f4f1cd0dc321)
Reviewed-on: http://git-master/r/228180
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

drivers/usb/host/xhci-tegra.c

index 6faaacf..5a2e3d1 100644 (file)
@@ -1738,11 +1738,11 @@ tegra_xhci_host_partition_elpg_exit(struct tegra_xhci_hcd *tegra)
        if (clk_get_rate(tegra->ss_src_clk) == 12000000) {
                clk_set_rate(tegra->ss_src_clk,  3000 * 1000);
                clk_set_parent(tegra->ss_src_clk, tegra->pll_u_480M);
-
-               /* clear ovrd bits when SS freq is being increased */
-               tegra_xhci_rx_idle_mode_override(tegra, false);
        }
 
+       /* clear ovrd bits */
+       tegra_xhci_rx_idle_mode_override(tegra, false);
+
        /* Load firmware */
        xhci_dbg(xhci, "%s: elpg_exit: loading firmware from pmc.\n"
                        "ss (p1=0x%x, p2=0x%x, p3=0x%x), "