xhci: tegra: fix host partition powergate sequence
JC Kuo [Wed, 14 Aug 2013 10:05:37 +0000 (18:05 +0800)]
System hang observed during elpg entry/exit stress test. Root cause
is that xhci-tegra doesn't follow host partition powergating sequence
illustrated by PG. "flushing MCCIF and partition clients" needs to be
done before assserting RESET and disabling partition clocks.

This change fixes the sequence by removing fews steps since those are
supposed to be done by tegra_powergate_partition().

bug 1348646

Change-Id: Iae82e5cba2b5ceb09b6b5e6af6641736dc9ba855
Signed-off-by: JC Kuo <jckuo@nvidia.com>
Reviewed-on: http://git-master/r/267292
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Sachin Nikam <snikam@nvidia.com>

drivers/usb/host/xhci-tegra.c

index 2f60b85..5144cfb 100644 (file)
@@ -2538,18 +2538,6 @@ static int tegra_xhci_host_elpg_entry(struct tegra_xhci_hcd *tegra)
        xhci_dbg(xhci, "%s: PMC_UTMIP_UHSIC_SLEEP_CFG_0 = %x\n", __func__,
                tegra_usb_pmc_reg_read(PMC_UTMIP_UHSIC_SLEEP_CFG_0));
 
-       /* STEP 4: Assert reset to host clk and disable host clk */
-       tegra_periph_reset_assert(tegra->host_clk);
-
-       clk_disable(tegra->host_clk);
-
-       /* wait 150us */
-       usleep_range(150, 200);
-
-       /* flush MC client of XUSB_HOST */
-       tegra_powergate_mc_flush(TEGRA_POWERGATE_XUSBC);
-
-       /* STEP 4: Powergate host partition */
        /* tegra_powergate_partition also does partition reset assert */
        ret = tegra_powergate_partition(TEGRA_POWERGATE_XUSBC);
        if (ret) {
@@ -2559,6 +2547,7 @@ static int tegra_xhci_host_elpg_entry(struct tegra_xhci_hcd *tegra)
                return ret;
        }
        tegra->host_pwr_gated = true;
+       clk_disable(tegra->host_clk);
 
        if (tegra->pdata->quirks & TEGRA_XUSB_USE_HS_SRC_CLOCK2)
                clk_disable(tegra->pll_re_vco_clk);