Linux USB
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: matthew Boyle <mcboyle1865@gmail.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>,
	Niklas Neronin <niklas.neronin@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Michal Pecio <michal.pecio@gmail.com>
Subject: Re: Fwd: [PATCH] usb: xhci: dbc: advance transfer ring dequeue pointer on completion
Date: Thu, 3 Dec 2026 04:52:49 +0100	[thread overview]
Message-ID: <2026120334-overbill-energy-e4c7@gregkh> (raw)
In-Reply-To: <CAD858L9Tq__bcFvEUHSTWyA=GQ8nJGq45L1F6vfwtZEEV4+4tg@mail.gmail.com>

On Wed, Dec 02, 2026 at 11:32:19AM -0500, matthew Boyle wrote:
> Good Morning,
> Commit 7ee645963075 ("usb: xhci: remove legacy 'num_trbs_free'
> tracking") removed ring->num_trbs_free and switched
> xhci_dbc_queue_bulk_tx() to xhci_num_trbs_free(ring), which computes
> free space from ring->enqueue and ring->dequeue.
> 
> However, DbC transfer rings never updated ring->dequeue on transfer
> completion; previously only ring->num_trbs_free was incremented in
> dbc_handle_xfer_event(). As a result, ring->dequeue remains stuck at
> the start of the single-segment ring while ring->enqueue advances.
> After exactly 254 TRBs (254 * 1024 B = 260,096 B on a 256-TRB segment
> with one link TRB and the xhci_num_trbs_free(ring) <= num_trbs guard),
> xhci_num_trbs_free() drops to 1 and every subsequent bulk transfer
> fails permanently with -EBUSY ("failed to queue trbs").
> 
> Add a dbc_inc_deq() helper mirroring xhci_dbc_queue_trb()'s link-TRB
> wraparound and call it in dbc_handle_xfer_event() before giving back
> completed and stale stalled requests (while dbc->lock is still held,
> before completion callbacks can re-queue new TRBs).
> 
> Fixes: 7ee645963075 ("usb: xhci: remove legacy 'num_trbs_free' tracking")
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222348
> Cc: stable@vger.kernel.org
> Signed-off-by: Matthew Boyle <mcboyle1865@gmail.com>
> ---
> (Note: sent via Gmail web; the clean git format-patch file with
> preserved tabs is also attached as
> 0001-usb-xhci-dbc-advance-transfer-ring-dequeue-pointer-o.patch.)
> 
>  drivers/usb/host/xhci-dbgcap.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 


Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
  and can not be applied.  Please read the file,
  Documentation/process/email-clients.rst in order to fix this.

- Your patch was attached, please place it inline so that it can be
  applied directly from the email message itself.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAD858L_rFUTS_63uBFb=HytY+U1DKSVtNTttKqXWSPf0Ba4TRA@mail.gmail.com>
     [not found] ` <CAD858L_iB6zkTXk4czOfen3+PbGc2VjBNHio4y42L0k73vk0Uw@mail.gmail.com>
2026-12-02 16:32   ` Fwd: [PATCH] usb: xhci: dbc: advance transfer ring dequeue pointer on completion matthew Boyle
2026-12-03  3:52     ` Greg Kroah-Hartman [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=2026120334-overbill-energy-e4c7@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=mcboyle1865@gmail.com \
    --cc=michal.pecio@gmail.com \
    --cc=niklas.neronin@linux.intel.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