summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBH Hsieh <bhsieh@nvidia.com>2012-06-13 20:14:57 +0800
committerVarun Colbert <vcolbert@nvidia.com>2012-06-15 11:21:57 -0700
commitd3090d7f097d7d0e9a707b0de76fd458e00970b5 (patch)
tree371a5756cc00058603451e95e7b35b8d39707d63
parentea957c2de09b608a55b49f1ec1408a16d65308a5 (diff)
arm: tegra: usb_phy: disable all interrupt for 2ls
Disable all interrupts on current CPU while doing 2ls to make sure the 3 us delay being executed precisely bug 944998 Change-Id: I645709ffdd2481a63223272e1b3f7f1f78466236 Reviewed-on: http://git-master/r/108536 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/tegra3_usb_phy.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c
index 01ebc2f89bf7..4af292e86324 100644
--- a/arch/arm/mach-tegra/tegra3_usb_phy.c
+++ b/arch/arm/mach-tegra/tegra3_usb_phy.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/tegra3_usb_phy.c
*
- * Copyright (C) 2011 NVIDIA Corporation
+ * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
*
*
* This software is licensed under the terms of the GNU General Public
@@ -1288,11 +1288,16 @@ static int utmi_phy_disable_obs_bus(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
+ unsigned long flags;
/* check if OBS bus is already enabled */
val = readl(base + UTMIP_MISC_CFG0);
if (val & UTMIP_DPDM_OBSERVE) {
PHY_DBG("DISABLE_OBS_BUS\n");
+
+ /* disable ALL interrupts on current CPU */
+ local_irq_save(flags);
+
/* Change the UTMIP OBS bus to drive SE0 */
val = readl(base + UTMIP_MISC_CFG0);
val &= ~UTMIP_DPDM_OBSERVE_SEL(~0);
@@ -1316,6 +1321,10 @@ static int utmi_phy_disable_obs_bus(struct tegra_usb_phy *phy)
val = readl(base + USB_USBCMD);
val |= USB_USBCMD_RS;
writel(val, base + USB_USBCMD);
+
+ /* restore ALL interrupts on current CPU */
+ local_irq_restore(flags);
+
if (usb_phy_reg_status_wait(base + USB_USBCMD, USB_USBCMD_RS,
USB_USBCMD_RS, 2000)) {
pr_err("%s: timeout waiting for USB_USBCMD_RS\n", __func__);