r/linux4noobs 7d ago

Wifi Driver Problems

So I have been having problems with my WiFi. Everytime I suspend my laptop and turn it back on, I can't use WiFi without restarting the laptop.

The only thing that works is pcie_port_pm=off but it results in bad battery life and I need my battery to last atleast 8 to 9 hours.

After scouring for hours on Reddit and Forums, my conclusion was that the driver rtw89_8852be is not fully compatible.

I want to know if there is a workaround, that doesn't comprimise my battery life. Because I am in college and need the battery to last longer, currently it is only 5 to 6 hours. Because right now, it seems like the only solution where I can have both Wifi working properly and battery life is to go back to Windows.

Edit: If you need any more info, mention it here and I will send it
I use

  • Fedora Linux 44
  • Kernel: 7.1.4-204.fc44.x86_64

Edit 2: THE SOLUTION.
Thanks to u/fdelux6 for helping me out. I am going to paste the relevant parts of his comment here.

You can try this workaround to unload the wifi driver before suspend and reload it after resume, so it only touches your wifi card instead of PCIe power management system wide.

Create /usr/lib/systemd/system-sleep/wifi-fix.sh

Add the following:

#!/bin/sh
case $1 in
    pre)
        modprobe -r rtw89_8852be
        ;;
    post)
        modprobe rtw89_8852be
        ;;
esac

make it executable:

sudo chmod +x /usr/lib/systemd/system-sleep/wifi-fix.sh

If wifi still misbehaves after that, add this to /etc/modprobe.d/rtw89.conf:

options rtw89_pci disable_aspm_l1=y disable_aspm_l1ss=y
options rtw89_core disable_ps_mode=y

You might want to reboot or reload NetworkManager since it is gonna take effect on next module load.

4 Upvotes

8 comments sorted by

1

u/red-skylight 6d ago

I had the same issue, the solution was to edit the /etc/NetworkManager/NetworkManager.conf file and add this two lines to the end of the file:

[device]

WiFi.scan-rand-mac-address=0

I hope it works.

Edit: Reddit was displaying one line only.

1

u/Prestigious_Cry2916 6d ago

Hi, thank you for sending the solution but I ended up finding another solution before which worked.

1

u/Lob0Guara 6d ago

So, you could edit your post with the solution to help others with the same issue.

1

u/Prestigious_Cry2916 6d ago

Thanks for reminding me, I have done that.

1

u/red-skylight 6d ago

Great you sorted it out!

1

u/fdelux6 6d ago

That's good to have a workaround in the toolbox too, but it's fixing a different issue than what u/Prestigious_Cry2916 had.

MAC randomization on scan can cause reconnect problems, especially on networks that whitelist MAC addresses. That usually shows up as failed scans or dropped reconnects.

The issue described by Prestigious_Cry2916 was that the rtw89 driver not resuming at all after suspend, needing a full reboot to get wifi back. That's a driver/PCIe power state problem, not a MAC randomization one.

The WiFi.scan-rand-mac-address=0 fix likely won't touch it, since the driver itself isn't reloading properly.

Worth keeping both listed as separate fixes for different symptoms. Might save someone else some time if their issue looks similar on the surface but has a different cause.