7

I am running Ubuntu 16.04 LTS on a Dell XPS 15 9550 (16 GB RAM, FHD screen, 512 GB SSD, Intel i7-6700HQ). It is dual booted with Windows, for which I followed the instructions in this thread.

Almost everything works very well. However, when I suspend either by closing the lid, or using systemctl suspend sometimes (about 50% of the time) Ubuntu doesn't suspend. The screen goes dark as if it is about to suspend, but then it flashes back directly to the login screen.

I believe the issue must be related to my Broadcom wifi card/driver. The output of dmesg during a failed suspend is:

[36482.669029] PM: Syncing filesystems ... done.
[36482.697429] PM: Preparing system for sleep (mem)
[36482.698220] vgaarb: this pci device is not a vga device
[36483.937858] Freezing user space processes ... (elapsed 0.002 seconds) done.
[36483.940227] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[36483.941564] PM: Suspending system (mem)
[36483.941623] Suspending console(s) (use no_console_suspend to debug)
[36487.637784] brcmf_pcie_suspend: Timeout on response for entering D3 substate
[36487.637802] pci_legacy_suspend(): brcmf_pcie_suspend+0x0/0x1b0 [brcmfmac] returns -5
[36487.637808] dpm_run_callback(): pci_pm_suspend+0x0/0x140 returns -5
[36487.637813] PM: Device 0000:02:00.0 failed to suspend async: error -5
[36487.637902] PM: Some devices failed to suspend, or early wake event detected
[36487.641932] rtc_cmos 00:02: System wakeup disabled by ACPI
[36488.017866] ata2: SATA link down (SStatus 4 SControl 300)
[36488.149475] PM: resume of devices complete after 511.560 msecs
[36488.158754] PM: Finishing wakeup.

There is also the message

brcmfmac 0000:02:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2

whenever I boot or resume from a [successful] suspend. Also to note: when suspend fails, my wifi stops working (I believe it says "no device"). The only ways to get it to work again are to either reboot, or:

sudo rmmod brcmfmac
sudo modprobe brcmfmac

Here is the output of a wifi info script. Any help at all would be very much appreciated! Thank you in advance, and let me know if any more information would be helpful.

EDIT: Issue has returned after upgrade to 18.04. The previously accepted answer no longer seems to work because systemd does not unload modules from suggested file before suspending.

2 Answers2

4

Adding a file with SUSPEND_MODULES="brcmfmac" to /etc/pm/config.d/ didn't work for me, which might be an issue between systemd and pm, but I was able to get suspend with Broadcom wifi card to work by creating a simple script for systemd to run before and after suspend.

Create a file in /usr/lib/systemd/system-sleep/ (or wherever your systemd unit files are, might have to be /lib/systemd/system-sleep/) with the following:

#!/bin/sh

case $1 in pre) modprobe -r brcmfmac ;; post) modprobe brcmfmac ;; esac

You can name it e.g. 10-brcmfmac.sh - the script name doesn't matter as long as it's in this directory and has the executable bit set (e.g. sudo chmod +x /usr/lib/systemd/system-sleep/10-brcmfmac.sh).

More information about systemd suspend hooks: https://wiki.archlinux.org/index.php/Power_management#Hooks_in_/usr/lib/systemd/system-sleep

tobek
  • 141
4

I had the exact same problem. The solution is to create a file in /etc/pm/config.d/:

sudo -e /etc/pm/config.d/suspend_broardcom/suspend_broadcom

Add the following:

SUSPEND_MODULES="brcmfmac"

And set the permissions of the file:

sudo chmod 775 /etc/pm/config.d/suspend_broadcom
NotTheDr01ds
  • 22,082