diff options
author | Ajay Gupta <ajayg@nvidia.com> | 2013-06-04 10:11:43 -0700 |
---|---|---|
committer | Riham Haidar <rhaidar@nvidia.com> | 2013-06-06 12:12:49 -0700 |
commit | deb1d0181e713cb8cb8bc3ad96a79b6799d9c2b4 (patch) | |
tree | 256d7239802491e0d1fa7350c9f8cf9c8e9d39a7 /drivers | |
parent | 3ee6a261731ca9d07e54c47923d338ca193dfed4 (diff) |
usb: xhci: tegra: set SNPS owner only if no hs connected
Commit "usb: xhci: tegra: set SNPS as owner to save power"
cause reset error when SS hub is connected as bus_suspend is
called while HS part of hub is connected.
Fixing by checking if any HS device connected before setting
port owner as SNPS
Bug 1275290
Change-Id: I9d5e7f41bc48f017f76a0f41d8f5a70355bc0399
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/235513
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/xhci-tegra.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index 6fc16db951b3..29e96ea15d84 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -262,6 +262,24 @@ static inline void must_have_sync_lock(struct tegra_xhci_hcd *tegra) static inline void must_have_sync_lock(struct tegra_xhci_hcd *tegra) #endif +static bool is_any_hs_connected(struct xhci_hcd *xhci) +{ + __le32 __iomem *addr; + int i; + int ports; + u32 portsc; + + ports = HCS_MAX_PORTS(xhci->hcs_params1); + addr = &xhci->op_regs->port_status_base; + for (i = 0; i < ports; i++) { + portsc = xhci_readl(xhci, addr); + if ((portsc & PORT_CONNECT) && DEV_HIGHSPEED(portsc)) + return true; + addr += NUM_PORT_REGS; + } + return false; +} + static void debug_print_portsc(struct xhci_hcd *xhci) { __le32 __iomem *addr; @@ -2368,8 +2386,9 @@ done: if (xhci->main_hcd == hcd) { utmi_phy_pad_disable(); utmi_phy_iddq_override(true); - /* set port ownership to SNPS to save power */ - tegra_xhci_release_port_ownership(tegra, true); + /* port ownership to SNPS when no HS connected to save power */ + if (!is_any_hs_connected(xhci)) + tegra_xhci_release_port_ownership(tegra, true); } else if (xhci->shared_hcd == hcd) { /* save leakage power when SS not in use. * This is also done when fw mbox message is received for freq |