I have this same issue but have a fix so you don't need to restart. FYI
I'm running mint.

You need to ensure you have the msi-laptop modprobe running. You can
validate that by looking here:

/sys/devices/platform/msi-laptop-pf


If that folder exists msi-laptop is loaded. If not you need to run: 
sudo modprobe msi-laptop

Within that folder you can find msi-laptop-pf/wlan. This can control the
wifi and is toggled when your come out of suspend mode.

This is the behaviour for me:
If value is 1 on suspend then wifi stays off
If value is 0 on suspend then value changes to 1 and wifi turns on

The wifi turns on if it's 0 because it is reacting to the change. My workaround 
is to toggle this change each time I come out of suspend with this script which 
I put in here:
/usr/lib/systemd/system-sleep/msi-wlan-fix.sh

The script:
#!/bin/bash
WLAN_PATH="/sys/devices/platform/msi-laptop-pf/wlan"

case $1/$2 in
  pre/*)
    # Before suspend: optional
    ;;
  post/*)
    # After resume: toggle wlan to trigger hardware
    if [ -f "$WLAN_PATH" ]; then
        val=$(cat $WLAN_PATH)
        # toggle 0->1 or 1->0 to trigger edge
        if [ "$val" -eq 1 ]; then
            echo 0 > $WLAN_PATH
            sleep 0.1
            echo 1 > $WLAN_PATH
        fi
    fi
    ;;
esac

Note that I still cannot use the airplane mode button but I can just
bind a hotkey to toggle the wifi / bluetooth to the file in the script
if I really want that functionality.

There are other msi modprobes I could test to see if they fix this issue
but for now this fixes it for me.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2078990

Title:
  wifi airplane mode key combination does not work for MSI laptop and
  wifi is off on resuming from suspend mode

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/2078990/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to