Linux USB
 help / color / mirror / Atom feed
From: "Neronin, Niklas" <niklas.neronin@linux.intel.com>
To: Oliver Neukum <oneukum@suse.com>, mathias.nyman@linux.intel.com
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 0/7] usb: xhci: command queueing cleanups
Date: Thu, 3 Dec 2026 14:03:10 +0200	[thread overview]
Message-ID: <9cfb3c17-1ab1-4950-b405-b6674e40a702@linux.intel.com> (raw)
In-Reply-To: <8a699e57-f1ce-4de3-9813-66f4848231f3@suse.com>



On 02/12/2026 11.45, Oliver Neukum wrote:
> 
> 
> On 01.12.26 20:41, Niklas Neronin wrote:
>> This series cleans up xHCI command construction and queueing, removes
>> some command-specific special cases, and simplifies the Configure
>> Endpoint / Evaluate Context paths.
>>
>> The final patch removes the command ring reservation for so-called
>> "must succeed" commands. There does not appear to be a documented
>> requirement for reserving command ring space for these commands, and a
>> full command ring already prevents further command progress. Removing
>> the reservation also eliminates the stream allocation limit that
>> depended on it.
> UAS uses this in the block error handling path. What happens if
> we reset a device with streams still active?
> 
It is handled, the reset frees them.

uas_free_streams() ignores the return value. After a failed free,
'ep->streams' stays set and the xhci endpoint keeps EP_HAS_STREAMS.
Every path that follows tears the endpoints down anyway:

Reset:
 usb_reset_and_verify_device()
  hub_port_reset()
   xhci_discover_or_reset_device()
    xhci_free_stream_info()

Alt setting change:
 usb_set_interface()
  usb_hcd_alloc_bandwidth()
   xhci_check_bandwidth()
    xhci_check_bw_drop_ep_streams()
     xhci_free_stream_info()

Unbind:
 usb_unbind_interface()
  usb_free_streams()
  usb_set_interface()

Disconnect:
 usb_disconnect()
  xhci_free_dev()
   xhci_free_virt_device()
    xhci_free_stream_info()

xhci prints a warning in the reset and alt setting cases,
but the streams are freed.

As far as I can tell, the only way the streams survive until
disconnect is if the command ring is stuck and no commands are
completed, reservation would not change that.

Thanks,
Niklas

      reply	other threads:[~2026-12-03 12:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 19:41 [PATCH 0/7] usb: xhci: command queueing cleanups Niklas Neronin
2026-12-01 19:41 ` [PATCH 1/7] usb: xhci: simplify xhci_get_input_control_ctx() Niklas Neronin
2026-12-01 19:47   ` sashiko-bot
2026-12-01 19:41 ` [PATCH 2/7] usb: xhci: add xhci_queue_set_deq() helper Niklas Neronin
2026-12-01 19:41 ` [PATCH 3/7] usb: xhci: simplify prepare_ring() Niklas Neronin
2026-12-01 19:41 ` [PATCH 4/7] usb: xhci: split Configure Endpoint and Evaluate Context handling Niklas Neronin
2026-12-01 19:41 ` [PATCH 5/7] usb: xhci: clear EP_GETTING_NO_STREAMS when freeing streams fails Niklas Neronin
2026-12-01 19:52   ` sashiko-bot
2026-12-01 19:41 ` [PATCH 6/7] usb: xhci: remove pre-allocated free streams command Niklas Neronin
2026-12-01 19:41 ` [PATCH 7/7] usb: xhci: remove command ring TRB reservation Niklas Neronin
2026-12-01 19:52 ` [PATCH 0/7] usb: xhci: command queueing cleanups sashiko-bot
2026-12-02  9:45 ` Oliver Neukum
2026-12-03 12:03   ` Neronin, Niklas [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=9cfb3c17-1ab1-4950-b405-b6674e40a702@linux.intel.com \
    --to=niklas.neronin@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=oneukum@suse.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