[G1 Android Development] farmatito:
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:

001-fix_msm_clock_warning.patch

002_fix_msm_nand_warning.patch

003-2.6.35.13-sched-bfs-404.patch this is by Con Kolivas http://ck.kolivas.org/patches/bfs/2.6.35/

004-bfs_fix.patch

006-msm_evlog_fix.patch

007-hw3d_refdata.fix

008-htc_pwrsink_refdata.patch

009-board_trout_sapphire_fix.patch

010-eventpoll_fix.patch

011-dm-crypt_fix.patch

012-mt9t013_fix.patch

013-msm_smd_fix.patch

014-pm_fix.patch

016-mddi_refdata_fix.patch

017-lowmemorykiller_fix.patch

022-adb_2.6.29_forward_porting.patch

023-htc_battery.patch

024-msm72k_udc.patch

025-patch-2.6.35.11-12

026-BFQ-v2.patch

027-BFQ-v2-r1.patch

028-smd_rpcrouter.patch

029-audpp_missed_DMA.patch

030-msm_serial_hs.patch

031-irq_pm.patch

032-smd_tty.patch

033-linux-2.6.38.y.git-524429c31b486c05449666b94613f59f729c0a84.patch

034-10mb_32A.patch (MT1.2/Old 32a memory map)

035-9aa258a27b6183e8e80241e4820883eaed23139f.patch (Magic Plus (32a) extra 10MB ram)

036-kmalloc_b0937124b376946a5c93504f34ac932dffb23e3e.patch

037-2.6.36_lowmemorykiller+fudgeswap.patch

038-minfree_stats-bb4a7baa64d9a56124e1f13510e9688aeed0cc10.patch

039-msm72k_udc_fix_msm.git-1aa53ebd36088a60fcf4a498f763358598a477b9.patch

040-synaptics_warning_fix.patch

041-BFS-401-2388fb7aee855019c4a7560efb54cc7550a09743.patch

042-BFS-rr_interval_335f482a0274a640ae6ab1a0036a3b263de575b6.patch

043-i2c_msm_a146e17dd81a2e4eaf67928c945038f521409384.patch

044-BFS-1000Hz.patch

045-patch-2.6.35.12-13

046-zram.patch

047-vzalloc_for_zram_linux-2.6.38.y.git-e1ca7788dec6773b1a2bce51b7141948f2b8bccf.patch

049-pmem_c21c461ce3e32d26abebe6243039824839748dc5.patch

050-gingerbread_gadget_update.patch

051-adb_2.6.29_forward_porting.patch

052-msm72k_udc.patch

053_msm72k_udc_warning_fix.patch

054-ae9bd4d574b7b8480aee162273d58d0c3840510a.patch

055-ARM-zImage.patch

056-wifi-3e6f7025178699b354e0e9fd94331f47ebb82763.patch

057-arm-mm-cache-ecce0382ee54a765abcdc982e01a5fd30099f52d.patch

058-autogroup patches

059-patch-2.6.35.13-14

060-cpufreq_stat_fix.patch

configs for 2708, ebi0 and ebi1

Please refer to the attached patches.zip files for the latest

patch series.

Main features of this kernel are:

BFS (in the BFS versions)

BFQv2r1

Overclocking

various fixes and minor enhancements

autogroup patches (in the autogroup versions)

BUG 1 (adb):

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

at http://dl4.htc.com/RomCode/Source_and_Binaries/vivo-2.6.35-g89aa373.tar.gz

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:

CONFIG_SERIAL_MSM

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

sms

data

wifi

BT

adb

music

GPS

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):

auto-boot-2.6.35.13-farmatito-pershoot-ds-BFS+-20110428.zip

http://www.multiupload.com/8CKICMRK6B

MD5SUM 999770a413cbe93be75e00b1529f2300

Autokernel with BFS v0.404 for Gingerbread (experimental):

auto-boot-2.6.35.13-farmatito-pershoot-ds-BFS+-20110518.zip

http://www.multiupload.com/YRXWMK1AY3

MD5SUM c1373c915c8bfe3ebb470e839756a735

Standard Autokernel for Froyo (discontinued):

auto-boot-2.6.35.13-farmatito-pershoot-ds+-20110428.zip

http://www.multiupload.com/LLMKG4TRTO

MD5SUM ee3f5c53b4871076f123491c9dc388e2

Standard Autokernel for Gingerbread (stable):

auto-boot-2.6.35.13-farmatito-pershoot-ds+-20110505.zip

http://www.multiupload.com/0SJ77OM4HA

MD5SUM61a8bb913ca43a355e1eef3152b008db

Standard Autokernel for Gingerbread

with autogroup patches and memory compaction (experimental):

auto-boot-2.6.35.14-farmatito-pershoot-ds+-20110802.zip

http://www.multiupload.com/3NJ7Q0Y4TN

MD5SUM 27536ef42348dd92bb006cd8511df5d9

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.

Enjoy

Changelog

v 20110425:

fixes to the installer automagic.

v 20110428:

BFS v0.401 + 1000Hz kernel timer resolution (BFS-version only) + rr_interval tuning.

i2c_msm HTC update

updated to 2.6.35.13

V 20110505:

revert kernel timer resolution to 100Hz

revert rr_interval tuning (BFS version)

update android gadget to gingerbread version.

V 20110518:

BFS v0.404 in the BFS versions

V 20110612

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

V 20110802

update to 2.6.35.14 (autogroup version only)