|
|
Subscribe / Log in / New account

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!

By Jonathan Corbet
October 28, 2015
2015 Kernel Summit
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 [Rob Herring] 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
KernelAndroid
ConferenceKernel 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]

> Of the billion phones out there, he said, approximately 27 of them have owners who care about running mainline kernels.

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]

There are quite a few such boards that will run with a Debian (even Stable) kernel. See e.g. all of the devices supported by the Debian installer. I don't think Debian includes much support beyond mainline (and backported patches).

Running a mainline kernel on a cellphone

Posted Oct 28, 2015 19:51 UTC (Wed) by Jonno (subscriber, #49613) [Link]

> I don't think Debian includes much support beyond mainline (and backported patches).

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]

backports are not a problem since you can only backport something which is is mainline already.

Running a mainline kernel on a cellphone

Posted Oct 31, 2015 3:09 UTC (Sat) by marcH (subscriber, #57642) [Link]

The question is: how many of these patches are actually required for the system to be usable? I guess very few.

Running a mainline kernel on a cellphone

Posted Oct 31, 2015 3:31 UTC (Sat) by dlang (guest, #313) [Link]

the fact that many people run vanilla kernels on such systems is an indication that in many/most cases the patches are not required (I did so for more than a decade at my last job)

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]

Did you know what ckt stands for ?: Canonical Kernel Team.

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]

Ben Hutchings doesn't.

Running a mainline kernel on a cellphone

