-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RBPi3B+ USB VBUS reset during initialization #3058
Comments
Provide information I know.
CH1 is vbus. CH2 is 3.3v These results show that the vbus drop does not involve the kernel.
I guess this code doesn't exist in the kernel. |
The bootloader definitely plays some role with this but what I discovered is that the VBUS resets 0.3 seconds after the kernel was loaded. I recorded a video showing the display and a LED powered from the VBUS to measure the actual timing referenced to kernel debug message timestamps. I "solved" the main issue by adding a sleep in the dwc_otg_driver to make the reset longer which allows my SSD drive to start again properly. The best solution is to prevent powering off because it may have other side effects on the SSD drive. I guess that the power glitch may be a reason for some similar reports that some USB drives do not boot without kernel installed on SD-card. |
I'm glad you found a workaround.
I think so, too. I have a few questions.
Do you have evidence that vbus was reset after the kernel was loaded? How did you know the vbus kernel timestamps when the LED powered from the VBUS was turned on / off? |
Thanks for your infomation. I discovered details of vbus drop timing. Additinal infomation
I think this is not a raspberrypi/linux issue, this is raspberrypi/firmware issue. |
This explains why I didn't find the cause from the device driver code. |
@P33M arm requests |
@ghollingworth added the block unpower/repower when MSD boot went in - the disconnect (and thus Vbus drop) is necessary to get the bus into a state that Linux recognises (apparently a USB reset doesn't work). The cycle time for the controller power cycle is 2ms - increasing it would likely fix the issue at the cost of slowing down boot, but removing the cycle would break MSD boot. The cycle delay should probably be a config.txt parameter that can be tuned. |
@popcornmix , @P33M thanks for information. @ghollingworth Please give the opinion of @ghollingworth and @arisoft-fi . |
Yes a config.txt parameter would work to make it longer... |
The bootloader/firmware uses the USB for loading start*.elf and kernelX.img into RAM. (Does this reset also affect network boot?) |
Is it possible this issue also affects the Pi Zero? I'm seeing some odd behaviour with Realtek 8152B ethernet adapters failing to enumerate with "device descriptor read/64, error -110" after a cold boot. UPDATE: Never mind, I didn't realise this only affects network/USB boot. Plus, the Pi Zero's USB host VBUS seems permanently connected to the upstream VBUS. So, unrelated issue. |
During the Kernel initialization, USB power is dropped off and back on causing some devices not to reset properly during the boot/reboot. For example some SSD drives may fail totally and HDD drives emits a noticeable power failure reset sound just before mounting the root.
Steps required to reproduce the issue
Install rpi-4.19.y kernel to USB drive, no SD-card
Add an indicator for VBUS power. For example, LED light powered from a USB port.
Expected behaviour
If the VBUS is already powered by the bootloader it should be left on by the kernel.
Or the power cycling should be done properly. For example, waiting a full second before applying the power back on.
Actual behaviour
During the boot process the bootloader apply VBUS power on and about 0.3 seconds after the kernel starts, the VBUS is powered off for some milliseconds before it put back on causing some devices to fail during boot/reboot.
System
Raspberry Pi 3B+
Raspberry Pi reference 2019-04-08
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, e910bf55ac92e27c6e77043e8995bcb5e0a2d742, stage2
vcgencmd version
Mar 27 2019 15:46:32
Copyright (c) 2012 Broadcom
version 2e98b31d18547962e564bdf88e57b3df7085c29b (clean) (release) (start_cd)
4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux
Additional context
The power is reset while executing dwc_otg_driver_init
linux/drivers/usb/host/dwc_otg/dwc_otg_driver.c
Line 1108: retval = platform_driver_register(&dwc_otg_driver);
Despite using several hours for tracing this down I could't find the actual line where the power is cut off. Maybe it is somewhere inside the platform level code.
Adding one second sleep after this line helps for keeping the power off longer.
The text was updated successfully, but these errors were encountered: