diff mbox

usb: dwc2: Fix host exit from hibernation flow.

Message ID 158187bd06c39f2630a98f604e9ca228d693c95a.1527081875.git.arturp@synopsys.com (mailing list archive)
State New, archived
Headers show

Commit Message

Artur Petrosyan May 23, 2018, 1:26 p.m. UTC
In case when a hub is connected to DWC2 host
auto suspend occurs and host goes to
hibernation. When any device connected to hub
host hibernation exiting incorrectly.

- Added dwc2_hcd_rem_wakeup() function call to
  exit from suspend state by remote wakeup.

- Increase timeout value for port suspend bit to be set.

Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
---
 drivers/usb/dwc2/hcd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Minas Harutyunyan May 31, 2018, 11:53 a.m. UTC | #1
Acked-by: Minas Harutyunyan <hminas@synopsys.com>

On 5/23/2018 5:25 PM, Artur Petrosyan wrote:
> In case when a hub is connected to DWC2 host
> auto suspend occurs and host goes to
> hibernation. When any device connected to hub
> host hibernation exiting incorrectly.
> 
> - Added dwc2_hcd_rem_wakeup() function call to
>    exit from suspend state by remote wakeup.
> 
> - Increase timeout value for port suspend bit to be set.
> 
> Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
> ---
>   drivers/usb/dwc2/hcd.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index 1faefea16cec..736dcc816abf 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -5434,7 +5434,7 @@ int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg)
>   	dwc2_writel(hprt0, hsotg->regs + HPRT0);
>   
>   	/* Wait for the HPRT0.PrtSusp register field to be set */
> -	if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 300))
> +	if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 3000))
>   		dev_warn(hsotg->dev, "Suspend wasn't generated\n");
>   
>   	/*
> @@ -5615,6 +5615,8 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup,
>   		return ret;
>   	}
>   
> +	dwc2_hcd_rem_wakeup(hsotg);
> +
>   	hsotg->hibernated = 0;
>   	hsotg->bus_suspended = 0;
>   	hsotg->lx_state = DWC2_L0;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 1faefea16cec..736dcc816abf 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -5434,7 +5434,7 @@  int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg)
 	dwc2_writel(hprt0, hsotg->regs + HPRT0);
 
 	/* Wait for the HPRT0.PrtSusp register field to be set */
-	if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 300))
+	if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 3000))
 		dev_warn(hsotg->dev, "Suspend wasn't generated\n");
 
 	/*
@@ -5615,6 +5615,8 @@  int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup,
 		return ret;
 	}
 
+	dwc2_hcd_rem_wakeup(hsotg);
+
 	hsotg->hibernated = 0;
 	hsotg->bus_suspended = 0;
 	hsotg->lx_state = DWC2_L0;