Running a mainline kernel on a cellphone
Benefits for LWN subscribers The primary benefit from subscribing to LWN is helping to keep us publishing, but, beyond that, subscribers get immediate access to all site content and access to a number of extra site features. Please sign up today! |
One of the biggest freedoms associated with free software is the ability to replace a program with an updated or modified version. Even so, of the many millions of people using Linux-powered phones, few are able to run a mainline kernel on those phones, even if they have the technical skills to do the replacement. The sad fact is that no mainstream phone available runs mainline kernels. A session at the 2015 Kernel Summit, led by Rob Herring, explored this problem and what might be done to address it.
When asked, most of the developers in the room indicated that they would prefer to be able to run mainline kernels on their phones — though a handful did say that they would rather not do so. Rob has been working on this problem for the last year and a half in support of Project Ara (mentioned in this article). But the news is not good.
There is, he said, too much out-of-tree code running on a typical handset; mainline kernels simply lack the drivers needed to make that handset work. A typical phone is running 1-3 million lines of out-of-tree code. Almost all of those phones are stuck on the 3.10 kernel — or something even older. There are all kinds of reasons for this, but the simple fact is that things seem to move too quickly in the handset world for the kernel community to keep up. Is that, he asked, something that we care about?
Tim Bird noted that the Nexus 1, one of the original Android phones, never ran a mainline kernel and never will. It broke the promise of open source, making it impossible for users to put a new kernel onto their devices. At this point, no phone supports that ability. Peter Zijlstra wondered about how much of that out-of-tree code was duplicated functionality from one handset to the next; Rob noted that he has run into three independently developed hotplug governors so far.
Dirk Hohndel suggested that few people care. Of the billion phones out there, he said, approximately 27 of them have owners who care about running mainline kernels. The rest just want to get the phone to work. Perhaps developers who are concerned about running mainline kernels are trying to solve the wrong problem.
Chris Mason said that handset vendors are currently facing the same sorts of problems that distributors dealt with many years ago. They are coping with a lot of inefficient, repeated, duplicated work. Once the distributors decided to put their work into the mainline instead of carrying it themselves, things got a lot better. The key is to help the phone manufacturers to realize that they can benefit in the same way; that, rather than pressure from users, is how the problem will be solved.
Grant Likely raised concerns about security in a world where phones cannot be upgraded. What we need is a real distribution market for phones. But, as long as the vendors are in charge of the operating software, phones will not be upgradeable. We have a big security mess coming, he said. Peter added that, with Stagefright, that mess is already upon us.
Ted Ts'o said that running mainline kernels is not his biggest concern. He would be happy if the phones on sale this holiday season would be running a 3.18 or 4.1 kernel, rather than being stuck on 3.10. That, he suggested, is a more solvable problem. Steve Rostedt said that would not solve the security problem, but Ted remarked that a newer kernel would at least make it easier to backport fixes. Grant replied that, one year from now, it would all just happen again; shipping newer kernels is just an incremental fix. Kees Cook added that there is not much to be gained from backporting fixes; the real problem is that there are no defenses from bugs (he would expand on this theme in a separate session later in the day).
Rob said that any kind of solution would require getting the vendors on board. That, though, will likely run into trouble with the sort of lockdown that vendors like to apply to their devices. Paolo Bonzini asked whether it would be possible to sue vendors over unfixed security vulnerabilities, especially when the devices are still under warranty. Grant said that upgradeability had to become a market requirement or it simply wasn't going to happen. It might be a nasty security issue that causes this to happen, or carriers might start requiring it. Meanwhile, kernel developers need to keep pushing in that direction. Rob noted that, beyond the advantages noted thus far, the ability to run mainline kernels would help developers to test and validate new features on Android devices.
Josh Triplett asked whether the community would be prepared to do what it would take if the industry were to come around to the idea of mainline kernel support. There would be lots of testing and validation of kernels on handsets required; Android Compatibility Test Suite failures would have to be treated as regressions. Rob suggested that this could be discussed next year, after the basic functionality is in place, but Josh insisted that, if the demand were to show up, we would have to be able to give a good answer.
Tim said that there is currently a big disconnect with the vendor world; vendors are not reporting or contributing anything back to the community at all. They are completely disconnected, so there is no forward progress ever. Josh noted that when vendors do report bugs with the old kernels they are using, the reception tends to be less than friendly. Arnd Bergmann said that what was needed was to get one of the big silicon vendors to commit to the idea and get its hardware to a point where running mainline kernels was possible; that would put pressure on the others. But, he added, that would require the existence of one free GPU driver that got shipped with the hardware — something that does not exist currently.
Rob put up a list of problem areas, but there was not much time for discussion of the particulars. WiFi drivers continue to be an issue, especially with the new features being added in the Android world. Johannes Berg agreed that the new features are an issue; the Android developers do not even talk about them until they ship with the hardware. Support for most of those features does eventually land in the mainline kernel, though.
As things wound down, Ben Herrenschmidt reiterated that the key was to get
vendors to realize that working with the mainline kernel is in their own
best interest; it saves work in the long run. Mark Brown said that, in
past years when the kernel version shipped with Android moved forward more
reliably, the benefits of working upstream were more apparent to vendors.
Now that things seem to be stuck on 3.10, that pressure is not there in the
same way. The session ended with developers determined to improve the
situation, but without any clear plan for getting there.
Index entries for this article | |
---|---|
Kernel | Android |
Conference | Kernel Summit/2015 |
(Log in to post comments)
Running a mainline kernel on a cellphone
Posted Oct 28, 2015 17:12 UTC (Wed) by xav (guest, #18536) [Link]
Count me in ! And by casualy browing the XDA forums I think ou could find many more people.
But I don't think this problem is limited to phones. Do other ARM Soc like iMX6 ou Sitara run (with all their features) mainline kernels ? The vendor sites only distribute old ones.
Running a mainline kernel on a cellphone
Posted Oct 28, 2015 17:44 UTC (Wed) by tzafrir (subscriber, #11501) [Link]
Running a mainline kernel on a cellphone
Posted Oct 28, 2015 19:51 UTC (Wed) by Jonno (subscriber, #49613) [Link]
Currently Debian stable contains 621 patches (+51078 -9753) on top of 3.16.7-ckt11, of which 110 patches (+1750 -1541) are "bugfix" (mostly backports), 462 patches (+47185 -7608) are "features" (mostly drivers), and 49 patches (+2143 -604) are Debian specific.
While most distribution kernels aren't nearly as bad as most vendor kernels, they aren't really mainline either...
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 16:37 UTC (Fri) by ballombe (subscriber, #9523) [Link]
Running a mainline kernel on a cellphone
Posted Oct 31, 2015 3:09 UTC (Sat) by marcH (subscriber, #57642) [Link]
Running a mainline kernel on a cellphone
Posted Oct 31, 2015 3:31 UTC (Sat) by dlang (guest, #313) [Link]
A lot of the 'feature/driver' patches are actually backports of drivers or features that are in newer upstream releases.
Running a mainline kernel on a cellphone
Posted Nov 24, 2015 8:39 UTC (Tue) by Lennie (subscriber, #49641) [Link]
I assume basically everyone working on the Debian Kernel Team is employed by Canonical and works on both.
Running a mainline kernel on a cellphone
Posted Nov 24, 2015 15:42 UTC (Tue) by jond (subscriber, #37669) [Link]
Running a mainline kernel on a cellphone
Posted Nov 24, 2015 15:44 UTC (Tue) by jond (subscriber, #37669) [Link]
Running a mainline kernel on a cellphone
Posted Nov 24, 2015 19:37 UTC (Tue) by BenHutchings (subscriber, #37955) [Link]
I'll be taking over maintenance of the 3.16 stable branch next year, likely changing 'ckt' to 'dkt'. (Certainly, it'll have to be something that sorts higher.)
Running a mainline kernel on a cellphone
Posted Oct 28, 2015 19:17 UTC (Wed) by error27 (subscriber, #8346) [Link]
Running a mainline kernel on a cellphone
Posted Oct 31, 2015 11:51 UTC (Sat) by jospoortvliet (guest, #33164) [Link]
Running a mainline kernel on a cellphone
Posted Nov 3, 2015 14:21 UTC (Tue) by drag (guest, #31333) [Link]
Google could indeed demand a specific kernel and it would gain a lot of traction like that, but it will weaken Google's position in the Android community. The more Google restricts it's partners then more expensive it becomes to partner with Google. The more expensive it is to follow Google's rules the more likely that somebody else to take over Google's 'benevolent rule' of Android (which would be much more 'friendly' in terms of proprietary driver encumbered kernels.). It's obviously contrary to Google's goals to make life more difficult for people that are willing to work with them then it needs to be.
The reality is that it's counter productive to try to compel people to act against their own best interests. You can't just 'force' people to be friendlier to the mainstream Linux kernel. How you win is by making it cheaper and easier to 'do the right thing' with the mainline kernel rather then chase down device-specific hacks/patches/kernels and closed drivers.
This has to come from a combination of improvements in the Linux kernel to make it more android friendly and participation of hardware chip set manufacturers to upstream their hardware support.
Running a mainline kernel on a cellphone
Posted Nov 3, 2015 19:13 UTC (Tue) by spaetz (guest, #32870) [Link]
Not true. If you want to use (and sell) Android™ you need to abide by a whole lot of rules and preinstall priviledged services. Only in case you decide to skip to name Android (Amazon Kindle) you are free to do whatever the hell you want.
Running a mainline kernel on a cellphone
Posted Nov 5, 2015 11:06 UTC (Thu) by Wol (subscriber, #4433) [Link]
The reality is that it's counter productive to try to compel people to act against their own PERCEIVED best interests.
And actually, the reality often is that you really are trying to force me to act against my own best interest. You're not me, you don't know what is or isn't important to me.
It's a lot harder to do, but if you can persuade someone that their best interests will be served by helping you, you then have a good basis for collaboration. Not only will they want to help you, but you will have a far better understanding of them.
Cheers,
Wol
Running a mainline kernel on a cellphone
Posted Nov 23, 2015 6:20 UTC (Mon) by jospoortvliet (guest, #33164) [Link]
Running a mainline kernel on a cellphone
Posted Oct 28, 2015 22:04 UTC (Wed) by mokki (subscriber, #33200) [Link]
That stopped soon after Microsoft acquisition, but users are still continuing the quest of full mainline support for the N9 phone.
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 8:36 UTC (Thu) by petur (guest, #73362) [Link]
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 18:54 UTC (Fri) by Karellen (subscriber, #67644) [Link]
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 18:56 UTC (Fri) by Karellen (subscriber, #67644) [Link]
Running a mainline kernel on a cellphone
Posted Oct 28, 2015 22:28 UTC (Wed) by ssmith32 (subscriber, #72404) [Link]
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 12:58 UTC (Thu) by genaro (subscriber, #82632) [Link]
Running a mainline kernel on a cellphone
Posted Nov 3, 2015 0:26 UTC (Tue) by rahvin (guest, #16953) [Link]
Though better security would be a nice thing I doubt we'll see it unless the ARM phone chip guys embrace openness. Qualacom and others are openly hostile to openness.
Running a mainline kernel on a cellphone
Posted Nov 3, 2015 23:17 UTC (Tue) by liam (subscriber, #84133) [Link]
Running a mainline kernel on a cellphone
Posted Nov 26, 2015 6:35 UTC (Thu) by speedster1 (guest, #8143) [Link]
That was a lucky misunderstanding -- their bosses thought they were contributing to improvements in Digital Rights Management ;)
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 3:38 UTC (Thu) by voltagex (subscriber, #86296) [Link]
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 9:24 UTC (Thu) by Seegras (guest, #20463) [Link]
And actually, I would like to run a mainline kernel too, but on a Galaxy Nexus or an Xperia Pro. But I definitely lack the skills and time to do it.
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 10:48 UTC (Thu) by k3ninho (subscriber, #50375) [Link]
K3n
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 12:42 UTC (Fri) by jpfrancois (subscriber, #65948) [Link]
When boardfile where in use, they were not that big. I think the out of tree code is mainly drivers and random hacks to the scheduler / PM code.
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 16:54 UTC (Fri) by robher (subscriber, #92311) [Link]
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 11:21 UTC (Thu) by cov (guest, #84351) [Link]
https://plus.google.com/102276447148493441479/posts/amRvp...
Disclaimer: I work for a Qualcomm subsidiary but am writing in a personal capacity, not on their behalf.
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 21:18 UTC (Thu) by khim (subscriber, #9252) [Link]
It's funny that so many wise guys could miss the point so much. Android vendors don't need the mainstream kernel. They just need one kernel where all the features coalesce. If it'll be perpetually extended Linux kernel 3.10 with bazillion extensions - they would be happy.
The only hope here is the fact that Google does not use these kernels on their servers. Which means that this solution will not be accepted by Google. But since this is such an obvious solution... are we sure it'll not be pushed by some other large group of vendors?
Running a mainline kernel on a cellphone
Posted Oct 29, 2015 22:50 UTC (Thu) by jcm (subscriber, #18262) [Link]
Instead, it needs someone like Google to force vendors to do what's in the greater good. Enterprise computing didn't just get where it is either - but in that space there are those who stick to "upstream first" as a rigid requirement that forces others to jump through hoops to upstream code. In the case of Android, Google don't ship the resulting kernel/build directly, but they could make it a requirement of CTS (Compatibility Test Suite) that handset vendors must run in order to have access to the Play Store. Google could do this, but they have little incentive to do so, and my guess is that they never will.
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 19:22 UTC (Fri) by mtaht (guest, #11087) [Link]
http://fossbytes.com/internet-inventor-vint-cerf-and-expe...
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 12:10 UTC (Fri) by keroami (guest, #6921) [Link]
http://neo900.org
Tons of other cool features in that (upcoming) phone, too.
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 12:28 UTC (Fri) by tao (subscriber, #17563) [Link]
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 17:25 UTC (Fri) by dos (guest, #103671) [Link]
Running a mainline kernel on a cellphone
Posted Oct 30, 2015 16:34 UTC (Fri) by tbird20d (subscriber, #1901) [Link]
The main web page for the project (which covers more than just technical issues) is here:
http://elinux.org/CE_Workgroup_Device_Mainlining_Project
Fining vendors? Perhaps it would work...
Posted Oct 31, 2015 22:23 UTC (Sat) by armijn (subscriber, #3653) [Link]
There is a maximum fine of 810,000 EUR. The EU is apparently working on similar laws. It is not directly aimed at security issues but data leaks are often a result of security issues (of any kind). So this might be a step into the right direction.
Running a mainline kernel on a cellphone
Posted Nov 6, 2015 4:22 UTC (Fri) by eean (guest, #50420) [Link]
Running a mainline kernel on a cellphone
Posted Nov 6, 2015 13:42 UTC (Fri) by flussence (subscriber, #85566) [Link]
silicon vendors are doing the kernel work
Posted Nov 8, 2015 9:22 UTC (Sun) by Hauke (guest, #103131) [Link]
In the home router market the silicon vendors provide an (old) kernel with support for their SoC and other chips, they sell or from third parties, connected to this main SoC. Some are also shipping a complete Linux distribution and provide reference PBC designs so the device manufacturers get a complete system which could get shipped to end consumers. These reference designs (software and hardware) are just copied and modified by the device manufacturers.
Mainline support for an SoC takes more time than bringing it somehow to work on some random (old) kernel. Most vendors wants to meet a short time to market and mostly the focus is only on the current silicon and not how one could save some work in the future for the next generation SoC, which uses similar IP cores or when a update of the kernel is needed.
Currently it looks like the big customers of the silicon vendors only want a somehow working kernel which supports all the features of the SoC, if these big costumers would say that they want upstream support for the SoC they would get it.
Create a FOSS competitor running latest kernels
Posted Nov 24, 2015 13:41 UTC (Tue) by fithisux (guest, #105482) [Link]