Posted Nov 24, 2015 15:44 UTC (Tue) by jond (subscriber, #37669) [Link]

Expanding on this, looking at https://wiki.ubuntu.com/KernelTeam#Ubuntu_Platform_Kernel... , I don't recognise any names in Debian.

Running a mainline kernel on a cellphone

Posted Nov 24, 2015 19:37 UTC (Tue) by BenHutchings (subscriber, #37955) [Link]

The 'ckt' is there to distinguish Canonical-maintained stable branches from those branches maintained or blessed by Greg K-H. It follows the same rules as other stable branches, though - without anything that's Ubuntu-specific or not upstream.

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]

With Google starting monthly Android security updates we will at least be able to see which phones get updated and which have not been updated for over a month. Also I am seeing a lot of new Samsung email addresses on the kernel lists and that's encouraging.

Running a mainline kernel on a cellphone

Posted Oct 31, 2015 11:51 UTC (Sat) by jospoortvliet (guest, #33164) [Link]

Google is important in any case. If the next Android release would simply require kernel 4.3, vendors would have no choice but to pressure their hardware vendors, who, in turn, would have to cave...

Running a mainline kernel on a cellphone

Posted Nov 3, 2015 14:21 UTC (Tue) by drag (guest, #31333) [Link]

Not 'Android release'. Android is free software so the vendors are free to do whatever the hell they want. Google's restrictions and controls are done through their app store and related software that runs on top of Android.

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 'Android release'. Android is free software so the vendors are free to do whatever the hell they want. Google's restrictions and controls are done through their app store and related software that runs on top of Android.

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 best interests.

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]

I agree - besides, there are technical ways google could push this. They don't seem to care, which is damaging their ecosystem - I guess it is ignorance more than anything. As usual with this stuff... It is hard to understand how a collaborative development model works and benefits participants.

Running a mainline kernel on a cellphone

Posted Oct 28, 2015 22:04 UTC (Wed) by mokki (subscriber, #33200) [Link]

Nokia (with N9 phone) was pushing for mainline kernel. Nokia used to be so big player that they also convinced Texas Instruments and some other component makers on board to push all needed drivers to mainline. Nokia + TI were both in LWN top kernel contributor company lists for 10 months.
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]

Sorry but I can't remember ever having been able to load a kernel on my n900 that didn't have TI binary blobs. I found the effort of Nokia and TI to be less than stellar....

Running a mainline kernel on a cellphone

Posted Oct 30, 2015 18:54 UTC (Fri) by Karellen (subscriber, #67644) [Link]

The Neo900 project is doing something similar for the N900. And accepting donations.

http://neo900.org/

Running a mainline kernel on a cellphone

Posted Oct 30, 2015 18:56 UTC (Fri) by Karellen (subscriber, #67644) [Link]

Sorry, should have read the whole thread before commenting. keroami already mentioned the N900 further down earlier.

Running a mainline kernel on a cellphone

Posted Oct 28, 2015 22:28 UTC (Wed) by ssmith32 (subscriber, #72404) [Link]

It would be nice, but I think the security argument was undercut by the misleading scare tactic of trying to associate the lack of kernel upgrades with a vulnerability in a user space library (stagefright). The problem of an easily updateable open-source user space doesn't really have a solid solution yet. Installing a mainline kernel may or may not help with that.

Running a mainline kernel on a cellphone

Posted Oct 29, 2015 12:58 UTC (Thu) by genaro (subscriber, #82632) [Link]

The association is relevant, as it is only a matter of time before a nasty kernel bug presents on Android devices. As the old kernels drift further from mainline, any effort to bring them up to speed becomes that much more difficult. Stagefright is an easy fix compared to a kernel issue.

Running a mainline kernel on a cellphone

Posted Nov 3, 2015 0:26 UTC (Tue) by rahvin (guest, #16953) [Link]

There are all kinds of kernel bugs in every android release. That's just a simple fact. Most of root exploits are actually exploits of either the kernel or a privileged service running on top of it. We wouldn't be able to attain root without it.

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]

AIUI, freedreno has received some patches from Qualcomm via their Innovation Center (iirc), on the drm side of things.

Running a mainline kernel on a cellphone

Posted Nov 26, 2015 6:35 UTC (Thu) by speedster1 (guest, #8143) [Link]

> AIUI, freedreno has received some patches from Qualcomm via their Innovation Center (iirc), on the drm side of things.

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]

For the past couple of years I've been playing with the idea of running mainline on the Nexus 4 - get in touch with me if you're interested.

Running a mainline kernel on a cellphone

Posted Oct 29, 2015 9:24 UTC (Thu) by Seegras (guest, #20463) [Link]

That is precisely the wrong way. Just do it, and make it easy to participate. Publish HowTos, code, and configs. And then spread it around.

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]

Was there any comment made about newer handsets using chips runnnig ARMv8, and them possibly being configured at startup via ACPI? Would it have divided the room into a fight over DT?

K3n

Running a mainline kernel on a cellphone

Posted Oct 30, 2015 12:42 UTC (Fri) by jpfrancois (subscriber, #65948) [Link]

I don't think ACPI or DT will change something here.
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]

ACPI on ARM is only for servers. No one else is looking to move from DT that I am aware of. Many phones have 3.4 kernels and are not even using DT.

Running a mainline kernel on a cellphone

Posted Oct 29, 2015 11:21 UTC (Thu) by cov (guest, #84351) [Link]

There seems to be some good Snapdragon device upstreaming progress from Rob Clark, Sony, Qualcomm, and Linaro. I hope it continues.

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]

The only way to get to a point where upstream kernels just run on phones is through force. None of the handset vendors has a commercial benefit to devoting cycles to upstreaming code when their competitors are not doing the same, and to think they can be "convinced" is (nice, but) wishful thinking.

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]

We are doomed to a buggy future unless we can keep everything patched. I am sad to hear the handset market is entering the same dark pit of un-upgadeability - particularly in case of aging devices with new attacks present - that so many home routers have. Perhaps what we suggested here needs also apply to phones?

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]

Neo900 runs 4.3-rc7 as we speak.
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]

It's indeed a cool project, but the price tag is ridiculous.

Running a mainline kernel on a cellphone

Posted Oct 30, 2015 17:25 UTC (Fri) by dos (guest, #103671) [Link]

Although I'm affiliated to Neo900 project, I'd like to keep the facts straight: it's the GTA04 project that works on kernel development and tries to keep it as close to upstream as possible. Then devices like Neo900, Pyra, lately also OpenPandora and BeagleBoard, and of course GTA04 itself (Letux devices) benefit from the work made on the GTA04 kernel :)

Running a mainline kernel on a cellphone

Posted Oct 30, 2015 16:34 UTC (Fri) by tbird20d (subscriber, #1901) [Link]

I gave a lightning talk the next day, with more details on where the problem areas are. Linaro and the Linux Foundation have a joint project to work on some issues, but we can use lots of help. I'm maintaining a page of technical projects at: http://elinux.org/Kernel_areas_of_focus_for_mainlining. Please feel free to add notes about technical items for things out-of-tree on SoCs you're familiar with. Please drop me an e-mail (tim dot bird @ sonymobile dot com) if you are working on, or plan to work on, any of the areas on that page.

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]

About half a year ago the senate in the Netherlands passed a law that puts a fine on keeping data breaches closed (Dutch only link): https://ictprivacyrecht.nl/beveiliging/wetswijziging-meld...

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]

How much of this is just the ARM ecosystem being so chaotic ? Like once we finally have Intel phones (?) I guess that will help.

Running a mainline kernel on a cellphone

Posted Nov 6, 2015 13:42 UTC (Fri) by flussence (subscriber, #85566) [Link]

Moving from ARM to Intel just sweeps the problem under the rug and into the (massive, proprietary and encrypted) board firmware.

silicon vendors are doing the kernel work

Posted Nov 8, 2015 9:22 UTC (Sun) by Hauke (guest, #103131) [Link]

I think the mainlining process has to start at the silicon vendors, they are doing all the kernel work and the device manufacturers only modify the work done by the silicon vendors a little bit.

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]

This way, others will follow and require latest kernels. Even if it has less functionality and the price is right, people will follow. You just have to push latest kernels and advertise it.


Copyright © 2015, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds