summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvjagadish <vjagadish@nvidia.com>2011-10-17 14:14:58 +0530
committerLokesh Pathak <lpathak@nvidia.com>2011-11-09 07:31:29 -0800
commit0ff343ce7069304a57244bf4844617a078b3632c (patch)
treeb14b8370807b2d83b2878c4f1033c88a425e0e24
parentd1aabf0354c997865bffd8b91ff0bdeac5dd4018 (diff)
usb: host: tegra: Fix for possible race condition in timer handler
Acquire the spin lock before disabling the clock. Bug 876433 Reviewed-on: http://git-master/r/59136 (cherry picked from commit 38dc376fc332bdc34a9ee9fd9385fd447a0f343d) Change-Id: Ib2f75f4c16d5ad56e698e14b335f2483f0ece429 Reviewed-on: http://git-master/r/62324 Reviewed-by: Lokesh Pathak <lpathak@nvidia.com> Tested-by: Lokesh Pathak <lpathak@nvidia.com>
-rw-r--r--drivers/usb/host/ehci-tegra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 92ff80a044a2..2d2747a25f71 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -857,12 +857,12 @@ static void clk_timer_work_handler(struct work_struct* clk_timer_work) {
spin_unlock_irqrestore(&tegra->ehci->lock, flags);
if (timer_event) {
- clk_disable(tegra->emc_clk);
- clk_disable(tegra->sclk_clk);
spin_lock_irqsave(&tegra->ehci->lock, flags);
tegra->clock_enabled = 0;
tegra->timer_event = 0;
spin_unlock_irqrestore(&tegra->ehci->lock, flags);
+ clk_disable(tegra->emc_clk);
+ clk_disable(tegra->sclk_clk);
return;
}