Drivers and modules not working after updating kernel

On my Lenovo X1 laptop with a fresh Fedora 38 installed, everything works fine. But every time I run sudo dnf update and new kernel version is installed, on next reboot if the new kernel is being used, many components stop loading (no network, no external monitor, and probably some other stuff, but most important one is network for now). I tried upgrading to Fedora 39, kernel was updated and everything was working fine again until I ran dnf update and then same issue, I cannot see network related tweaks/interfaces/modules. (I don’t see wifi/bluetooth/keyboard settings in gnome top menu bar tweaks)

For now only solution for me is switch back to the kernel version which was working using sudo grubby --set-default-index=X.

Here are some commands and their output when booting the system with new kernel versions:

Cannot load wifi module:

$ uname -r
6.6.4-200.fc39.x86_64

$ modprobe -nv iwlwifi
modprobe: FATAL: Module iwlwifi not found in directory /lib/modules/6.6.4-200.fc39.x86_64

I can see the module for older kernel version:

$ ls /usr/lib/modules/6.6.4-200.fc39.x86_64/kernel/drivers/net/wireless/intel/iwlwifi
dvm  mvm 

$ ls /usr/lib/modules/6.6.2-201.fc39.x86_64/kernel/drivers/net/wireless/intel/iwlwifi 
dvm  iwlwifi.ko.xz  mvm 

I have iwlwifi related packages installed:

$ sudo dnf list installed | grep iwl 
iwlegacy-firmware.noarch                             20231111-1.fc39                               @updates    
iwlwifi-dvm-firmware.noarch                          20231111-1.fc39                               @updates    
iwlwifi-mvm-firmware.noarch                          20231111-1.fc39                               @updates  

It seems the hardware is being recognized:

lspci 
...
00:14.3 Network controller: Intel Corporation Alder Lake-P PCH CNVi WiFi (rev 01) 
...

No network interface:

 ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever

dmesg output does not contain anything about network/wifi.

I’d appreciate any help.

The file should be installed by kernel-modules:

$ rpm -qf /usr/lib/modules/6.6.4-200.fc39.x86_64/kernel/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko.xz 
kernel-modules-6.6.4-200.fc39.x86_64

Please attach output of rpm -qa | grep -E '(kernel|firmware)' | sort.

1 Like

Thanks for quick response. Here’s the output:


$  rpm -qa | grep -E '(kernel|firmware)' | sort 
abrt-addon-kerneloops-2.17.1-3.fc39.x86_64
alsa-sof-firmware-2023.09.2-1.fc39.noarch
amd-gpu-firmware-20231111-1.fc39.noarch
amd-ucode-firmware-20231111-1.fc39.noarch
atheros-firmware-20231111-1.fc39.noarch
atmel-firmware-1.3-30.fc39.noarch
brcmfmac-firmware-20231111-1.fc39.noarch
intel-gpu-firmware-20231111-1.fc39.noarch
iwlegacy-firmware-20231111-1.fc39.noarch
iwlwifi-dvm-firmware-20231111-1.fc39.noarch
iwlwifi-mvm-firmware-20231111-1.fc39.noarch
kernel-6.6.2-201.fc39.x86_64
kernel-core-6.6.2-201.fc39.x86_64
kernel-core-6.6.3-200.fc39.x86_64
kernel-core-6.6.4-200.fc39.x86_64
kernel-devel-6.6.2-201.fc39.x86_64
kernel-devel-6.6.3-200.fc39.x86_64
kernel-devel-6.6.4-200.fc39.x86_64
kernel-devel-matched-6.6.4-200.fc39.x86_64
kernel-headers-6.6.3-200.fc39.x86_64
kernel-modules-6.6.2-201.fc39.x86_64
kernel-modules-core-6.6.2-201.fc39.x86_64
kernel-modules-core-6.6.3-200.fc39.x86_64
kernel-modules-core-6.6.4-200.fc39.x86_64
kernel-modules-extra-6.6.2-201.fc39.x86_64
kernel-srpm-macros-1.0-20.fc39.noarch
libertas-firmware-20231111-1.fc39.noarch
libreport-plugin-kerneloops-2.17.11-3.fc39.x86_64
linux-firmware-20231111-1.fc39.noarch
linux-firmware-whence-20231111-1.fc39.noarch
mt7xxx-firmware-20231111-1.fc39.noarch
nvidia-gpu-firmware-20231111-1.fc39.noarch
realtek-firmware-20231111-1.fc39.noarch
zd1211-firmware-1.5-14.fc39.noarch

It seems I’m missing kernel-modules-6.6.4-200.fc39.x86_64 (I have only kernel-modules-core-6.6.4-200.fc39.x86_64). Is there a way to install it manually?

You’re missing more stuff. By default, you should have kernel, kernel-core, kernel-modules, kernel-modules-core, kernel-modules-extra. You only have -core parts, so 2 out of 5. How did this happen? And why is not dnf update trying to update the main kernel package?

