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>
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)