Long Linaro boot time - release 19.01 build


#1

Dear all,

I have an experience to long delay (about 110 secs from uptime) to launch LXQt with 19.01 release. It was never happened before with 18.01 and 17.09 release (usually 23 secs from uptime). So, I did some research for how to find a cause likes below.

sudo dmesg > dmesg.txt
nano dmesg.txt

It seems ‘random’ should be a reason.

[   19.347778] Bluetooth: BNEP socket layer initialized
[   19.683312] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   19.962345] wcn36xx: firmware WLAN version 'WCN v2.0 RadioPhy vRhea_GF_1.12 with 19.2MHz XO' and CRM version 'CNSS-PR-2-0-1-2-c1-74-130449-3'
[   19.963872] wcn36xx: firmware API 1.5.1.2, 41 stations, 2 bssids
[   20.003513] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   20.339247] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   72.378323] random: crng init done
[   72.378795] random: 7 urandom warning(s) missed due to ratelimiting
[   72.506690] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

It looks like my kernel is wasting over 52 seconds to initialize random number generator. Peoples are said, in this case I need to install ‘haveged’. I did it likes below.

sudo apt-get install haveged
sudo systemctl enable haveged
sudo systemctl start haveged

And reboot to confirm. It is now reduced from 52 secs to 39 secs, as below.

[   21.005713] wcn36xx: firmware WLAN version 'WCN v2.0 RadioPhy vRhea_GF_1.12 with 19.2MHz XO' and CRM version 'CNSS-PR-2-0-1-2-c1-74-130449-3'
[   21.032065] wcn36xx: firmware API 1.5.1.2, 41 stations, 2 bssids
[   21.075566] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   21.438553] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   60.002691] random: crng init done
[   60.003162] random: 7 urandom warning(s) missed due to ratelimiting
[   60.124356] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

Now I’m in kinds of stuck. Still my random number generator spend 39 secs. Not only for this, it seems some more reason. Anybody have had similar experience with me? Please let me know if you have a neat solution for this.


#2

It looks like there is an issue with the entropy pool which seems due to both a security fix [1] of the get_random syscall (which now blocks until entropy pool is ready) and to an issue in the msm hardware number generator driver which does not register properly to the hwrng core (hwrng quality not defined).

As a workaround you can try to create a /etc/modprobe.d/rng_core.conf file with the following content:

options rng_core default_quality=700

And sync/reboot:

We’ll try to fix the driver directly for next build.

[1] https://lwn.net/Articles/724643/


#3

You can also simply install rng-tools which will feed /dev/random from /dev/hwrng at init.


#4

Dear Loic, it works. Uptime is now reduced to 26secs. Great!! Thanks for your efforts!
BTW, do you folks have any plan to re-release 19.01?


#5

Well, the 19.01 has never been officially announced, but yes, the team is currently working on fixing few remaining issues.


#6

Hi @Loic,

Do you know if there has been any fix yet to the MSM hardware RNG?

I’m seeing this on the 820; not with all boards but some of them are exhibiting the same behaviour and taking many minutes to finish boot and start X. On that chip the rng_core.conf mod does not do anything, and nor does rng-tools. rng-tools gives the error:

$ sudo /etc/init.d/rng-tools start
Starting Hardware RNG entropy gatherer daemon: (Hardware RNG device inode not found)
/etc/init.d/rng-tools: Cannot find a hardware RNG device to use.

Many thanks


#7

This has been fixed in 19.01 release.

AFAIK, rng is not enabled on 820c, maybe you could try the following patch/workaround:
https://git.linaro.org/people/loic.poulain/linux.git/commit/?h=qcomlt-4.14-hwrng&id=b21a09c5618dc925da28095b2613a16fdb05efeb