Fixing Wireless on the HP Folio 13 when using Linux

Okay, this post is a bit off topic but I spent almost two days non-stop working on this to figure it out and it's nowhere out there on the web.

I recently picked up an HP Folio 13 with the intention of install Lubuntu on it. Everything was going well until I ran in to a fairly well know issue with this specific model where you are unable to toggle the Wireless/Bluetooth controler with funciton botton (Fn+F12) and both are toggle off by default when booting them machine and upon waking it up from a suspended or hibernated state. This affectively renders the both wifi and bluetooth usless.

Looking at the forums, the only real solution I could find was to turn off ACIP, like so:

  1. Open: /etc/default/grub
  2. Update the line containing 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"', making it the following:

     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=noacpi acpi=off"

This will fix your issues with Wireless and Bluetooth by disabling ACPI, which also disables Battery detection, Suspend and Hibernation. No good at all.

This issue is with hp-wmi, without out it you can't unblock native wireless (phy0) and bluetooth (hci0), but even when unblocking (via 'sudo rfkill unblock all'), hp-wmi doesn't unblock the hp drivers.

My Hack

I came up with the following hack to get Wireless and Bluetooth working, while at the same time keeping ACPI. Simply, I add hp-wmi, unblock wiki at the hardware level and then remove the mod. Here's how to do all of that automatically on startup and upon waking from sleep (hibernate and suspend).

  1. Ensure that ACPI is on, which it will be by default. (Undo the above, if you tried it.)

  2. Update /etc/rc.local to unblock wiki and bluetooth on startup and remove hp-wmi (which is installed by default). The sleep between is because without it, linux crashes.

       # file: /etc/rc.local
       rfkill unblock all
       sleep 5
       rmmod -w -s hp-wmi
       exit 0 
  3. Update /usr/lib/pm-utils/sleep.d/75modules to add hp-wmi (you removed it at startup) and then remove it again. This script is run when waking up from hibernation or suspension. You do this by adding the following lines to the "thaw|resume" block after "resume_modules". When done "75modules" should look like this:

     #!/bin/sh
     # Unload requested modules.
     . "${PM_FUNCTIONS}"
     suspend_modules()
     {
       [ -z "$SUSPEND_MODULES" ] && return $NA
       for x in $SUSPEND_MODULES ; do
               printf "Unloading kernel module %s..." "$x"
         modunload $x && echo Done. || echo Failed.
       done
       return 0
     }
     resume_modules()
     {
       modreload
       echo "Reloaded unloaded modules."
     }
     case "$1" in
     hibernate|suspend)
       suspend_modules
       ;;
     thaw|resume)
       resume_modules
       # begin wifi fix
       sleep 2
       modprobe -s hp-wmi
       sleep 5
       rmmod -f -s hp-wmi
       # end wifi fix
       ;;
     *) exit $NA
       ;;
     esac
    

My update is in the "thaw|resume" switch between the comments, in case you missed it.

At this point, everything should work as expected.

Published on in Linux