# Kernel modules not loaded after upgrading from 3.4.95-gentoo

## arcctgx

I'm trying to upgrade from kernel 3.4.95-gentoo to 3.4.96-gentoo. I emerged gentoo-sources, copied old configuration file as .config into the kernel sources directory, and then issued make oldconfig && make && make modules_install, followed by emerge @module-rebuild. I've been doing that since version 3.4.61 and I never had any problems.

This time, the kernel and its modules build without errors, but after I boot the new kernel the necessary modules are not loaded. In the previous kernel version (3.4.95-gentoo) I got:

```
> lsmod

Module                  Size  Used by

asb100                  8979  0 

hwmon_vid               2209  1 asb100

nvidia               4658414  22 

snd_ens1371            12827  4 

snd_ac97_codec         85309  1 snd_ens1371

ac97_bus                 707  1 snd_ac97_codec

snd_rawmidi            14151  1 snd_ens1371

snd_seq_device          3957  1 snd_rawmidi

snd_pcm                50985  3 snd_ac97_codec,snd_ens1371

snd_page_alloc          5382  1 snd_pcm

snd_timer              13515  2 snd_pcm

snd                    38172  12 snd_ac97_codec,snd_timer,snd_pcm,snd_rawmidi,snd_ens1371,snd_seq_device

i2c_viapro              4360  0 

soundcore               3995  1 snd
```

When I'm trying to boot my new kernel OpenRC complains that it can't access the sound card and that lm_sensors cannot be started. The system eventually stars, but lsmod doesn't list any modules. When I try to modprobe the modules by hand no errors are reported, but lsmod still doesn't list anything and the sound card and lm_sensors don't work. The module files are in the expected location (/lib/modules/3.4.96-gentoo/).

My kernel configuration is available at http://pastebin.com/SrYKeQtq. I have no idea what's happening, I can rule out hardware failure because everything works with the old kernel and in Windows. I skimmed through the 3.4.96 changelog, but didn't see anything that could be related to the issues I'm having. That's to say, any help would be appreciated. Am I missing something obvious here?

I don't know if it's relevant, but I don't really know what kind of information I can provide, so here's my emerge --info (from the working 3.4.95-gentoo kernel):

```
Portage 2.2.8-r1 (default/linux/x86/13.0/desktop, gcc-4.7.3, glibc-2.17, 3.4.95-gentoo i686)

=================================================================

System uname: Linux-3.4.95-gentoo-i686-AMD_Athlon-TM-_XP_2000+-with-gentoo-2.2

KiB Mem:     1034252 total,     28396 free

KiB Swap:     514044 total,    514032 free

Timestamp of tree: Fri, 04 Jul 2014 22:15:01 +0000

ld GNU ld (GNU Binutils) 2.23.2

app-shells/bash:          4.2_p45

dev-lang/python:          2.7.6

dev-util/cmake:           2.8.12.2

dev-util/pkgconfig:       0.28

sys-apps/baselayout:      2.2

sys-apps/openrc:          0.12.4

sys-apps/sandbox:         2.6-r1

sys-devel/autoconf:       2.69

sys-devel/automake:       1.11.6, 1.13.4

sys-devel/binutils:       2.23.2

sys-devel/gcc:            4.7.3-r1

sys-devel/gcc-config:     1.7.3

sys-devel/libtool:        2.4.2

sys-devel/make:           3.82-r4

sys-kernel/linux-headers: 3.13 (virtual/os-headers)

sys-libs/glibc:           2.17

Repositories: gentoo

ACCEPT_KEYWORDS="x86"

ACCEPT_LICENSE="* -@EULA"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=athlon-xp -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"

CXXFLAGS="-O2 -march=athlon-xp -pipe"

DISTDIR="/usr/portage/distfiles"

FCFLAGS="-O2 -march=i686 -pipe"

FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"

FFLAGS="-O2 -march=i686 -pipe"

GENTOO_MIRRORS="rsync://gentoo.prz.rzeszow.pl/gentoo http://gentoo.prz.rzeszow.pl"

LANG="pl_PL"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/home/portage/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.pl.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X a52 acl acpi alsa berkdb branding bzip2 cairo cdda cdr cleartype cli consolekit corefonts crypt cxx dbus dri dts dvd dvdr dvi encode exif fam ffmpeg firefox flac fortran gadu gdbm geoip gif gpm gtk iconv jpeg lcms libnotify lm_sensors lzma mad mmx mmxext mng modules mp3 mp4 mpeg ncurses nls nptl ogg opengl pam pango pcre pdf png policykit ppds qt4 readline reiserfs sdl session sse ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis x264 x86 xcb xml xv xvid zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="vesa nv nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

USE_PYTHON="2.7"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

----------

## Apheus

Did you do a "make modules" between "make" and "make modules_install"? If not, the modules were probably not compiled newly, but the old module files copied to the new location. I don't know how this can explain the symptoms, but anyway:

```

make oldconfig

make all

make modules_install

