linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>,
	Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Cc: John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH 3/3] usb: dwc2: Prevent core suspend when port connection flag is 0
Date: Thu, 18 Mar 2021 06:23:58 +0000	[thread overview]
Message-ID: <c88f6c5b-ed25-e779-eaba-f840f3e1277c@synopsys.com> (raw)
In-Reply-To: <20210318061333.D6F9CA022F@mailhost.synopsys.com>

On 3/18/2021 10:13 AM, Artur Petrosyan wrote:
> In host mode port connection status flag is "0" when loading
> the driver. After loading the driver system asserts suspend
> which is handled by "_dwc2_hcd_suspend()" function. Before
> the system suspend the port connection status is "0". As
> result need to check the "port_connect_status" if it is "0",
> then skipping entering to suspend.
> 
> Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>

Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>

> ---
>   drivers/usb/dwc2/hcd.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index 40e5655921bf..1a9789ec5847 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -4322,7 +4322,8 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
>   	if (hsotg->op_state == OTG_STATE_B_PERIPHERAL)
>   		goto unlock;
>   
> -	if (hsotg->params.power_down > DWC2_POWER_DOWN_PARAM_PARTIAL)
> +	if (hsotg->params.power_down != DWC2_POWER_DOWN_PARAM_PARTIAL ||
> +	    hsotg->flags.b.port_connect_status == 0)
>   		goto skip_power_saving;
>   
>   	/*
> 


       reply	other threads:[~2021-03-18  6:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210318061333.D6F9CA022F@mailhost.synopsys.com>
2021-03-18  6:23 ` Minas Harutyunyan [this message]
2021-03-23 11:25 ` [PATCH 3/3] usb: dwc2: Prevent core suspend when port connection flag is 0 Greg Kroah-Hartman
2021-03-26 10:25 Artur Petrosyan
2021-03-26 13:33 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c88f6c5b-ed25-e779-eaba-f840f3e1277c@synopsys.com \
    --to=minas.harutyunyan@synopsys.com \
    --cc=Arthur.Petrosyan@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).