summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra3_usb_phy.c
diff options
context:
space:
mode:
authorRakesh Bodla <rbodla@nvidia.com>2012-07-20 11:41:09 +0530
committerSimone Willett <swillett@nvidia.com>2012-07-23 14:51:29 -0700
commit33a657014d3cabea3de90b47ddc9325d0e5af4fa (patch)
treef842f1fab59da70f81d4c34c79f4fcf2f5d2fb55 /arch/arm/mach-tegra/tegra3_usb_phy.c
parentf8f3f9dd17aeef2c1fd2119a3f3cc8b0791c548c (diff)
ARM: tegra: phy: avoid illegal access to registers
Adding the conditions to prevent illegal register access. Bug 993380 Bug 1006579 Reviewed-on: http://git-master/r/113138 (cherry picked from commit a3c026a229bbce614d7f40319bada1d7bf42942d) Change-Id: I0d8e6c20aab04aa43ae484dc8ceb6fcb2c27d151 Reviewed-on: http://git-master/r/117256 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rakesh Bodla <rbodla@nvidia.com> Tested-by: Rakesh Bodla <rbodla@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_usb_phy.c')
-rw-r--r--arch/arm/mach-tegra/tegra3_usb_phy.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c
index 3a3293eba06a..3152bdf9e107 100644
--- a/arch/arm/mach-tegra/tegra3_usb_phy.c
+++ b/arch/arm/mach-tegra/tegra3_usb_phy.c
@@ -1222,11 +1222,13 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy)
void __iomem *base = phy->regs;
unsigned long val = 0;
- DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
- DBG("USB_USBSTS[0x%x] USB_PORTSC[0x%x]\n",
+ if (phy->phy_clk_on) {
+ DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
+ DBG("USB_USBSTS[0x%x] USB_PORTSC[0x%x]\n",
readl(base + USB_USBSTS), readl(base + USB_PORTSC));
- DBG("USB_USBMODE[0x%x] USB_USBCMD[0x%x]\n",
+ DBG("USB_USBMODE[0x%x] USB_USBCMD[0x%x]\n",
readl(base + USB_USBMODE), readl(base + USB_USBCMD));
+ }
usb_phy_fence_read(phy);
/* check if there is any remote wake event */
@@ -1246,6 +1248,8 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy)
val = readl(base + USB_PORTSC);
val &= ~(USB_PORTSC_WKCN | USB_PORTSC_RWC_BITS);
writel(val , (base + USB_PORTSC));
+ } else if (!phy->phy_clk_on) {
+ return IRQ_NONE;
}
}