Skip Navigation

Suspension on my laptop (closing the lid) causes Wifi to not be available.

Hi, this is a long lasting problem that I didn't really manage to fix when I started using linux (Mint, Cinnamon). But now that I've been using it regularly for half a year and I have more experience in fiddling around, I'm trying to get it resolved.

Whenever I suspend the laptop (or close the lid, which does it automatically) the Wifi and sometimes an external monitor don't work anymore, I don't know what the problem is. The wifi is fixed by powering on and off again. To fix the monitor sometimes even powering off and on again didn't fix it, I usually waited for the next day and it worked again.

I've no idea of how to fix this (Linux Mint forums didn't help at the time)

Laptop is an MSI GS65-Stealth-Thin-8RF running Linux Mint, with Cinnamon Desktop

journalctl output: https://sharetext.me/q7eo87psmq

You're viewing a single thread.

33 comments
  • You need to unload your wifi module before suspend.

    Without systemd it's easy:

    create a file /etc/pm/config.d/config containing:

     undefined
        
    HOOK_BLACKLIST="wireless"
    SUSPEND_MODULES=”NAME_OF_YOUR_WIFI_MODULE”
    SUSPEND_MODULES=”wl”
    
      

    With systemd try this

    create a file /usr/lib/systemd/system-sleep/fix-wifi.sh containing (fuck this editor, replace the "##" with "&&") :

     undefined
            #!/bin/bash
        [ "$1" = "post" ] ## exec /usr/sbin/modprobe NAME_OF_YOUR_WIFI_MODULE
        [ "$1" = "pre" ] ## exec /usr/sbin/modprobe -r NAME_OF_YOUR_WIFI_MODULE
        exit 0
    
    
      

    and make it executable with chmod 755 /usr/lib/systemd/system-sleep/fix-wifi.sh

    • It doesn't work, should it look like this the script?

       undefined
          
      #!/bin/sh
      [ "$1" = "post" ] ## exec /usr/sbin/modprobe Intel Corporation Wireless-AC 9260
      [ "$1" = "pre" ] ## exec /usr/sbin/modprobe -r Intel Corporation Wireless-AC 9260
      exit 0
      
      
        

      EDIT: should the name be something like wlp62s0 ??? I'm going to try it

      • you have to replace the ## with &&

        the name should be iwlwifi

        • how do I check the name? because iwlwifi doesn't work

          • well, are you sure the script is executed? I don't know systemd enough :-(

            First, do a test in command line modprobe -r iwlwifi

            then suspend your laptop, resume it after a few seconds then do

            modprobe iwlwifi

            and see if wifi is working

            • Yeah, thanks for the help even if you don't know much. I get stuck on the first command where I get this error:

               undefined
                  
              rmmod: ERROR: ../libkmod/libkmod-module.c:799 kmod_module_remove_module() could not remove 'iwlmvm': Operation not permitted
              rmmod: ERROR: could not remove module iwlmvm: Operation not permitted
              rmmod: ERROR: Module iwlwifi is in use by: iwlmvm
              modprobe: FATAL: Error running remove command for iwlwifi
              
              
                
              • yes of course

                sudo modprobe -r iwlwifi

                • I've tried. After suspension but before modprobe the wifi is not available, after modprobe it is there, but is disabled and cannot be enabled.

                  • So I don't know :-(

                    Have you disabled Fast Boot in your BIOS ?

                    • It was but it got reenabled, I disabled it again but it still doesn't work damn. I'll post the Intel I gathered on the Linux mint forum (I did in the past but now I have more information)

33 comments