News for hackers. Stuff that matters.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by techrat on Friday March 26, 2021 @06:04PM (#26597540)
What I don't understand (due to my ignorance, please explain if you can)... what keeps the driver blobs from continuing to work from one version of Android to the next?

What prevents people from using the same drivers for a device on Android 7 and upgrading the OS to 9 or 10? I always understood that drivers would continue to allow the OS to recognize the component that the drivers are for unless something drastically changes on the OS side of things.

Why can't we say "Fuck you, Qualcomm" and continue to use the older drivers for newer OS versions without having to wait for them to officially support it?

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by bri3d on Friday March 26, 2021 @07:00PM (#26598019)
This is because the Linux kernel itself is constructed and developed in a way where driver interfaces (API) are ruthlessly refactored and the linker interface for kernel modules (ABI) is intentionally version-incompatible. If the driver's source code is not in the kernel, it doesn't gain the benefit of kernel developers doing this ruthless refactoring and falls behind immediately from a source point of view, and from a binary point of view, modules compiled for one kernel intentionally will not work with another.

This is a conscious and opinionated strategy on the part of Linux, as an effort to make the cost of keeping drivers closed-source high and the cost of kernel refactoring low. It also has... disadvantages, in the form of a massive wasteland of only-supported-once snapshot-in-time devices. I am sure this comment thread will happy expound on this in great and painful detail.

Secondly, there was an entire effort by Google called "Project Treble" to build a stable Android HAL/ABI over the top of these unstable kernel interfaces. Unfortunately it would/will require essentially an Android-specific rewrite from vendors in order to fully implement, so many drivers are not yet operating in this model.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by codewiz on Saturday March 27, 2021 @12:05AM (#26599822)
Project Treble is already fully supported by Qualcomm and other SoC vendors, that's not the issue.

The issue is that Treble simply shifts the compatibility issues from on from one layer (kernel) to another (Android HAL). There's still a compatibility horizon, because newer Android systems will eventually want to use newer kernel features and HAL APIs which were not present on ancient HALs which have been abandoned by the vendor.

And even if the OS could theoretically maintain backwards compatibility with older HAL APIs for 10 years, in practice the System + HAL combinations which aren't fully tested tend to break for various unforeseen reasons, making it unwise to push OS updates to devices which aren't fully supported by their vendor.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by garaetjjte on Friday March 26, 2021 @08:44PM (#26598714)
>as an effort to make the cost of keeping drivers closed-source high

I don't think it is intentional. Linux development is very pragmatic, they just want to have freedom to refactor anything without caring about stable kernel APIs.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by young_unixer on Saturday March 27, 2021 @02:45AM (#26600467)
Ironically, they care a lot about stability towards user space interfaces, to the point that bugs become features if someone depends on them, but they don't care about driver interfaces being stable.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by kevincox on Saturday March 27, 2021 @08:19AM (#26601785)
This seems like a win-win. The kernel developers are free to refactor as they need to keep the quality and velocity high and companies are incentivized to upstream patches including making drivers in-kernel.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by fakename11 on Friday March 26, 2021 @11:59PM (#26599795)
It's somewhat pragmatic for the Linux developers. Support a stable kernel API probably wouldn't be that expensive. It's clearly a political decision against writing close source code that does anything low level.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by ClumsyPilot on Saturday March 27, 2021 @09:24AM (#26602114)
I am not sure why the comment is being downvoted - thats exactly what it is, a political decision to force companies to produce open drivers.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by joelellis on Saturday March 27, 2021 @12:55PM (#26603636)
Because of this unsubstantiated and baseless claim:

> Support a stable kernel API probably wouldn't be that expensive

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by alisonkisk on Saturday March 27, 2021 @02:10AM (#26600328)
How is it clear?
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by teddyh on Saturday March 27, 2021 @08:27AM (#26601819)
> This is a conscious and opinionated strategy on the part of Linux

If anyone wants to read the Linux developers’ explanation directly, here it is:

https://www.kernel.org/doc/html/latest/process/stable-api-no...

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by baybal2 on Friday March 26, 2021 @07:05PM (#26598057)
> is a conscious and opinionated strategy on the part of Linux, as an effort to make the cost of keeping drivers closed-source high.

And Qualcomm is probably very, very happy with this arrangement. They can put a gazillion devs to maintain their BSPs using any means possible, but a small 2nd tier SoC fabbless don't.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by dathinab on Friday March 26, 2021 @07:24PM (#26598201)
Or you just push it upstream, which solves your problem because whoever is refactoring kernel code is also likely doing the appropriate changes in your code if necessarily.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by cwyers on Friday March 26, 2021 @08:06PM (#26598479)
This assumes that the person making the SoC owns all the rights to the code for their drivers, instead of licensing them from other firms.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by bluGill on Saturday March 27, 2021 @10:06AM (#26602348)
You can demand those terms when you negotiate the license.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by cwyers on Saturday March 27, 2021 @05:38PM (#26605867)
And they can say "no" or "money please."
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by Too on Sunday March 28, 2021 @11:30AM (#26611169)
Is it truly necessary that all these drivers run in the kernel space?

I bet a lot of drivers are just interfacing with a standard serial line which could be done in the stable user space and then exposing the next layer through something like FUSE.

If I understand treble correctly that’s close to what Android is doing, where each HAL can be done in userspace?

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by PixelOfDeath on Friday March 26, 2021 @07:09PM (#26598087)
Didn't some Linux maintainers had very clear legal words for NVidia when they tried to make a kernel HAL/ABI?
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by dathinab on Friday March 26, 2021 @07:23PM (#26598189)
NoyesNo, Nvidia tried to make a doggy legally questionable workaround for license aspects, so it's not quite the same.

Also as far as I remember (I might be wrong) the google HAL isn't a abstraction/redirection in the low level kernel module layer it lives on a higher abstraction level and was meant to make the amount of ways braking less but never planed to add abstractions on top of which you could build a graphics driver or CPU support (which doesn't only affect drivers but potential also kernel compiler time conditional compilations).

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by koolba on Friday March 26, 2021 @10:59PM (#26599522)
Still not as a bad as Linuxant: https://lwn.net/Articles/82305/
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by Something1234 on Friday March 26, 2021 @11:34PM (#26599694)
I'm having trouble understanding the issue was here. Linuxant produced a module that lied to the kernel about being a non-binary blob. Am I correct, but I'm still having trouble understand how the company survived since they seem to have a website up still.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by corty on Saturday March 27, 2021 @08:15AM (#26601767)
Linux kernel license enforcement is very lax. Most binary blob drivers probably violate GPL in one way or the other, as do the "GPL-condom" half-open-source "drivers" that do most of their stuff in a userspace blob.

When asked about it most kernel developers point to closed-door negotiations that are being kept confidential. Usually also saying "trust us, we know what we are doing, we'll get more source opened our way".

Those who actually try to enforce GPL publically are ignored or shunned, e.g. Harald Welte/LaForge of gpl-violations.org

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by pantalaimon on Friday March 26, 2021 @06:20PM (#26597692)
Are you implying the 'no stable binary ABI' policy is responsible for a lot of e-waste?
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by cwyers on Friday March 26, 2021 @06:25PM (#26597747)
I mean, that seems to be the result, yes? The intent is to compel device manufacturers to release the source of their drivers, but at this point, I think we have to admit that's not a great description of what's happening in the mobile space.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by DaiPlusPlus on Friday March 26, 2021 @06:52PM (#26597956)
> The intent is to compel device manufacturers to release the source of their drivers

I doubt that was the "intent"... perhaps a contributory argument in favour of a non-stable ABI, but I understand the reasons are far more pragmatic: maintaining a stable kernel ABI is a lot of work which could have strangled Linux in its early years.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by dathinab on Friday March 26, 2021 @07:38PM (#26598306)
> have strangled Linux in its early years.

And likely would still do so toady. I mean we are speaking about the kernel internal API (not the syscall API, which is stable).

Even systems which pride themself for internal kernel API stability do change the API every view years, while often having much less internal (feature/platform support) changes then Linux. Furthermore in android Linux LTS versions are often used which do support a long term stable ABI, potentially longer then certain other more niche systems priding themself with long support.

The problem is when a device is sold the kernel (minus back ported security fixes) is often already multiple years old so even if you use a kernel with 7 years longtime support you still have a good chance to run into problem. And supporting any kernel internal API for more then that time is unrealistic.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by cwyers on Friday March 26, 2021 @08:05PM (#26598470)
Why? WDDM drivers written for Windows Vista can still work on Windows 10. And Windows is not a "niche" system.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by dathinab on Friday March 26, 2021 @11:03PM (#26599538)
Because Windows is a (very broken) Micro-Kernel system which did very little changes to it's kernel (as far as I know) in the last many years, in difference to that Linux is a macro kernel with constant changes and improvements to it.

Are the improvements worth the cost? I don't know. (For server applications likely yes, but for desktop likely not).

What I do know is that there are clear benefits of micro kernel architectures, even if they are kinda messed up (for a micro kernel) hybrids like windows has.

Lastly the way the kernel API's are designed can also make a major difference independent of the rest. Honestly the Linux kernel API feels much more raw then the windows API, but I only have every written a single dummy driver for each platform and that was quite a while ago.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by kevingadd on Friday March 26, 2021 @11:16PM (#26599601)
This comment feels like it was written by someone who hasn't done much Windows development (which is fine!). The kernel changes a lot over time, introducing entirely new driver models (see https://en.wikipedia.org/wiki/Windows_Display_Driver_Model#H... for an example), OS-wide features, etc. Things like thread scheduling or timer granularity can and will change (see https://randomascii.wordpress.com/2020/10/04/windows-timer-r... for a recent example)

Let's not forget about massive stuff like the whole Windows Subsystem For Linux, which was literally an entire separate process type alongside Win32 processes, with its own set of syscalls etc. Added and then deprecated (and probably eventually removed entirely) over the span of years.

Maintaining a stable kernel ABI is no doubt a big investment, but it's possible and doesn't have much to do with whether your kernel is a microkernel or not. Lots of Windows drivers these days are user-space which helps maintain compatibility and stability.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by DaiPlusPlus on Friday March 26, 2021 @11:12PM (#26599577)
Windows NT is not a microkernel - Windows CE was, however.

NT has been shifting towards running more driver-code in user-space, as has macOS as well, especially with UMDF (especially for USB devices) and for graphics drivers, which are historically the #1 cause of BSODs - however just because the kernel passes control to user-space for the bulk of the driver's number-crunching doesn't mean that architecturally the kernel is still responsible for huge swathes of the computer's functionality. With a true micro-kernel there isn't any third-party code in the kernel space - not even a stub.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by DaiPlusPlus on Saturday March 27, 2021 @02:18AM (#26600365)
> however just because the kernel passes control to user-space for the bulk of the driver's number-crunching doesn't mean that architecturally the kernel is still responsible for huge swathes of the computer's functionality

I typo'd that - it should be

> however just because the kernel passes control to user-space for the bulk of the driver's number-crunching doesn't mean that architecturally the kernel isn't still responsible for huge swathes of the computer's functionality

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by namibj on Friday March 26, 2021 @09:37PM (#26599060)
Granted, even ABI-stability to some extend is difficult. I remember that I have some cheap wifi adapters that aren't supported by in-tree code, but came with a CD (small diameter) that had the SDK on it. This was unfortunately for the old timespec or w/e the exact struct is called, and I could have ported it to use the new API, especially considering that there are in-tree and/or up-to-date versions for closely related chips, but honestly the lack of easily-accessible tooling for that discouraged me from doing so.

The reason I got them initially is that, some about 2.5y back, they were sold on Aliexpress for 3.50 EUR (~5$) and could do dual-band with at least 40 MHz channels, iirc maybe even 80 MHz on 5GHz. They are just tiny USB-A dongles with a USB 2.0 HighSpeed host interface, but they could do station/softAP/station+softAP, obviously restricted to a single channel.

There's a related issue of a rtl8812-au or rtl8821-au (or compatible) stick (Edimax EW-7822UAC) I got before that, with a USB 3.0 SuperSpeed host interface, intended for trying out a remote radio head point-to-point configuration using polarization-duplex with a recycled satellite-TV dish on each end, as it could do AP-mode on 80 MHz wide channels in the 5 GHz band on Linux, with a 867 Mbit/s link rate (assuming full polarization multiplexing based on the stick's 2x2 MIMO and a circular polarizing feed antenna).

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by UncleMeat on Saturday March 27, 2021 @09:55AM (#26602287)
There are many different reasons that all contribute. But Linux clearly can keep some form of stability, given their dedication to never breaking userspace, if they really want to.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by AnthonyMouse on Saturday March 27, 2021 @02:22AM (#26600385)
> The intent is to compel device manufacturers to release the source of their drivers, but at this point, I think we have to admit that's not a great description of what's happening in the mobile space.

But it's still the thing we want, for that and a lot of other reasons. So presumably what we need to do is find a way to exert more leverage, so that we actually get what we want, instead of folding and letting the bad thing take root forever.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by admax88q on Friday March 26, 2021 @11:15PM (#26599599)
I dunno, seems a stretch to blame the kernel for e-waste when theres tons of other well funded parties creating the waste in the first place with zero intention of supporting the device beyond a year, let alone enabling anyone else to support it.

The android ecosystem is already better than the completely proprietary feature phones of before.

Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by imtringued on Saturday March 27, 2021 @08:02AM (#26601709)
No, Qualcomm is responsible for that. It's their device. The idea that a third party is responsible for supporting thousands of different devices simply doesn't make sense.
Re:Fairphone suggests Qualcomm is the biggest barrier to lon... by detaro on Friday March 26, 2021 @06:07PM (#26597564)
With new Android versions come new kernel versions, and the interfaces to drivers are not stable, and I assume Android-specific interfaces also do change.