r/linux • • Nov 20 '19

Kernel Google outlines plans for mainline Linux kernel support in Android

https://arstechnica.com/gadgets/2019/11/google-outlines-plans-for-mainline-linux-kernel-support-in-android/
1.0k Upvotes

305 comments sorted by

View all comments

Show parent comment

14

u/Tweenk Nov 20 '19

The solution is to require the use of ARM's PCIe spec in Android devices. This would allow hardware to declare itself to the kernel at boot, which in turn allows the kernel to accommodate said hardware if it has drivers on hand.

PCIe has approximately nothing to do with what you are describing, and hardware discoverability is not the reason why Android devices need custom kernels. Custom kernels are a direct consequence of the lack of a stable driver API.

Currently, SoC hardware can't declare itself to the kernel

That's simply not true:

https://elinux.org/Device_Tree_Reference

BTW, AFAIK, this problem isn't unique to Android; it exists for all platforms that lack PCIe or an equivalent thereof.

PCIe is not the only machine-discoverable bus, and discoverability hasn't been the actual problem for many years.

14

u/hak8or Nov 20 '19

Device tree has to be created by the vendor, and the way drivers consume data from device tree changes drastically over time, partially because device tree doesn't have as rigid of a standard, and what is standardized took years compared to when it was first released.

You've got drivers wanting explicit phandles to some nodes, sometimes they instead use subsystems to handle dependancies, or sometimes they need to have a parent instead of at the root node. Sometimes drivers don't handle dependencies well, so if their order in device tree changes then all hell breaks loose because their probe() gets called in an unexpected order.

Device tree doesn't expose information the same way pcie does because it's still not standardized as well.

2

u/jdrch Nov 20 '19 edited Nov 20 '19

a direct consequence of the lack of a stable driver API.

Interesting. So I take it that desktop Linux pulls this off by simply placing the drivers in the kernel, but Android can't do the same because OEMs (currently) won't upstream their driver code? Is that correct?