Repository navigation
Increase USB hub debounce timeout to fix USB SSD boot on RPi 3 - #4940
Conversation
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks ๐ |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. ๐ โน๏ธ Recent review infoโ๏ธ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: ๐ Files selected for processing (2)
๐ง Files skipped from review as they are similar to previous changes (1)
๐ WalkthroughWalkthroughThe Raspberry Pi 3 64-bit U-Boot configuration sets the USB hub debounce timeout to 2500 ms. The defconfig includes the board-specific U-Boot configuration fragment. ChangesRaspberry Pi 3 USB hub configuration
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: Poem
๐ฅ Pre-merge checks | โ 5โ Passed checks (5 passed)
โจ Finishing Touches๐งช Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a483cca to
8349e48
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
๐ค Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@buildroot-external/board/raspberrypi/rpi3-64/uboot.config`:
- Line 1: Update CONFIG_PREBOOT in the rpi3-64 U-Boot configuration to retain
the existing usb start command while also setting usb_pgood_delay to 1000,
ensuring USB initialization occurs before autoboot.
๐ช Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
โน๏ธ Review info
โ๏ธ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7f2532c7-7883-4196-a35e-bd34c5e2ab31
๐ Files selected for processing (2)
buildroot-external/board/raspberrypi/rpi3-64/uboot.configbuildroot-external/configs/rpi3_64_defconfig
๐ง Files skipped from review as they are similar to previous changes (1)
- buildroot-external/configs/rpi3_64_defconfig
8349e48 to
a7f035f
Compare
sairon
left a comment
There was a problem hiding this comment.
Thanks for picking this up. There are couple of issues with this solution though. First of all, it delays boot of all Pi 3's, no matter if they use USB as the main boot device or not (which is another issue - direct USB boot was always rather discouraged, using SD card for OS and USB drive as data disk is the better way - anyway, it was never completely unsupported). But on the other hand, Pi 3 is already rather underspec'd for today's Home Assistant deployments, and that one extra second will be lost in the noise, so... I think I can live with that.
The bigger issue for me is from the maintainability perspective, as this change overrides the default CONFIG_PREBOOT defined either upstream or potentially in upper configs. This way it could shadow another default should it ever change. Currently it's a default string from the Kconfig, which is most likely to be changed without us noticing when updating U-Boot.
On the bright side, I think there's more appropriate way to delay the initialization instead, and that's by increasing CONFIG_USB_HUB_DEBOUNCE_TIMEOUT. From its Kconfig description it sounds it's exactly what you need and adjusting a config option is IMHO better than extending preboot environment. Would you be able to build and test if increasing that value (e.g. to 2000 from the default 1000) helps in your case?
a7f035f to
351b328
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Thanks, that's a cleaner fit and I agree on the maintainability concern. Overriding I rebuilt with the stock preboot untouched and only
Pushed as |
On Raspberry Pi 3, U-Boot runs
usb startearly in boot to find the bootdevice. Many USB-SATA/NVMe bridges haven't finished enumerating within the
default USB hub debounce window, so U-Boot reports "0 storage devices found"
and fails to boot from a USB SSD. This happens intermittently or on every boot
depending on the adapter.
CONFIG_USB_HUB_DEBOUNCE_TIMEOUTis the knob for exactly this: its own Kconfighelp notes that "some usb device needs around 1.5s to be initialized and a 2s
value should solve detection issue on problematic USB keys." Raising it gives
slow bridges time to present the drive. This is preferred over overriding
CONFIG_PREBOOT, which would shadow the default preboot string and couldsilently mask a future upstream change to it.
Scoped to
rpi3-64via a per-board fragment, matching the existingrpi4-64/uboot.config, so Pi 4/5 images are unaffected. On my Pi 3B with aUSB-SATA bridge and SSD, stock fails with "0 storage devices"; 2000 ms was
still intermittent (roughly two boots in three), while 2500 ms boots reliably
across repeated cold starts.
The manual
setenv usb_pgood_delay ...; usb resetworkaround from #1712 doesn'tpersist, because
CONFIG_ENV_IS_NOWHERE=ymeanssaveenvis unavailable, and ahand-patched
u-boot.binis overwritten by OS updates. So this needs to ship inthe image.
Addresses the USB SSD boot detection reported in #1712 and #2876.
Summary by CodeRabbit