summaryrefslogtreecommitdiff
path: root/CLAUDE.md
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-08-14 01:08:50 +0700
committerhathach <[email protected]>2026-08-18 12:19:09 +0700
commitf822f69a9871b2115c5213889d70411da66ca1b1 (patch)
treee8d1ddba4dbed71112af7f216aa2e677321a8c1c /CLAUDE.md
parent3963a1b70a572132aced1c1a0033e1c8249a0c7e (diff)
skills, docs: rewrite USB recovery from the live incidents
Two things the rig taught us that the old guidance got wrong. A usbfs ioctl wedged in D state cannot be freed on a running kernel. It holds the device lock, so usb_disconnect() blocks behind it; reboot(2) walks device_shutdown() and takes the same lock, so every userspace reboot stalls too. Only sysrq b (emergency_restart, which skips device_shutdown) or hypervisor action clears it -- all cited to the kernel source. The recovery ladder is generic across rigs now (ci.lan, hifiphile, a bench PC) and ends at hypervisor escalation only where host access exists. Two claims are corrected outright: JLinkExe is NOT convoy-safe, and a park-flash cannot free a device-lock owner. The hil skill's banner list is what an operator agent matches a report against, so it enumerates the banners that actually exist, including the D-state note -- which is explicitly NOT a wedge, since a healthy in-flight testusb is uninterruptible for most of every case and a concurrent CI battery would otherwise turn a clean run red.
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index fd4b9b8e0..7a493e5db 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -118,6 +118,14 @@ Cutting a release — version bump, regenerated files, the per-release changelog
## References
- MCU reference manuals, datasheets, schematics: before answering register/bitfield/pinout/errata/timing questions from memory or the web — or changing a specific dcd/hcd driver — use the `read-doc` skill (`.claude/skills/read-doc/SKILL.md`) to cross-check against docs in `$HOME/Documents/calibre-library`; tell the user if the needed document is missing (skill no-ops if the library is absent).
+- Linux kernel behaviour (usbfs, usbtest, sysfs attributes, device locks, D state): never
+ infer it from symptoms — read the source for the *running* version. It refutes as often
+ as it confirms: it has killed two plausible dcd theories and corrected a recovery skill's
+ own attribute list.
+ ```bash
+ V=$(uname -r | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+') # on the rig: ssh ci.lan uname -r
+ curl -fsSL "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/usb/core/sysfs.c?h=v$V"
+ ```
- Supported MCUs/boards: `hw/bsp/` and `docs/reference/boards.rst`.
- USB classes: `src/class/{cdc,hid,msc,audio,…}/` — each has `*_device.c` and `*_host.c`.
- Key files: `src/tusb.h`, `src/tusb_config.h`, `tools/get_deps.py`, `tools/build.py`, `test/unit-test/project.yml`.