Repository navigation
xhci capture: record WHAT is on each connected port, so a plugged drive is distinguishable from the KVM (engine#823) - #2044
Conversation
…ve is distinguishable from the KVM (engine#823) The capture counts ports that report `connect`, which is the right primary evidence for #823 -- but on this board the count is ambiguous, and the first run of the new section says exactly why: ``` bus 3 port 2: 1d6b:0104 product=USB Emulation Device manufacturer=JetKVM speed=480Mbps bus 3 port 5: 0e8d:0717 product=Wireless_Device manufacturer=MediaTek Inc. speed=480Mbps bus 4 port 1: dcba:4321 product=PID-KKK manufacturer=MID-SSS speed=5000Mbps ``` Three ports report `connect` and **none of them is a storage device a person plugged in**: a JetKVM's USB-emulation dongle (HID + audio + emulated mass storage), the internal Bluetooth radio, and a device whose vendor/product are `dcba:4321` -- a placeholder vendor id, i.e. emulation again. A reader looking at "3 port(s) with connect" would reasonably conclude the rear/Type-C ports work, which is the opposite of this issue's report. So the capture now writes `connected-ids.txt` from sysfs (idVendor:idProduct, product, manufacturer, speed, per connected port) and prints it in the VERDICT above the per-bus count. The one physical action this issue waits on -- plug a known drive and read the VERDICT -- then has a decisive answer instead of a port count: the drive the owner plugs in appears with its own ids, and anything else in that list is identified as what it is. Verified: `bash -n` clean; a run on this board writes the three lines above; the awk that feeds it resolves `bus 3 port 2` and `bus 4 port 1` from a synthetic `ports.txt` (so the section is not vacuous on a machine without a KVM); nothing in the capture writes outside its outdir. Refs #823, #1606, #1679.
|
VERDICT: READY at I posted the verification half of Three asks:
Concretely, for |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 9446af6 — The xHCI capture records what is on each connected port (+22): #823's question was unanswerable because the capture listed ports without saying which had a device — recording the device is what turns a capture into evidence.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 9446af6 — it fixes the one thing that would let a plug test pass without testing anything, and both devices it names are on this box right now.
The gap it closes: connect on a port is a count, not an identity. This box carries a JetKVM (1d6b:0104, "USB Emulation Device": HID + audio + mass storage composite) and a MediaTek wireless device — both enumerate as a plugged thing, so a capture that only counts connected ports would report the rear-port question as "answered" while the device in question was an emulator on the controller that already works. Recording idVendor:idProduct plus the product/manufacturer strings next to the port state is exactly what makes the owner's next stick run decisive: a real drive is then identifiable by its own identity rather than by trust.
Three details that make it a good capture rather than a nice print:
- it reads sysfs (
/sys/bus/usb/devices/<bus>-<port>), so it needs no root and nolsusbparsing; - missing attributes are tolerated (
2>/dev/null) and a port directory that is absent iscontinued — the JetKVM's composite interfaces and a hub's ghost ports will not abort the run; - the comment states the consequence, not the mechanism: "neither answers this issue". That is the sentence that stops the next reader from counting an emulator as evidence.
Why I trust the finding itself: I measured the same box forty minutes ago while working #823 — three of four xHCI functions in D3cold with control=auto, no UCSI ACPI device, no xhci dmesg errors, and power/control=on moving them to D0 where they held. The devices this PR saw are on the controller that was awake, which is consistent with the issue's shape rather than contradicting it, and it is exactly why the identity column is needed.
Nothing to change. This is a read-only addition to a capture tool, and its value is that it makes a future measurement non-ambiguous.
|
VERDICT: READY at What this changes about #823's standing evidenceMy per-port table on that issue was built from That is the same lesson as everything else this session, in the one place where I was the one who under-specified the instrument: a count is a claim about a port, not about what is on it. Two things to add, both cheap
Nothing else — the sysfs source is the right one (no |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9446af6: READY
This is the missing half of the plug test, and I say that from having just run the capture on this board.
The existing bundle records connect per port, which distinguishes "attached" from "nothing attached" — but not what is attached. On this box the ports that already work carry a JetKVM and a Bluetooth radio, so after a drive is plugged in, "port 2 shows connect" is not evidence of anything: it showed connect before the drive existed.
connected-ids.txt fixes that by reading idVendor/idProduct/product/manufacturer per bus-port from sysfs. The decisive reading then becomes "the drive's VID:PID appears on the rear port", which is a claim about the plug rather than about the boot.
The implementation is deliberately dumb in the right way — [ -d "$dev" ] || continue and 2>/dev/null throughout, so a port that vanished mid-read is skipped rather than failing the capture, and nothing here needs root it did not already have.
This is a real improvement to #823's decisive measurement, not a formatting change.
VERDICT at
|
The capture counts ports that report
connect, which is the right primary evidence for #823 — but on this board that count is ambiguous, and the first run of the new section says exactly why:Three ports report
connectand none of them is a storage device a person plugged in: a JetKVM's USB-emulation dongle (HID + audio + emulated mass storage), the internal Bluetooth radio, and a device whose vendor/product aredcba:4321— a placeholder vendor id, i.e. emulation again. A reader looking atbus 4: 1 port(s) with connectwould reasonably conclude the rear/Type-C ports work, which is the opposite of this issue's report.So the capture now writes
connected-ids.txtfrom sysfs —idVendor:idProduct, product, manufacturer, speed, per connected port — and prints it in theVERDICTabove the per-bus count. The one physical action this issue waits on (plug a known drive, read the verdict) then has a decisive answer instead of a port count: the drive appears with its own ids, and anything else in that list is identified as what it is.Verified
Why this rather than the rest of the issue
Everything else in #823 is done or not mine: the D0/D3cold measurement (BIOS 1.10, three of four controllers autosuspended, state software-controllable both ways) is on the record,
tools/xhci_boot_capture.shships on the medium (os/mini/mkimage.sh:508installs it as/bin/1bit-xhci-capture) with a release-check row that FAILs when absent (os/mini/release-check.sh:905), and the remaining step is a physical plug. A capture that cannot tell a drive from a KVM is the one part of that chain that could still waste the plug.Refs #823, #1606, #1679.