diff options
| author | Koichiro Den <den@valinux.co.jp> | 2026-10-15 23:27:16 +0900 |
|---|---|---|
| committer | Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> | 2026-10-15 20:50:59 +0530 |
| commit | f9eabc48327fae33cf0a02a8f312c24505dc413b (patch) | |
| tree | 08d80f6a94f7c1225178ec93d45909e2da2bb195 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 5cdbd6d3a3a147fa9975e35f2602cbec9a72a932 (diff) | |
PCI: endpoint: pci-epf-vntb: Track link state from both sides
The control-region link status is currently updated only by
COMMAND_LINK_UP and COMMAND_LINK_DOWN from the HOST. The virtual
NTB link callbacks are empty. Consequently, the HOST can see the link as
up before the VHOST has enabled it, and ntb_link_disable() on the VHOST
leaves LINK_STATUS_UP set without notifying either NTB client.
ntb_netdev can hide this device-level state bug because ntb_transport uses
a separate per-QP LINK_DOWN_FLAG message. Use ntb_tool to observe the
device link state directly:
After bringing both sides up, start one waiter on each side:
HOST# echo N > /sys/kernel/debug/ntb_tool/<H-device>/peer0/link_event
VHOST# echo N > /sys/kernel/debug/ntb_tool/<V-device>/peer0/link_event
While both waiters are blocked, disable the link on the VHOST:
VHOST# echo N > /sys/kernel/debug/ntb_tool/<V-device>/link
Without this patch, the link-disable command succeeds, but peer0/link
remains Y on both sides and neither waiter returns.
Track HOST and VHOST enablement separately and report the effective link
as up only when both sides have enabled it, as pci-epf-ntb does for its
two physical hosts. Both NTB clients observe this effective state, so
notify both sides only when it changes, including the side whose request
completes the transition. Serialize the two paths because HOST commands
run from delayed work while the VHOST callbacks may run concurrently.
With this patch, peer0/link changes to N on both sides and both waiters
return.
Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP")
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20261014071448.2473208-1-den@valinux.co.jp/
Link: https://patch.msgid.link/20261015142716.3452900-1-den@valinux.co.jp
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
