summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorSeshendra Gadagottu <sgadagottu@nvidia.com>2011-11-23 16:35:26 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:50:18 -0800
commit2ea5afee7ca8935ebffd40fd86773fb33b96f216 (patch)
tree8a3f5753154128608c25898f6b7ef12d8eedf063 /drivers/usb/host
parentd8d5eea746eb4e337cd1820738c3cd3aef002da8 (diff)
usb: tegra: kernel panic issue with ehci off
Avoid usb suspend/resume when ehci is off. Bug 828389 Reviewed-on: http://git-master/r/65169 (cherry picked from commit ab762cd7eba3cea19188eb9108c4941152e21035) Change-Id: Ie28c80d480360ea6b2bbbb882528f31c5bdf9c0c Reviewed-on: http://git-master/r/66428 Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Tested-by: Gerrit_Virtual_Submit Reviewed-by: Michael Hsu <mhsu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R9028b5911a9c28246b1d10737c626e3e6b936d65
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-tegra.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index a1a4c7c1093a..f7b63573d4e1 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -64,6 +64,7 @@ struct tegra_ehci_hcd {
int bus_suspended;
int port_resuming;
int power_down_on_bus_suspend;
+ int ehci_power_off;
struct delayed_work work;
enum tegra_usb_phy_port_speed port_speed;
struct work_struct clk_timer_work;
@@ -965,6 +966,7 @@ static ssize_t store_ehci_power(struct device *dev,
clk_disable(tegra->emc_clk);
clk_disable(tegra->sclk_clk);
}
+ tegra->ehci_power_off = 1;
usb_remove_hcd(hcd);
tegra_ehci_power_down(hcd, false);
ehci_handle = NULL;
@@ -973,6 +975,7 @@ static ssize_t store_ehci_power(struct device *dev,
del_timer_sync(&tegra->clk_timer);
usb_remove_hcd(hcd);
}
+ tegra->ehci_power_off = 0;
tegra_ehci_power_up(hcd, false);
retval = usb_add_hcd(hcd, ehci_tegra_irq,
IRQF_DISABLED | IRQF_SHARED);
@@ -1251,6 +1254,13 @@ static int tegra_ehci_resume(struct platform_device *pdev)
struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev);
struct usb_hcd *hcd = ehci_to_hcd(tegra->ehci);
+#ifdef CONFIG_USB_EHCI_ONOFF_FEATURE
+ if (tegra->ehci_power_off) {
+ pr_info("%s: ehci_power off - nop\n", __func__);
+ return 0;
+ }
+#endif
+
if ((tegra->bus_suspended) && (tegra->power_down_on_bus_suspend)) {
#ifdef CONFIG_USB_HOTPLUG
clk_enable(tegra->clk);
@@ -1270,6 +1280,13 @@ static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
struct usb_hcd *hcd = ehci_to_hcd(tegra->ehci);
int ret;
+#ifdef CONFIG_USB_EHCI_ONOFF_FEATURE
+ if (tegra->ehci_power_off) {
+ pr_info("%s: ehci_power off - nop\n", __func__);
+ return 0;
+ }
+#endif
+
if ((tegra->bus_suspended) && (tegra->power_down_on_bus_suspend)) {
#ifdef CONFIG_USB_HOTPLUG
clk_disable(tegra->clk);