Android Upstreaming

Registered by Loïc Minier on 2010-09-28

Help get some Android kernel features or patches upstreamed

Blueprint information

Status:
Complete
Approver:
Paul McKenney
Priority:
Medium
Drafter:
John Stultz
Direction:
Needs approval
Assignee:
John Stultz
Definition:
Approved
Series goal:
Accepted for 11.05
Implementation:
Implemented
Milestone target:
None
Started by
Mounir Bsaibes on 2010-12-08
Completed by
John Stultz on 2011-06-28

Related branches

Sprints

Whiteboard

Currently approaching this effort in two ways:

1) Creating an Android "trivial-merges" tree, where I've gone through the entire android patch queue (266 patches, currently), and cherry-picked any small change or fix that does not introduce new infrastructure or entire drivers. Currently there are about 50 or so patches that seem to match this criteria and apply easily to Linus' current git tree. I will be sorting these patches into topic branches and then trying to fwd them on to maintainers for comment. Hopefully the changes will either be easy to merge, or will provide a example of an issue in the subsystem that the subsystem maintainer can try to address in their own way if the android fix is unacceptable.

2) I've been working on a posix interface to the RTC device, which is similar to the Android alarm timers infrastructure. My hope is that my implementation of the hybrid alarm timers interface, while somewhat different from Android's, will be more acceptable to upstream and still sufficient for Android to make use of (a small shim layer may still be required, as my interface has a different ABI then Android's). Its my hope that this alarm-timer interface will then be useful to desktop machines and servers that are normally left on 24hours to save power by suspending, and at the same time, this will illustrate some of the deeper issues with aggressive suspend implementations to regular x86 developers, and will generate more interest in solving the problem Android solved by using wakelocks.

So this is a start here. There are still quite a bit of drivers and android specific infrastructure that I'll need to get my head around (binder, ashmem, wakelocks, new broadcom wireless and touchscreen drivers, etc) before attempting to push those upstream.

2010-11-23: Quick update on trivial tree. Sent out scheduler topic branch and got feedback and discussion from both PeterZ and Mike Chan (android dev/patch author). While most of the patches in that topic branch had issues, one of the trivial patches has been included in the -tip tree for upstreaming.

2010-12-03: Update on alarm-timers work, I've gotten the base level rework of the RTC layer reviewed by tglx and queued for inclusion into the tip tree (hopefully merged into 2.6.38). Still working on a few details with the Alarm Timers patch (need some sort of capabilities checking, also possibly some sort of policy so we don't wake from user-triggered suspends), but things are moving along well.

2011-01-12: Update on alarm-timers work. The base level rework of the RTC layer (including the timerqueue work) has been included for 2.6.38. Also I've gotten some feedback on the alarmtimers patch from the Anrdoid guys. They are interested in sharing the common in-kernel interfaces, but are not certain my proposed userland interface (via posix clocks/timers) is sufficient to replace the /dev/alarm interface's semantics. I've proposed a solution to get similar functionality, but i'm waiting on feedback. Also I found a new requirement: having a time domain that is monotonic but includes suspend time, so I've introduced a CLOCK_BOOTTIME clockid (and a corresponding CLOCK_BOOTTIME_ALARM to the alarmtimers code), and that code has been sent to lkml for review.

2011-03-02: CLOCK_BOOTTIME patches have been pulled into linux-tip and are queued for 2.6.39. Also my LWN article covering the posix alarm timers work was published today: https://lwn.net/Articles/429925/

2011-4-21: Posix Alarm Timers submitted to lkml for inclusion in 2.6.40, Arnd reviewed and Acked them. Also regenerated the trivial tree for mm/MMC/cgroup/cpufreq topics. Will be sending those out over the next few days for review.

2011-5-25: Posxi Alarm Timers merged along with trivial mm patch!

(?)

Work Items

Work items:
[jstultz] Upstream RTC groundlevel rework: DONE
[jstultz] Upstream CLOCK_BOOTTIME feature: DONE
[jstultz] Upstream trivial schedule patch: DONE
[jstultz] Create git tree of trivial Android patches to be upstreamed (will generate other work items): DONE
[jstultz] Upstream posix alarm-timers: DONE
[jstultz] Upstream trivial mm patch: DONE
[jstultz] Send out trivial MMC patches: DONE
[jstultz] Send out trivial cgroup patches: POSTPONED
[jstultz] Send out trivial cpufreq patches: POSTPONED

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.