From: Michal Pecio <michal.pecio@gmail.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Dayu Jiang <jiangdayu@xiaomi.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mathias Nyman <mathias.nyman@intel.com>,
Longfang Liu <liulongfang@huawei.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
yudongbin <yudongbin@xiaomi.com>, guhuinan <guhuinan@xiaomi.com>,
chenyu45 <chenyu45@xiaomi.com>,
mahongwei3 <mahongwei3@xiaomi.com>,
Niklas Neronin <niklas.neronin@linux.intel.com>
Subject: Re: [PATCH] usb: xhci: add xhci_halt() for HCE Handling
Date: Fri, 27 Feb 2026 12:05:30 +0100 [thread overview]
Message-ID: <20260227120530.13395d2f.michal.pecio@gmail.com> (raw)
In-Reply-To: <9113319a-b82c-42c7-ba1a-19113a5edb80@linux.intel.com>
On Fri, 27 Feb 2026 11:43:45 +0200, Mathias Nyman wrote:
> On 2/26/26 20:17, Thinh Nguyen wrote:
> > The controller is halted if there's an error like HCE. It's odd to
> > try to "halt" it again. Not sure how this will impact for other
> > controllers.
> The host is messed up at this point, and we are not recovering it.
> I don't think there is any harm in a manual halt at this stage.
Specifically, calling xhci_halt() clears the USBCMD.Run flag and
all USBCMD interrupt enable flags. Seems relatively harmless. Clearing
USBCMD.Run would be the first step of resetting the HC anyway, so the
HW should expect it to happen afetr reporting HCE.
In case of HSE the HW should clear the Run bit by itself (4.10.2.6),
but no such requirement seems to exist for HCE (4.24.1).
The call also sets XHCI_STATE_HALTED and CMD_RING_STATE_STOPPED flags,
which helps with recovering stuck URBs. When class drivers time out
and unlink them, the URBs are given back instantly without drama.
I just tested the HSE case where xhci_halt() is already being called
and it worked for me. If I remove xhci_halt() then the driver tries to
issue Stop Endpoint commands, times out and calls hc_died(). Messy.
I suspect that the same happened with HCE before this patch.
Regards,
Michal
next prev parent reply other threads:[~2026-02-27 11:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 11:04 [PATCH] usb: xhci: add xhci_halt() for HCE Handling jiangdayu
2026-01-27 11:22 ` Greg Kroah-Hartman
2026-01-28 8:48 ` Dayu Jiang
2026-01-28 8:56 ` Greg Kroah-Hartman
2026-02-26 9:27 ` Dayu Jiang
2026-02-26 16:44 ` Mathias Nyman
2026-02-26 18:17 ` Thinh Nguyen
2026-02-27 7:26 ` Dayu Jiang
2026-02-28 0:22 ` Thinh Nguyen
2026-02-27 9:43 ` Mathias Nyman
2026-02-27 11:05 ` Michal Pecio [this message]
2026-02-28 0:06 ` Thinh Nguyen
2026-02-28 0:18 ` Thinh Nguyen
2026-02-27 7:33 ` Dayu Jiang
2026-01-27 12:25 ` Mathias Nyman
2026-01-28 8:53 ` Dayu Jiang
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=20260227120530.13395d2f.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=chenyu45@xiaomi.com \
--cc=gregkh@linuxfoundation.org \
--cc=guhuinan@xiaomi.com \
--cc=jiangdayu@xiaomi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=mahongwei3@xiaomi.com \
--cc=mathias.nyman@intel.com \
--cc=mathias.nyman@linux.intel.com \
--cc=niklas.neronin@linux.intel.com \
--cc=yudongbin@xiaomi.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