Ticket #2146 (closed defect: fixed)
Freerunner will not charge when booted from USB (git andy-tracking)
| Reported by: | nicolas.dufresne | Owned by: | openmoko-devel |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | unknown | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | no | PatchReviewResult: | |
| Reproducible: |
Description
This bug might be linked to #1158 . The problem is that the Freerunner (at least GTA02v5) will not start charging after being booted with the USB cable plugged in. I'm reporting this issue running andy-tracking kernel, but I've seen it with stable kernel too.
Step to reproduce:
- Plug the USB charger cable in the phone
- The phone should boot by itself, if not press the power button
- When booted, run this command
cat /sys/class/power_supply/battery/status
cat /sys/class/power_supply/battery/online
Expected:
The status should display charging, and the online should return 1. Currently it's Discharging and offline.
Attachments
Change History
comment:2 Changed 4 years ago by andy
This should be fixed now on andy-tracking and also the andy-tracking binary kernel on http://people.openmoko.org/andy now.
comment:3 Changed 4 years ago by nicolas.dufresne
I've tested it with kernel from your site and my own build. Unfortunately it does not work for me (I'll attach the dmesg right after). Do you think it's because I'm using U-Boot instead of QI ?
Changed 4 years ago by nicolas.dufresne
- Attachment battery-discharging.dmesg added
Battery discharging after boot
comment:4 Changed 4 years ago by nicolas.dufresne
I've looked closer and with both binaries (mine and Andy) the printk does not match the code. I'll clean build and try again.
comment:5 follow-up: ↓ 6 Changed 4 years ago by nicolas.dufresne
Ok, I found what I did wrong in my first test. I've confirmed that now the Freerunner is charging, but there is still a small issue, status still display Discharging and online 0. They seem not to be updated. Note that this fixed the health field (which was displaying Unknown before).
comment:6 in reply to: ↑ 5 Changed 4 years ago by andy
- Status changed from new to closed
- Resolution set to fixed
Replying to nicolas.dufresne:
Ok, I found what I did wrong in my first test. I've confirmed that now the Freerunner is charging, but there is still a small issue, status still display Discharging and online 0. They seem not to be updated. Note that this fixed the health field (which was displaying Unknown before).
Great.
The display status issue is probably due to /sys breakage on new kernels.
I noticed that somewhere along the line (I thing Sean McNeil?'s android stuff) we are now completely stood off from real HDQ access in the power_supply stuff, instead it is polling at 30s intervals or so and everything seems to be using the cached copies, that can also impact display status maybe.

Thanks for this report... this is to do with some race with gadget enumeration and PMU... unfortunately the obvious thing to make USB gadget device a child of PMU does not work because of some other race requiring USB gadget to be registered really early. The basic deal is that it does not "see" the enumeration and the fact that 500mA is OK to take now until you remove and reinsert the USB cable, that's despite the gadget is active OK.