usb: ehci: tegra: prevent illegal register access
Rakesh Bodla [Tue, 17 Jul 2012 05:55:51 +0000 (10:55 +0530)]
Make sure phy is turned ON before reading USB
registers.

Bug 993380
Bug 1006579

Reviewed-on: http://git-master/r/116045
(cherry picked from commit a1a6db7dc88880fb3d4bca0036ce421e4032adae)
Change-Id: If94e691bf9b5b46dd8f8562f27cf86e59a4d6353
Reviewed-on: http://git-master/r/117257
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Tested-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/host/ehci-tegra.c

index ff193ef..624eb64 100644 (file)
@@ -646,6 +646,11 @@ static int tegra_ehci_remove(struct platform_device *pdev)
 
        if (tegra->irq)
                disable_irq_wake(tegra->irq);
+
+       /* Make sure phy is powered ON to access USB register */
+       if(!tegra_usb_phy_hw_accessible(tegra->phy))
+               tegra_usb_phy_power_on(tegra->phy);
+
        usb_remove_hcd(hcd);
        usb_put_hcd(hcd);
        tegra_usb_phy_power_off(tegra->phy);