]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: phy: avoid illegal access to registers
authorRakesh Bodla <rbodla@nvidia.com>
Tue, 28 Aug 2012 05:54:19 +0000 (11:24 +0530)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 19:32:46 +0000 (12:32 -0700)
Adding the conditions to prevent illegal register access.

Bug 993380
Bug 1006579
Bug 1017770

Change-Id: I3ff1d80530742104bf07cdd784700a72a09e5909
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/127739
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>
Rebase-Id: R5ef232c92174407bc99b23fd72d212d778d5aa64

arch/arm/mach-tegra/tegra11x_usb_phy.c

index 4ad28a12986e3d26b4f4cdca98cc42afb6f48ad0..b8627a65c0bcbb8d2695de68e1ad737dc27d0319 100644 (file)
@@ -1213,11 +1213,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));
+       }
 
        /* check if there is any remote wake event */
        if (utmi_phy_remotewake_detected(phy))
@@ -1236,6 +1238,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;
                }
        }