make install
```

"make all" compiles kernel and modules.

----------

## arcctgx

I'm afraid that's not the reason. Simply issuing "make" builds both the kernel image and the modules:

```
> make oldconfig

  HOSTCC  scripts/basic/fixdep

  HOSTCC  scripts/kconfig/conf.o

  SHIPPED scripts/kconfig/zconf.tab.c

  SHIPPED scripts/kconfig/zconf.lex.c

  SHIPPED scripts/kconfig/zconf.hash.c

  HOSTCC  scripts/kconfig/zconf.tab.o

  HOSTLD  scripts/kconfig/conf

scripts/kconfig/conf --oldconfig Kconfig

#

# configuration written to .config

#

> make

(...) [kernel image is compiled]

Setup is 15408 bytes (padded to 15872 bytes).

System is 2356 kB

CRC 82aacd79

Kernel: arch/x86/boot/bzImage is ready  (#1)

  Building modules, stage 2.

  MODPOST 21 modules

(...) [42 lines follow as the modules are compiled]

> make modules

make[1]: Nothing to be done for `all'.

make[1]: Nothing to be done for `relocs'.

  CHK     include/linux/version.h

  CHK     include/generated/utsrelease.h

  CALL    scripts/checksyscalls.sh

  Building modules, stage 2.

  MODPOST 21 modules
```

that is, nothing else happens after issuing "make modules". I installed these modules anyway, but after rebooting into the new kernel the issue still persists.

I'm going to try to build a vanilla kernel later to see if it changes anything.

----------

## sebB

 *Quote:*   

> that is, nothing else happens after issuing "make modules"

 

Like Apheus said, it's no "make modules" but "make modules_install"

----------

## arcctgx

Sorry I wasn't clear. What I did was:

1. make oldconfig

2. make

3. make modules

4. make modules_install

5. copy kernel image and System.map to an appropriate location and edit bootloader (lilo) configuration

6. boot the new kernel.

Number 4 is what I meant by "I installed these modules anyway". So I actually followed Apheus' initial suggestion.Last edited by arcctgx on Mon Jul 07, 2014 4:18 pm; edited 1 time in total

----------

## Geneslaf

I'm having exactly the same problem - System uname: Linux-3.4.95-gentoo-i686-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4400+-with-gentoo-2.2

Did a bisect between v3.4.95 and v3.4.96 vanilla kernels and the first bad commit ended up as https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=d3007333170435135f0620fb52386aad3fb2a14f

Tried the 3.15.3 vanilla kernel and modules loaded OK. I am going to try the 3.10 line next to see if problem persists.

One odd thing I discovered while testing was that stracing the modprobe command got the modules to load e.g. "strace modprobe k8temp" and the module loads OK - without the strace it would not load.

----------

## Apheus

 *arcctgx wrote:*   

> I'm afraid that's not the reason. Simply issuing "make" builds both the kernel image and the modules

 

Oh, I did not test it, but skimmed through "make help". I guessed it would be included in "modules_install", but is not. I did not think about inclusion in "make". But what use is "make all" anyway if there is no difference to "make"?

----------

## arcctgx

I compiled vanilla 3.4.96 and 3.4.97 kernels from kernel.org, and I'm still having the same problem.

 *Geneslaf wrote:*   

> One odd thing I discovered while testing was that stracing the modprobe command got the modules to load

 

Yes, it also works like this in 3.4.97.

Who should we report this issue to? Should we bug gentoo-sources maintainers first, or maybe report that directly to kernel devs?

----------

## Geneslaf

 *arcctgx wrote:*   

> Who should we report this issue to? Should we bug gentoo-sources maintainers first, or maybe report that directly to kernel devs?

 

I did a bit more investigating and I think its a kernel problem so I bug reported it to the Kernel Bug Tracker https://bugzilla.kernel.org/show_bug.cgi?id=79661. Hopefully someone who understands the code will see it.

----------

## Geneslaf

Have a work around if you want it - I placed the patch below in /etc/portage/patches/sys-apps/kmod-17/broken-finit_module.patch and re emerged sys-apps/kmod. Patch is applied via epatch_user. Now just need to remember to remove it when the underlying problem is fixed in the kernel.

```
--- kmod-17/libkmod/missing.h.orig   2014-07-08 17:10:26.692045946 +0100

+++ kmod-17/libkmod/missing.h   2014-07-08 17:11:11.264769757 +0100

@@ -24,6 +24,10 @@

 

 static inline int finit_module(int fd, const char *uargs, int flags)

 {

+   /* finit_module syscall broken on linux-3.4.9[67] */

+   errno = ENOSYS;

+   return -1;

+

    if (__NR_finit_module == -1) {

       errno = ENOSYS;

       return -1;

```

----------

## arcctgx

 *Geneslaf wrote:*   

> I think its a kernel problem so I bug reported it to the Kernel Bug Tracker

 

That's good to know. Your bug report is much better than mine would have been. Also, thanks for the patch, but I think I'll just stay with 3.4.95-gentoo for the time being and see how the situation develops.

EDIT: this bug has been fixed upstream in 3.4.101.

----------

