From: Felipe Balbi <balbi@kernel.org>
To: Marcel Hamer <marcel@solidxs.se>, linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, Marcel Hamer <marcel@solidxs.se>,
Thinh Nguyen <thinhn@synopsys.com>
Subject: Re: [PATCH] usb: dwc3: gadget: add missing wakeup link states
Date: Sat, 24 Apr 2021 11:08:07 +0300 [thread overview]
Message-ID: <87pmykksuw.fsf@kernel.org> (raw)
In-Reply-To: <20210423152524.624619-1-marcel@solidxs.se>
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
Marcel Hamer <marcel@solidxs.se> writes:
> In dwc3_send_gadget_ep_cmd() a check is performed if the gadget needs
> waking up. The following condition is checked before calling the
> __dwc3_gadget_wakeup() function:
>
> needs_wakeup = (dwc->link_state == DWC3_LINK_STATE_U1 ||
> dwc->link_state == DWC3_LINK_STATE_U2 ||
> dwc->link_state == DWC3_LINK_STATE_U3);
>
> Inside __dwc3_gadget_wakeup() only link_state DWC3_LINK_STATE_U3 is checked
> and link state DWC3_LINK_STATE_U1 and DWC3_LINK_STATE_U2 are considered
> invalid and generate a warning because of the call to:
>
> dev_WARN_ONCE(dwc->dev, ret, "wakeup failed --> %d\n", ret);
>
> because of ret being -EINVAL.
>
> Signed-off-by: Marcel Hamer <marcel@solidxs.se>
> ---
> drivers/usb/dwc3/gadget.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index c7ef218e7a8c..d05a7d630410 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1972,6 +1972,8 @@ static int __dwc3_gadget_wakeup(struct dwc3 *dwc)
> switch (link_state) {
> case DWC3_LINK_STATE_RESET:
> case DWC3_LINK_STATE_RX_DET: /* in HS, means Early Suspend */
> + case DWC3_LINK_STATE_U1:
> + case DWC3_LINK_STATE_U2:
I think this was fixed recently by Thinh.
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-next&id=c560e76319a94a3b9285bc426c609903408e4826
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
next prev parent reply other threads:[~2021-04-24 8:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 15:25 [PATCH] usb: dwc3: gadget: add missing wakeup link states Marcel Hamer
2021-04-24 8:08 ` Felipe Balbi [this message]
2021-04-24 18:41 ` Marcel Hamer
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=87pmykksuw.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=marcel@solidxs.se \
--cc=thinhn@synopsys.com \
/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