From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Wesley Cheng <quic_wcheng@quicinc.com>, <mathias.nyman@intel.com>,
<gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
<quic_jackp@quicinc.com>
Subject: Re: [PATCH] usb: host: xhci: Do not re-initialize the XHCI HC if being removed
Date: Tue, 23 May 2023 11:45:27 +0300 [thread overview]
Message-ID: <f34927c3-7f23-3971-9f16-88cb5773f973@omp.ru> (raw)
In-Reply-To: <20230523015354.18497-1-quic_wcheng@quicinc.com>
Hello!
On 5/23/23 4:53 AM, Wesley Cheng wrote:
> During XHCI resume, if there was a host controller error detected the
> routine will attempt to re-initialize the XHCI HC, so that it can return
> back to an operational state. If the XHCI host controller is being
> removed, this sequence would be already handled within the XHCI halt path,
> leading to a duplicate set of reg ops/calls. In addition, since the XHCI
> bus is being removed, the overhead added in restarting the HCD is
> unnecessary. Check for the XHC state before setting the reinit_xhc
> parameter, which is responsible for triggering the restart.
>
> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
> ---
> drivers/usb/host/xhci.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index b81313ffeb76..2017ed3ae4a7 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -1028,7 +1028,8 @@ int xhci_resume(struct xhci_hcd *xhci, pm_message_t msg)
> temp = readl(&xhci->op_regs->status);
>
> /* re-initialize the HC on Restore Error, or Host Controller Error */
> - if (temp & (STS_SRE | STS_HCE)) {
> + if ((temp & (STS_SRE | STS_HCE)) &&
> + !(xhci->xhc_state & XHCI_STATE_REMOVING)) {
Please add one more tab here in order not to blend it with the following lines.
> reinit_xhc = true;
> if (!xhci->broken_suspend)
> xhci_warn(xhci, "xHC error in resume, USBSTS 0x%x, Reinit\n", temp);
MBR, Sergey
next prev parent reply other threads:[~2023-05-23 8:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 1:53 Wesley Cheng
2023-05-23 8:45 ` Sergey Shtylyov [this message]
2023-05-23 16:33 ` Greg KH
2023-05-23 16:42 ` Sergey Shtylyov
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=f34927c3-7f23-3971-9f16-88cb5773f973@omp.ru \
--to=s.shtylyov@omp.ru \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=quic_jackp@quicinc.com \
--cc=quic_wcheng@quicinc.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
all inboxes | Powered by JetHome®