TheAlexDev23 / power-options

Linux GUI application for blazingly fast and simple power-management.
MIT License
240 stars 1 forks source link

Intel Wifi Driver Param Changes Causes Unloadable Driver #25

Closed scherfan closed 3 weeks ago

scherfan commented 1 month ago

Any profile that adds any iwlwifi parameters is causing the driver to fail to load when power-options reloads the network drivers. The symptoms are: after the reload, the wifi interface ceases to exist, iw does not see a device or adapter, and ip does not list the wifi interface. I tried to unload the iwlwifi and iwlmvm and then reload them but the behavior remains. Turning off all wifi driver params and rebooting at least reverts the issue.

When a param is enabled and the driver fails to reload, dmesg reports:

[ 1052.608217] wlan0: deauthenticating from a2:b5:3c:2a:c2:aa by local choice (Reason: 3=DEAUTH_LEAVING)
[ 1052.762450] iwlwifi 0000:aa:00.0: Unregistering PHC clock: iwlwifi-PTP, with index: 0
[ 1053.522493] PTP clock support registered
[ 1053.626350] Intel(R) Wireless WiFi driver for Linux
[ 1053.638966] pci 0000:aa:00.0: Resources present before probing

lspci -k shows this:

aa:00.0 Network controller: Intel Corporation Wi-Fi 6E(802.11ax) AX210/AX1675* 2x2 [Typhoon Peak] (rev 1a)
Subsystem: Intel Corporation Wi-Fi 6 AX210 160MHz
Kernel modules: iwlwifi

Hardware is a Framework 13, Intel Core Ultra 5 125H. Software is kernel 6.11.1.arch1-1, with iwd and NetworkManger.

TheAlexDev23 commented 1 month ago

Are there any modprobe related errors within the daemon log (journalctl -u power-options)

scherfan commented 1 month ago

No doesn't look like it. Profile switching was working earlier this week. That's why I mentioned the kernel update, as far as I can tell that was the major change. I'll try downgrading a little later today and see if that sheds some light on this.

scherfan commented 1 month ago

Okay yep, something with 6.11 is causing the issue. Downgrading to 6.10.10 allows power-options to restart the wifi interface without issue.

TheAlexDev23 commented 1 month ago

I don’t have such deep knowledge of the kernel and kernel modules to even guess whether this is an issue on behalf of power-options or a bug within Linux/iwlwifi. Reading the 6.11 changelog, there aren’t changes that could possibly affect this, at least that’s what it seems like.

Please notify me if you find any other info regarding this and if I need to fix something within power-options.

vladislav06 commented 1 month ago

Same issue here, if power-options disables wifi card and/or ethernet controller, it cant enable them back. Lenovo legion 15ACH6

scherfan commented 4 weeks ago

Will be able to do some testing/debugging this week. Hopefully we can find the issue.

scherfan commented 4 weeks ago

