Re: [PATCH 03/14] usb: dwc2: Fix wakeup detected and session request interrupt handlers.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Artur,

On Fri, Apr 12, 2019 at 01:38:56PM +0000, Artur Petrosyan wrote:
> In host mode port power must be turned on when wakeup
> detected or session request interrupt is detected.
> Because, otherwise core wouldn't exit form partial
> power down.
> 
> - Turned on the port power by setting HPRT0_PWR bit.
> 
> - Called dwc2_hcd_connect() function after enabling
>   the power of the port.
> 
> Signed-off-by: Artur Petrosyan <arturp@xxxxxxxxxxxx>
> ---
>  drivers/usb/dwc2/core_intr.c | 24 +++++++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
> index 19ae2595f1c3..ce523fd2b1b4 100644
> --- a/drivers/usb/dwc2/core_intr.c
> +++ b/drivers/usb/dwc2/core_intr.c
> @@ -312,6 +312,7 @@ static void dwc2_handle_conn_id_status_change_intr(struct dwc2_hsotg *hsotg)
>  static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
>  {
>  	int ret;
> +	u32 hprt0;
>  
>  	/* Clear interrupt */
>  	dwc2_writel(hsotg, GINTSTS_SESSREQINT, GINTSTS);
> @@ -320,7 +321,8 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
>  		hsotg->lx_state);
>  
>  	if (dwc2_is_device_mode(hsotg)) {
> -		if (hsotg->lx_state == DWC2_L2) {
> +		if (hsotg->lx_state == DWC2_L2 &&
> +		    hsotg->params.power_down == 1) {
I think you can replace 1 with DWC2_POWER_DOWN_PARAM_PARTIAL.

[snip]

---
Best,
Jules




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux