Fix kernel modules auto loading

496 views
Skip to first unread message

Chih-Wei Huang

unread,
Aug 14, 2016, 2:00:04 AM8/14/16
to Android-x86 development, Android-x86
Hi devs,
You may know currently the kernel modules
are auto probed and loaded in two ways:

* In the pre-init stage (scripts in initrd.img),
the script (0-auto-detect) scans
/sys/bus/*/devices/*/uevent etc
to load modules with matched modalias.
* After entered android init, ueventd service
start to monitor module add uevents.

However, it's not elegant and causes some
know issues like

* modules may be loaded in an unexpected order.
It depends on the (reverse) alpha order of the
modules.alias file that causes some known issues.
* some necessary modules are not loaded

I've thought to improve the modules loading
problem for a long time. The main plan is to
remove module loading in 0-auto-detect script
and use ueventd only.
However, the ueventd module loading is still
buggy so that it's hard to replace 0-auto-detect.

I've just spent a whole day to debug ueventd.
Surprisedly I finally found a simple one line fix.
(except another supplementary fix to increase
the coldboot done time and the refactory of
firmware loading which is merged last month)

https://sourceforge.net/p/android-x86/system_core/ci/marshmallow-x86/tree/
https://sourceforge.net/p/android-x86/bootable_newinstaller/ci/marshmallow-x86/tree/

The module loading order is now resolved by
transverse the /sys/devices/ dir.
I believe it's more appropriate.
At least, it works well on all my devices
that have module loading issues before.
For example, the "no sound" issue on some
of my Skylake devices is fixed by the changes.

The only issue I notice so far is some
unnecessary modules are loaded unexpectedly.
For example, the wl driver is loaded even
my device doesn't have the Broadcom chip.
The correct wifi driver is still loaded so it
doesn't cause a real problem except
wasting memory. I'm still debugging it.

I'd like to ask all of you to test these changes
to see if it also works well on your devices.
If there is no explicit regression, I'll include them
in the coming 6.0-rc2 next week.


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Jaap Jan Meijer

unread,
Aug 15, 2016, 4:34:22 PM8/15/16
to Android-x86 development, Android-x86
Hi,

Thanks for trying to optimize this. While merging I noticed the
CyanogenMod team is also struggling with this for a while now:
https://github.com/CyanogenMod/android_system_core/commit/0373c8deeb21f116354676116cf58e76a94d46a3
I guess 10 seconds would be more appropriate in our situation.
Message has been deleted

Jaap Jan Meijer

unread,
Sep 12, 2016, 12:08:35 PM9/12/16
to Android-x86 development, andro...@googlegroups.com
Op maandag 15 augustus 2016 22:34:04 UTC+2 schreef Jaap Jan Meijer:



Hi,

A bit late but I noticed due to this change gpio_ keys and soc_button_array are loaded before i2c_designware. This causes the volume buttons on my BayTrail tablet to not be detected (and probably more issues on other devices). An easy fix would be to build i2c_designware into the kernel?

Another issue is the battery is no longer detected on the same tablet, this might be related. Strange enough reverting the kernel config update for M rc2 (7700d50) fixes this. No more details at this moment.
Message has been deleted

youling 257

unread,
Jan 13, 2017, 5:04:04 PM1/13/17
to Android-x86, android-...@googlegroups.com
https://sourceforge.net/p/android-x86/bootable_newinstaller/ci/8c73ac1a261c708eef7817c625a041cf1b3ca427/

it will auto load modules before type exit on debug mode ,it will auto load soc-rt5645 . When type twice exit to boot android, will ignore /etc/modules.blacklist and load rt5640 .

x86:/ $ su
x86:/ # dmesg | grep 5640
[   11.851678] i2c-10EC5640:00 supply avdd not found, using dummy regulator
[   11.851749] i2c-10EC5640:00 supply cpvdd not found, using dummy regulator
[   11.852574] rt5645 i2c-10EC5640:00: Device with ID register 0x6231 is not rt5645 or rt5650
[   12.377387] bytcr_rt5640 bytcr_rt5640: quirk IN3_MAP enabled
[   12.377576] bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF1 enabled
[   12.377734] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled
[   12.391012] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> media-cpu-dai mapping ok
[   12.391312] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <-> deepbuffer-cpu-dai mapping ok
[   12.393247] bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp0-port mapping ok

is it possible ignore /etc/modules.blacklist modules before type exit ?

don't use this https://sourceforge.net/p/android-x86/bootable_newinstaller/ci/8c73ac1a261c708eef7817c625a041cf1b3ca427/  patch,type exit after load modules,so i use /etc/modules.blacklist,not load soc-rt5645 

CC

unread,
Jan 14, 2017, 1:07:54 PM1/14/17
to Android-x86
I am still finding ways to connect 4g on Android x86 for my car PC. Is it possible to support new 4g modem (like huawei me909s,ZTE modems) in the new 6.0 OS?

Chih-Wei Huang

unread,
Jan 17, 2017, 12:09:11 AM1/17/17
to Android-x86
The purpose of the commit is to load input related modules.
The current implementation loads too many modules.
I agree it's not good. But I don't have a simpler or better
way to do it yet.

In this case, I guess we could ignore all sound/core modules
(like we did for kms modules).

I'm glad to hear if there is a better method.


2017-01-14 5:47 GMT+08:00 youling 257 <youli...@gmail.com>:
> https://sourceforge.net/p/android-x86/bootable_newinstaller/ci/8c73ac1a261c708eef7817c625a041cf1b3ca427/
>
> it will auto load modules before type exit on debug mode ,it will auto load
> soc-rt5645 . But when type twice exit to boot android, will load
> /etc/modules.blacklist and modules rt5640 .
>
> x86:/ $ su
> x86:/ # dmesg | grep 5640
> [ 11.851678] i2c-10EC5640:00 supply avdd not found, using dummy regulator
> [ 11.851749] i2c-10EC5640:00 supply cpvdd not found, using dummy regulator
> [ 11.852574] rt5645 i2c-10EC5640:00: Device with ID register 0x6231 is not
> rt5645 or rt5650
> [ 12.377387] bytcr_rt5640 bytcr_rt5640: quirk IN3_MAP enabled
> [ 12.377576] bytcr_rt5640 bytcr_rt5640: quirk SSP0_AIF1 enabled
> [ 12.377734] bytcr_rt5640 bytcr_rt5640: quirk MCLK_EN enabled
> [ 12.391012] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <->
> media-cpu-dai mapping ok
> [ 12.391312] bytcr_rt5640 bytcr_rt5640: snd-soc-dummy-dai <->
> deepbuffer-cpu-dai mapping ok
> [ 12.393247] bytcr_rt5640 bytcr_rt5640: rt5640-aif1 <-> ssp0-port mapping
> ok
>
> is it possible load /etc/modules.blacklist before type exit ?
>
> before this
Reply all
Reply to author
Forward
0 new messages