Do you have some custom exclude rules in /etc/dnf/dnf.conf? What happens if you run sudo dnf update 'kernel*', and sudo dnf update --best 'kernel*'?

1 Like

I think I don’t have any explicit exclude rule. here’s my dnf conf:

$ cat /etc/dnf/dnf.conf                           
# see `man dnf.conf` for defaults and possible options

[main]
gpgcheck=True
installonly_limit=5
clean_requirements_on_remove=True
best=True
skip_if_unavailable=True

And running updates for kernel*:

$ sudo dnf update 'kernel*'                                         
Last metadata expiration check: 0:12:28 ago on Fri 08 Dec 2023 10:34:16 AM CET.
Dependencies resolved.
Nothing to do.
Complete!

$ sudo dnf update --best 'kernel*'                                         
Last metadata expiration check: 0:12:33 ago on Fri 08 Dec 2023 10:34:16 AM CET.
Dependencies resolved.
Nothing to do.
Complete!

Is there any other places to look at for exclude rules? It’s actually weird as upgrading from f38 to f39 worked well, but normal updates don’t.

Thank you @kparal for the hints. I ran

$ sudo dnf install kernel-modules-extra-6.6.4-200.fc39.x86_64                        

And it installed the missing packages. Now I’ve got:

rpm -qa | grep -E '(kernel|firmware)' | sort | grep 6.6.4                          
kernel-core-6.6.4-200.fc39.x86_64
kernel-devel-6.6.4-200.fc39.x86_64
kernel-devel-matched-6.6.4-200.fc39.x86_64
kernel-modules-6.6.4-200.fc39.x86_64
kernel-modules-core-6.6.4-200.fc39.x86_64
kernel-modules-extra-6.6.4-200.fc39.x86_64

I see the wifi modules and iwlfifi being loaded correctly during the boot:

$ ls /usr/lib/modules/6.6.4-200.fc39.x86_64/kernel/drivers/net/wireless/intel/iwlwifi
dvm  iwlwifi.ko.xz  mvm

$ dmesg| grep iwlwifi
[   58.256883] iwlwifi 0000:00:14.3: enabling device (0000 -> 0002)
...
[   58.457460] iwlwifi 0000:00:14.3: Detected Intel(R) Wi-Fi 6E AX211 160MHz, REV=0x370
...

You’ve certainly touched it before. installonly_limit is 3 by default, and best is False by default. Try at least switching the best back to default.

Not sure. Look at everything under /etc/dnf.

That’s nice, but I’m not sure if it resolves the problem. It might happen again with the next kernel update. It would be good to figure out why you don’t get updated all kernel* packages and just the -core ones. You can look into sudo dnf history kernel and see when it started happening. Also try to remember all tweaks that you performed that could affect this. Why do you have kernel-devel* packages installed?

Also, make sure to install the top-level kernel-6.6.4-200.fc39.x86_64 package, at least manually.

It seems to have missed the kernel-6.6.4 package, which is the meta package used to install all the others.

 # rpm -qa | grep -E '(kernel|firmware)' | sort | grep 6.6.4
kernel-6.6.4-200.fc39.x86_64
kernel-core-6.6.4-200.fc39.x86_64
kernel-devel-6.6.4-200.fc39.x86_64
kernel-devel-matched-6.6.4-200.fc39.x86_64
kernel-modules-6.6.4-200.fc39.x86_64
kernel-modules-core-6.6.4-200.fc39.x86_64
kernel-modules-extra-6.6.4-200.fc39.x86_64
1 Like

You’ve certainly touched it before.

You’re right. I changed installonly_limit this morning only to avoid removing “working” kernels when I run updates. I changed best just after running other commands today. I reverted it to False now.

Also, make sure to install the top-level kernel-6.6.4-200.fc39.x86_64 package, at least manually.

Done it manually now.

Also checked /etc/dnf, it doesn’t seem to be anything related to kernel* (checked manually contents of some of them):

tree /etc/dnf 
/etc/dnf
├── aliases.d
├── dnf.conf
├── modules.d
│   └── nodejs.module
├── modules.defaults.d
├── plugins
│   ├── copr.conf
│   ├── copr.d
│   └── debuginfo-install.conf
├── protected.d
│   ├── fedora-workstation.conf
│   ├── grub2-efi-ia32.conf
│   ├── grub2-efi-x64.conf
│   ├── grub2-pc.conf
│   ├── grub2-tools-minimal.conf
│   ├── setup.conf
│   ├── shim.conf
│   ├── sudo.conf
│   └── systemd.conf
└── vars

Example:

cat /etc/dnf/protected.d/fedora-workstation.conf 
NetworkManager
gnome-shell

I will continue checking other configs and see if on the next update it still happens. At least for now I have a manual solution.