mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fan Ye via B4 Relay <devnull+fy15309206903.gmail.com@kernel.org>
To: Andreas Noever <andreas.noever@gmail.com>,
	 Mika Westerberg <westeri@kernel.org>,
	 Yehezkel Bernat <YehezkelShB@gmail.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Fan Ye <fy15309206903@gmail.com>
Subject: [PATCH 0/2] thunderbolt: fix teardown reporting and the pending-bit wait
Date: Sun, 09 Aug 2026 02:38:11 +0000	[thread overview]
Message-ID: <20260809-b4-tb-teardown-v1-0-c88bbfe5c127@gmail.com> (raw)

Both of these come out of the same investigation on a pair of ASMedia
ASM4242 hosts wired to each other, where every teardown of a host-to-host
DMA tunnel spends the full 500 ms pending-bit timeout on the host
interface adapter's hop and fails anyway.

  1 gives the software connection manager the same contract the ICM one
    already has: return the first error seen while deactivating hops,
    instead of returning 0 unconditionally. Teardown still runs to
    completion either way. Today a caller cannot tell the two connection
    managers apart, and tbnet's "failed to disable DMA paths" warning can
    only ever fire on ICM based hosts.

  2 remembers on the adapter that its pending bit stayed set, and stops
    re-learning that on every subsequent teardown. Cycling the interface
    down and up 200 times across two such hosts produced 213 and 206 of
    those timeouts before, and 1 each after; the run comes out 110
    seconds shorter over its 200 cycles.

Patch 2 is the one I am least sure of. I do not have the USB4 Connection
Manager guide, so I cannot tell whether a protocol adapter's pending bit
is vendor defined the way its IFC, ISE and Path Credits Allocated fields
are - if it is, not waiting on it at all would be the right fix and this
is working around the symptom. Its own notes say what else I could not
show. I would rather send it with that written down than leave it out.

Note what the pair does together on this hardware: 2 leaves the first
failure to be reported and silences the rest, so the signal 1 adds fires
once per adapter here rather than on every teardown.

Two further patches from the same investigation touch
drivers/net/thunderbolt/ and went to netdev separately:
https://lore.kernel.org/netdev/20260809-b4-tbnet-hopid-v1-0-97aaf2aa0fc7@gmail.com/

They are not needed to apply these two, but they are what the runs above
were measured across - the second of them removes a warning splat that
fires throughout any prolonged run of link cycling.

Per-patch notes, including what I am not claiming, are below the cut in
each patch.

---
Fan Ye (2):
      thunderbolt: Report DMA path teardown failures to the caller
      thunderbolt: Stop waiting on a path pending bit that never clears

 drivers/thunderbolt/path.c   | 38 ++++++++++++++++++++++++++++++++------
 drivers/thunderbolt/tb.c     | 35 +++++++++++++++++++++++------------
 drivers/thunderbolt/tb.h     |  5 ++++-
 drivers/thunderbolt/tunnel.c | 19 +++++++++++++++----
 drivers/thunderbolt/tunnel.h |  2 +-
 5 files changed, 75 insertions(+), 24 deletions(-)
---
base-commit: 06cf61899d6498b33e4b7c87d99d5bd471ccc375
change-id: 20260809-b4-tb-teardown-d26c32482c96

Best regards,
--  
Fan Ye <fy15309206903@gmail.com>



             reply	other threads:[~2026-08-09  2:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09  2:38 Fan Ye via B4 Relay [this message]
2026-08-09  2:38 ` [PATCH 1/2] thunderbolt: Report DMA path teardown failures to the caller Fan Ye via B4 Relay
2026-08-09  2:38 ` [PATCH 2/2] thunderbolt: Stop waiting on a path pending bit that never clears Fan Ye via B4 Relay
2026-08-10  4:42   ` Mika Westerberg

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=20260809-b4-tb-teardown-v1-0-c88bbfe5c127@gmail.com \
    --to=devnull+fy15309206903.gmail.com@kernel.org \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=fy15309206903@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=westeri@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®