diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2018-12-18 21:24:28 +0200 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2018-12-18 22:04:23 +0200 |
commit | 876c7f5bfb9b13d48e6d7960dd114082a0a95a6d (patch) | |
tree | efb2a97f2586bc9a65671403f2a00be7c9664f11 /kmodloader.c | |
parent | 128bc35fa951ac3beff6e977bc3cced87c2e2600 (diff) | |
download | ubox-876c7f5bfb9b13d48e6d7960dd114082a0a95a6d.tar.gz |
kmodloader: load_modprobe: abort after 2 attempts
The loop in load_modprobe causes dmesg to be flooded with errors when a
module fails to load; e.g.:
- gpio-nct5104d: Unsupported device 0xffff (246 times on x86 in Qemu)
- jitterentropy: Initialization failed with host not compliant with
requirements: 2 (229 times on brcm2708/bcm2708)
On brcm2708/bcm2708 this also causes vmalloc allocation failures with
kernel 4.14 when running headless. If kmod-drm-vc4 and
kmod-video-bcm2835 are included in the image, they will be loaded before
brcmfmac, and brcmfmac will fail to load:
kmodloader: vmalloc: allocation failure: 249856 bytes,
mode:0x14000c0(GFP_KERNEL), nodemask=(null)
Break the loop after 2 failed attempts to fix these issues.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Diffstat (limited to 'kmodloader.c')
-rw-r--r-- | kmodloader.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kmodloader.c b/kmodloader.c index 1b6488f..3196deb 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -637,14 +637,16 @@ static int load_modprobe(void) if (mn->is_alias) continue; m = mn->m; - if ((m->state == PROBE) && (!deps_available(m, 0))) { + if ((m->state == PROBE) && (!deps_available(m, 0)) && m->error < 2) { if (!insert_module(get_module_path(m->name), (m->opts) ? (m->opts) : (""))) { m->state = LOADED; m->error = 0; loaded++; continue; } - m->error = 1; + + if (++m->error > 1) + ULOG_ERR("failed to load %s\n", m->name); } if ((m->state == PROBE) || m->error) |