mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladyslav Tymoshchuk <tvlad744@gmail.com>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Cc: Vladyslav Tymoshchuk <tvlad744@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kuen-Han Tsai <khtsai@google.com>,
	Sonali Pradhan <sonalipradhan@google.com>,
	Kees Cook <kees@kernel.org>, Felipe Balbi <balbi@ti.com>,
	Jim Baxter <jim_baxter@mentor.com>,
	Francesco Lavra <flavra@baylibre.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty
Date: Mon, 26 Oct 2026 14:31:59 +0200	[thread overview]
Message-ID: <20261026123159.53234-1-tvlad744@gmail.com> (raw)
In-Reply-To: <20260817192638.437798-1-cosmin-gabriel.tanislav.xa@renesas.com>

On Mon, Aug 17, 2026 at 10:26:38PM +0300, Cosmin Tanislav wrote:
> Under sustained TX saturation the request freelist is empty most of the
> time. Since the timer is never restarted, small packets keep getting
> accumulated into the NTB, until either TX_MAX_NUM_DPE packets are stored
> or NTB_DEFAULT_IN_SIZE is reached, which is an unknown amount of time.

I hit this on a OnePlus Pad 3 (SM8750, dwc3, high speed to a Windows 11
host, qmult 5). Pulling 20 MB from the gadget over ssh stalled for 40 s
or more in 2 of 24 runs, and most of the other runs took ~6 s instead of
~1 s. During a stall the sender kept retransmitting, the qdisc backlog
was empty, tx_packets did not move and the ep1in TRB ring had nothing
owned by the controller, so the frames were sitting in the pending NTB.

With this patch on top of v7.3-rc5: 24 of 24 runs at ~0.9 s, no stalls.
Host to gadget is unchanged.

Francesco Lavra posted the same fix in July [1], but without the
hrtimer_forward_now(), so the timer would fire again right away.

[1] https://lore.kernel.org/linux-usb/20260727165441.1969927-1-flavra@baylibre.com/

Tested-by: Vladyslav Tymoshchuk <tvlad744@gmail.com>

      reply	other threads:[~2026-10-26 12:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 19:26 Cosmin Tanislav
2026-10-26 12:31 ` Vladyslav Tymoshchuk [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=20261026123159.53234-1-tvlad744@gmail.com \
    --to=tvlad744@gmail.com \
    --cc=balbi@ti.com \
    --cc=cosmin-gabriel.tanislav.xa@renesas.com \
    --cc=flavra@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jim_baxter@mentor.com \
    --cc=kees@kernel.org \
    --cc=khtsai@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sonalipradhan@google.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

all inboxes | Powered by JetHome®