PowerSaverKernel - Usb battery drain bugs solved [UPDATED 2011/08/07]
In this thread you will find a set a patches I've applied to pershoot's
kernel2635 source (https://github.com/pershoot/kernel-2635.git
) in a
attempt to compile my own kernels and to fix the long standing and not cared of usb
battery drain bug (able to eat your battery in less than 2hrs).
A (outdated) list of the applied patches is:
- 003-220.127.116.11-sched-bfs-404.patch this is by Con Kolivas http://ck.kolivas.org/patches/bfs/2.6.35/
- 034-10mb_32A.patch (MT1.2/Old 32a memory map)
- 035-9aa258a27b6183e8e80241e4820883eaed23139f.patch (Magic Plus (32a) extra 10MB ram)
- 036-kmalloc_b0937124b376946a5c93504f34ac932dffb23e3e.p atch
- 042-BFS-rr_interval_335f482a0274a640ae6ab1a0036a3b263de575 b6.patch
- 043-i2c_msm_a146e17dd81a2e4eaf67928c945038f521409384.p atch
- 049-pmem_c21c461ce3e32d26abebe6243039824839748dc5.patc h
- 058-autogroup patches
- configs for 2708, ebi0 and ebi1
Please refer to the attached patches.zip files for the latest
Main features of this kernel are:
BUG 1 (adb):
- BFS (in the BFS versions)
- various fixes and minor enhancements
- autogroup patches (in the autogroup versions)
Patches 1-2, 4-17 are rather trivial stuff as they just silence some warnings.
Patch 22 is the one that seems to fix or reduce the "usb battery drain bug"
in the sense that after applying this patch I was not able to trigger the bug
again and I've tried several times the last days. The same result was reported
by a few courageous testers that risked to install one of my precompiled kernels
and whom I would like to thank for their collaborative effort.
The steps used to trigger the bug were:
- plug in usb
- start adb session
- remove usb plug
- check if a sticky android os entry is in the battery stats (a sure sign of incipient drain)
The patch reverts f_adb.c to be more similar to how it was in kernel 2.6.29-msm.
Similar code could also be found in HTC's 2.6.35 sources for the Incredible S
so it could also be a alternative to use this code base for future G1 kernels.
Attached you'll find also the config I used to build the kernels posted
in the ezGingerbread thread and in Enomther's thread.
I hope this patch fixes this bug also for you as it did for me
making me a happy G1 user again.
I would thank to all who collaborated to this effort with facts
or with their wise words and advices.
BUG 2 (drain after reboot with usb connected):
After studying more and more bug N°2 and thanks to the comments of the posters who sent me in the right direction
I've made a good progress. It is very early to call it a conclusive solution yet, but I was able to reboot my phone
with usb connected and after 3 hrs it is fully charged.
What did the trick was to disable:
in the kernel. I don't know what it was there for but at least
on my G1 I've tested all basic functions:
- phone call
and every thing seems to work. More test are needed tough
there are also some minor leftovers to fix (more on this
in the next days).
For the bold a new kernel to test (tested on enomther's rom,
so I don't know if it will work on other roms).
You'll also find a VERY EXPERIMENTAL
anykernel/autokernel flashable zip archive with
EBI0/EBI1/2708+ kernels. Use it AT YOUR OWN RISK
and kindly report success or failure while flashing.
I cannot test it on all device/ROM combinations
so it may or may not work for you.
MAKE A BACKUP BEFORE USING IT so if something
goes wrong you can restore your previous rom.
I can give you very limited support due to missing
free time nonetheless patches are welcome!
Autokernel with BFS v0.401 and 1000Hz Kernel timer resolution for Froyo (discontinued):
Autokernel with BFS v0.404 for Gingerbread (experimental):
Standard Autokernel for Froyo (discontinued):
Standard Autokernel for Gingerbread (stable):
Standard Autokernel for Gingerbread
with autogroup patches and memory compaction (experimental):
This kernels are unsupported they worked for me and I hope
they work for you, feel free to report problems and I will try to
fix them depending on my free time and skills.
USE AT YOUR OWN RISK. NO WARRANTY.
- fixes to the installer automagic.
- BFS v0.401 + 1000Hz kernel timer resolution (BFS-version only) + rr_interval tuning.
- i2c_msm HTC update
- updated to 18.104.22.168
- revert kernel timer resolution to 100Hz
- revert rr_interval tuning (BFS version)
- update android gadget to gingerbread version.
- BFS v0.404 in the BFS versions
- Compensate for rounding on odd-frequency clocksources
- zImage fixes
- Enable Memory Compaction
- wifi - Don't make disabled irqs wake the device
- cache-l2x0: Correct l2x0 initialization
- autogroup patches
- update to 22.214.171.124 (autogroup version only)