Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Prashanth K <quic_prashk@quicinc.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: Fix latency of DSTS while receiving wakeup event
Date: Tue, 6 Aug 2024 23:51:47 +0000	[thread overview]
Message-ID: <20240806235142.cem5f635wmds4bt4@synopsys.com> (raw)
In-Reply-To: <20240730124742.561408-1-quic_prashk@quicinc.com>

Hi,

On Tue, Jul 30, 2024, Prashanth K wrote:
> When operating in High-Speed, it is observed that DSTS[USBLNKST] doesn't
> update link state immediately after receiving the wakeup interrupt. Since
> wakeup event handler calls the resume callbacks, there is a chance that
> function drivers can perform an ep queue. Which in turn tries to perform
> remote wakeup from send_gadget_ep_cmd(), this happens because DSTS[[21:18]
> wasn't updated to U0 yet. It is observed that the latency of DSTS can be
> in order of milli-seconds. Hence update the dwc->link_state from evtinfo,
> and use this variable to prevent calling remote wakup unnecessarily.
> 
> Fixes: ecba9bc9946b ("usb: dwc3: gadget: Check for L1/L2/U3 for Start Transfer")

This commit ID is corrupted. Please check.

While operating in usb2 speed, if the device is in low power link state
(L1/L2), CMDACT may not complete and time out. The programming guide
suggested to initiate remote wakeup to bring the device to ON state,
allowing the command to go through. However, clearing the
GUSB2PHYCFG.suspendusb2 turns on the signal required to complete a
command within 50us. This happens within the timeout required for an
endpoint command. As a result, there's no need to perform remote wakeup.

For usb3 speed, if it's in U3, the gadget is in suspend anyway. There
will be no ep_queue to trigger the Start Transfer command.

You can just remove the whole Start Transfer check for remote wakeup
completely.

Thanks,
Thinh

  reply	other threads:[~2024-08-06 23:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 12:47 [PATCH] usb: dwc3: Fix latency of DSTS while receiving wakeup event Prashanth K
2024-08-06 23:51 ` Thinh Nguyen [this message]
2024-08-07  9:41   ` Prashanth K
2024-08-08  0:06     ` Thinh Nguyen
2024-08-13  9:53       ` Prashanth K
2024-08-13 23:30         ` Thinh Nguyen
2024-08-14  4:22           ` Prashanth K

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=20240806235142.cem5f635wmds4bt4@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_prashk@quicinc.com \
    --cc=stable@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