Re: [RFC PATCH 0/3] NTB: ntb_transport: Lost link-up after a late link cleanup
From: Oguzhan KAYNAK
Date: Sun Dec 06 2026 - 04:37:01 EST
Sashiko's reviews of this series are right, the one on 3/3 in
particular: skipping the scratchpad clear before the first link-up keeps
values left by an earlier user of the device, e.g. ntb_perf, and a peer
with MSI enabled can then take them as an MSI offset. Please don't test
3/3 as it is.
For a v2 I would:
- 1/3: take the link state check and the link_down_pending update in
the event callback under a spinlock that link_work also takes, so
link_work cannot start a setup between the two;
- 2/3: clear our VERSION before retrying, so the retry does not read
the sizes while the peer is still writing them (a size of 4 GiB or
more cut by our own clear can still read wrong);
- 3/3: replace it: clear the scratchpads in probe before
ntb_set_ctx(), and at probe schedule link_work only if the link is
up, instead of queueing a cleanup for the link-down seen at probe.
That cleanup came with e26a5843f7f5 ("NTB: Split ntb_hw_intel and
ntb_transport drivers"), so the Fixes: tag should name that commit.
The case after a real bounce that the review of 2/3 describes stays
open; closing it seems to need the handshake change I asked about in
the cover letter. I will wait for your view on that before sending v2.