mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Pecio <michal.pecio@gmail.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: xhci: Assume that endpoints halt as specified
Date: Fri, 14 Nov 2025 13:32:31 +0100	[thread overview]
Message-ID: <20251114133231.3f187b94.michal.pecio@gmail.com> (raw)
In-Reply-To: <a5119a19-8660-4f0c-bedd-0a9a0301ef85@linux.intel.com>

On Tue, 11 Nov 2025 14:13:05 +0200, Mathias Nyman wrote:
> Makes sense, I guess we can only trust hardware to update the state in
> the endpoint context on specific command completions, not transfer events.

Technically, 4.8.3 requires HW to update to Running before writing any
transfer event to the event ring. It says nothing about Halted, though
4.10.2.1 appears to imply similar ordering in case of Stall Error.

But then 4.8.3 explicitly says

  The update of EP State may also be delayed relative to a Doorbell
  ring or error condition (e.g. TRB Error, STALL, or USB Transaction
  Error) that causes an EP State change not generated by a command. 

so the spec is a self-contradictory mess as usual. My hope with this
patch is that maybe other SW vendors follow 4.8.3 recommendation and
HW gets tested to work under such conditions.

The Promontory problem is not even a delay, it's a complete failure.
I added a loop which waits for GET_EP_CTX_STATE(READ_ONCE(ep_ctx)) to
become HALTED and it was still RUNNING after 1.5 second.

I guess it's some stinking internal race condition again, maybe it
halts too quickly after restart and then a delayed update to Running
overwrites the Halted state update. Or something that only happens
if we restart too quickly after previous error. IIRC, it was never
happening the first time the endpoint halts after loss of connection,
only randomly later after some resets.

Regards,
Michal

      reply	other threads:[~2025-11-14 12:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 10:13 Michal Pecio
2025-11-11 12:13 ` Mathias Nyman
2025-11-14 12:32   ` Michal Pecio [this message]

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=20251114133231.3f187b94.michal.pecio@gmail.com \
    --to=michal.pecio@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.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®