Okay so now after updating power-options to 1.2 and the kernel to 6.11 I am not even getting the network restart, looks like the modprobe calls are failing. Here is the journalctl for power-options: Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying profile: Powersave++ Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying Sleep settings on ThreadId(16) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying Radio settings on ThreadId(20) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying CPU settings on ThreadId(23) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying USB settings on ThreadId(19) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying SATA settings on ThreadId(17) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying ASPM settings on ThreadId(18) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying Network settings on ThreadId(22) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying Kernel settings on ThreadId(25) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying PCI PM settings on ThreadId(18) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying RAPL settings on ThreadId(17) Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying Screen settings on ThreadId(24) Oct 15 13:00:07 framework power-daemon-mgr[297961]: ERROR ==> [power_daemon::sysfs::writing]: Error writing "100" to path /sys/class/drm/card1/gt_min_freq_mhz:> Oct 15 13:00:07 framework power-daemon-mgr[297961]: ERROR ==> [power_daemon::sysfs::writing]: Error writing "553" to path /sys/class/drm/card1/gt_max_freq_mhz:> Oct 15 13:00:07 framework power-daemon-mgr[297961]: ERROR ==> [power_daemon::sysfs::writing]: Error writing "754" to path /sys/class/drm/card1/gt_boost_freq_mh> Oct 15 13:00:07 framework power-daemon-mgr[297961]: ERROR ==> [power_daemon::sysfs::rapl]: Unexpected intel rapl interface. Expected package-0, core or uncore Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [power_daemon::profile]: Applying CPU core settings on ThreadId(23) Oct 15 13:00:07 framework power-daemon-mgr[297961]: WARN ==> [power_daemon::sysfs::writing]: Attempted to write 1 to CPU sysfs path /sys/devices/system/cpu/cpu> Oct 15 13:00:07 framework power-daemon-mgr[348898]: Authorization required, but no authorization protocol specified Oct 15 13:00:07 framework power-daemon-mgr[348898]: xset: unable to open display ":0" Oct 15 13:00:07 framework power-daemon-mgr[348900]: modprobe: FATAL: Module iwlmvm not found. Oct 15 13:00:07 framework power-daemon-mgr[348903]: modprobe: FATAL: Module iwlwifi not found. Oct 15 13:00:07 framework power-daemon-mgr[348905]: Authorization required, but no authorization protocol specified Oct 15 13:00:07 framework power-daemon-mgr[348905]: Couldn't connect to :0 Oct 15 13:00:07 framework power-daemon-mgr[348906]: modprobe: FATAL: Module iwlmvm not found in directory /lib/modules/6.11.2-arch1-1 Oct 15 13:00:07 framework power-daemon-mgr[348907]: modprobe: FATAL: Module iwlwifi not found in directory /lib/modules/6.11.2-arch1-1 Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [D-BUS]: get_profiles_info Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [D-BUS]: get_config Oct 15 13:00:07 framework power-daemon-mgr[297961]: INFO ==> [D-BUS]: get_profile_override

TheAlexDev23 commented 4 weeks ago

Does modinfo iwlwifi also not return anything?

scherfan commented 4 weeks ago

It did not in the state above. Now that I've rebooted and reapplied the settings I am back to the previous behavior, no modprobe events in journalctl, modinfo iwlwifi does list the driver but its like the device does not exist.

TheAlexDev23 commented 4 weeks ago

I'm on 6.11 too with no issues, maybe it's a bug in some specific hardware? Or maybe there are some module parameters that power-options enables that are unstable or cause crashes. If you manually reload the wifi modules with no custom params does that also fail?

scherfan commented 4 weeks ago

Interesting, yeah unloading and then reloading iwlmvm and iwlwifi (without params) isn't working on the reload. lsmod shows the modules are there and loaded, but iwd and NetworkManager don't seem to pickup the wifi card. Am I missing something with udev to create the interface?

TheAlexDev23 commented 4 weeks ago

I don't know that much about low level hardware and kernel modules, but I'd assume that you can't really do much with udev in this situation, NetworkManager should usually handle this by itself, or at least that's the case for me unless my distro does something that I'm not aware of. Plus, the only events you can manage from udev is when a network interface is added/removed, but if yours isn't being recognized, I don't even think udev will respond to the event.

You should consider asking in a kernel-related forum or the manufacturer whether this is a known issue or not, given that you mentioned that you use framework, I'd assume that they are quite likely to still provide you support even if you use linux.

scherfan commented 3 weeks ago

Thanks for your patience and guidance, I think you can close this issue. After some downgrading it has something to do with the most recent firmware of iwlwifi and 6.11 (and maybe even specifically with my wifi card). Saw a bug report for Ubuntu: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2083256 and someone else with my same card is having issues with Arch.

TheAlexDev23 commented 3 weeks ago

Hope you find a fix for your problem. Consider dropping a link for future readers if you ever find the solution.

scherfan commented 3 weeks ago

Will do, and will test later firmware updates. For now, I have switched to the LTS kernel which seems to be the simplest work around.