Skip to content

os/v3/puppy: boot with scsi_mod.scan=sync, so a stalled USB storage device does not hold the boot ~40 s - #3304

Merged
bong-water-water-bong merged 1 commit into
mainfrom
os/boot-no-wait-on-usb-storage
Nov 22, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
os/boot-no-wait-on-usb-storage

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Fixes #3286.

Cause, traced on the AI MAX+ 395 (timestamps written to /dev/kmsg from rc.sysinit and rc.services; JetKVM attached, its virtual media not answering):

step before after
udevadm settle -t 20 5.0 → 25.3 s (cap), ends on the device's first reset 5.0 → 8.4 s
modprobe ec_su_axb35 (ADDLIST) 25.3 → 45.4 s, ends on the second reset 8.5 → 8.5 s
boot snapshot (BOOT uptime), installed 45.6 s 8.8 s
boot snapshot, live stick 51.6 s (v2026.47) 23.5 s (includes copying the SFS set to RAM)

The EC driver itself loaded in 0.3 s; with it taken out of ADDLIST the next module loads (battery, ac, thermal, tls) took the same 20 s. That is the async-scan wait: the stuck device's SCSI scan sits in the kernel's global async queue, and every module load waits for that queue before modprobe returns (do_init_module → async_synchronize_full), including udev's own loads, which is why settle ran to its cap.

Change. scsi_mod.scan=sync on every boot line mkimage.sh writes: usb-storage then scans each device inside its own worker, and nothing else waits on it. mkimage refuses a grub.cfg without it (the same guard the YMTC quirk has); 1bit-install copies the stick's boot lines, so the installed disk carries it.

Measured with only this parameter changed (rc.sysinit and every init script stock): installed boot 8.8 s, EC driver at 8.8 s and the fans controlled, lemond up; the live stick still boots itself (PUPSFS=sda2). Without a stalled USB storage device nothing changes (each device is still scanned, just not in the global queue).

🤖 Generated with Claude Code

…evice does not hold the boot ~40 s (engine#3286)

A USB mass-storage device that does not answer (a JetKVM's virtual media on the AI MAX+ 395) made every boot of
an installed system wait about 40 s. Traced on the board with timestamps written to /dev/kmsg: rc.sysinit's
'udevadm settle -t 20' ran 5.0 -> 25.3 s (its cap) and 'modprobe ec_su_axb35' (ADDLIST) ran 25.3 -> 45.4 s,
both ending on the device's resets. The EC driver itself loaded in 0.3 s; with the module moved out of ADDLIST
the next modprobes (battery, ac, thermal, tls) took the same wait. With async SCSI scanning the stuck scan sits
in the global async queue, and module loading waits for that queue (do_init_module -> async_synchronize_full),
which also stalls udev's own module loads and so settle.

scsi_mod.scan=sync scans each usb-storage device in its own worker instead. Measured, with nothing else changed:
installed boot 45.6 -> 8.8 s (settle ends at 8.4 s, the EC driver at 8.8 s, fans controlled, lemond up), live
stick boot 51.6 -> 23.5 s (booting itself from sda2). mkimage now refuses a grub.cfg without it; 1bit-install
copies the stick's boot lines, so an installed disk carries it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3286 - Partially compliant

Compliant requirements:

  • Fix the issue where boot waits about 42 s on an unresponsive USB mass-storage device it does not boot from (JetKVM virtual media)
  • Ensure that an installed system boots from its own disk and does not wait on removable USB storage it does not use
  • Ensure that a live boot waits only for the medium it boots from
  • Measure the fix to show that boot times are reduced from ~45s to ~8-9s for installed systems and ~51s to ~23s for live sticks

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing Boot Parameter Validation

The change introduces a new boot parameter scsi_mod.scan=sync to address USB storage device stalls, but the validation check only ensures its presence in the grub.cfg. It does not validate that the parameter is correctly formatted or properly handled by the kernel, which could lead to silent failures or unexpected behavior if the parameter is malformed or unsupported.

grep -q 'scsi_mod.scan=sync' "$esp/EFI/BOOT/grub.cfg" || {
    echo "$prog: REFUSED: no scsi_mod.scan=sync in grub.cfg (a stalled USB storage device then holds the boot ~40 s, engine#3286)" >&2; exit 1; }

@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) November 22, 2026 14:35
@bong-water-water-bong
bong-water-water-bong merged commit ebf9277 into main Nov 22, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the os/boot-no-wait-on-usb-storage branch November 22, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

os: boot waits about 42 s on an unresponsive USB mass-storage device it does not boot from (JetKVM virtual media)

1 participant