Bug 99801 - Macbook display backlight stays off on resume from suspend
Summary: Macbook display backlight stays off on resume from suspend
Status: CLOSED UNREPRODUCIBLE
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Video (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Aaron Lu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-11 12:05 UTC by Tony Houghton
Modified: 2015-12-07 16:10 UTC (History)
4 users (show)

See Also:
Kernel Version: 4.2.0-1 (Debian)
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Output of acpidump (249.77 KB, text/plain)
2015-07-30 12:33 UTC, Tony Houghton
Details
print is_win8 (511 bytes, patch)
2015-10-10 02:08 UTC, Aaron Lu
Details | Diff
dmesg output from 4.2.3 (72.04 KB, text/plain)
2015-10-15 14:32 UTC, Tony Houghton
Details
dmesg output from 4.2.3-2 + acpi.trace_method_name=PINI (75.24 KB, text/plain)
2015-10-16 16:08 UTC, Tony Houghton
Details
dmesg output from 4.2.3-2 + acpi.trace_method_name=_SB.PCI0._INI (72.12 KB, text/plain)
2015-10-16 16:09 UTC, Tony Houghton
Details
Result of git bisect, see comment #38 (2.46 KB, text/plain)
2015-10-18 13:30 UTC, Tony Houghton
Details
git bisect log, see comment #38 (3.30 KB, text/plain)
2015-10-18 13:31 UTC, Tony Houghton
Details
Add debug print to see the backlight value set by acpi_video (688 bytes, patch)
2015-10-30 02:08 UTC, Aaron Lu
Details | Diff
dmesg log from 4.3 as requested in comment 44. (123.06 KB, text/plain)
2015-11-09 18:42 UTC, Tony Houghton
Details
dmesg after resume with backlight off (123.89 KB, text/plain)
2015-12-07 16:10 UTC, Tony Houghton
Details

Description Tony Houghton 2015-06-11 12:05:13 UTC
I have a Macbook Pro 13" Retina 11,1. With recent kernels the display backlight does not switch back on when I resume from suspend. But it does come on if I press one of the Fn keys to change the brightness. It doesn't happen with the 3.16 series, but I did have the same problem with Debian's 3.19-trunk, and the same problem has been reported for Ubuntu's 3.19 kernel <https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1452250>.

Also, the laptop occasionally fails to suspend when I close the lid. Once I tried reopening it and forcing a suspend with systemctl and it locked up. It can be powered off safely after a failed suspend though.
Comment 1 Tony Houghton 2015-06-11 18:56:42 UTC
Actually it looks as if the screen does briefly flash on when I open the lid, but then switches off again in a fraction of a second.
Comment 2 Thiyagarajan Purusothaman 2015-06-17 07:41:26 UTC
For me had same problem with Mac Air 6,2, But it is solved by using the following kernel module :- https://github.com/patjak/mba6x_bl
Comment 3 Aaron Lu 2015-07-06 02:40:47 UTC
(In reply to Tony Houghton from comment #0)
> I have a Macbook Pro 13" Retina 11,1. With recent kernels the display
> backlight does not switch back on when I resume from suspend. But it does
> come on if I press one of the Fn keys to change the brightness. It doesn't
> happen with the 3.16 series, but I did have the same problem with Debian's
> 3.19-trunk, and the same problem has been reported for Ubuntu's 3.19 kernel
> <https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1452250>.

Possible to bisect?

> 
> Also, the laptop occasionally fails to suspend when I close the lid. Once I
> tried reopening it and forcing a suspend with systemctl and it locked up. It
> can be powered off safely after a failed suspend though.

If suspend failed and you can still use it, can you please check if there is any error messages in dmesg?
Comment 4 Tony Houghton 2015-07-11 13:47:42 UTC
It's a bit difficult to bisect because I don't think I have enough disc space (15GB free currently) due to it being an SSD shared with OSX, and having to patch and compile the Broadcom wl driver too. But if nobody else is available to investigate, I can solve those problems.
Comment 5 Aaron Lu 2015-07-15 02:46:10 UTC
When the backlight doesn't switch back on resume, can you please check which interfaces do you have under /sys/class/backlight? And for v3.16, do you have the same interfaces or more?

Please also attach dmesgs for both the working kernel and the non-working kernel.
Comment 6 Tony Houghton 2015-07-21 11:40:39 UTC
For the faulty kernel:

$ ls -lHR /sys/class/backlight/*
/sys/class/backlight/acpi_video0:
total 0
-r--r--r-- 1 root root 4096 Jul 21 12:33 actual_brightness
-rw-r--r-- 1 root root 4096 Jul 21 12:33 bl_power
-rw-r--r-- 1 root root 4096 Jul 21 12:33 brightness
lrwxrwxrwx 1 root root    0 Jul 21 12:33 device -> ../../../0000:00:02.0
-r--r--r-- 1 root root 4096 Jul 21 12:33 max_brightness
drwxr-xr-x 2 root root    0 Jul 21 12:33 power
lrwxrwxrwx 1 root root    0 Jul 21 12:33 subsystem -> ../../../../../class/backlight
-r--r--r-- 1 root root 4096 Jul 21 12:33 type
-rw-r--r-- 1 root root 4096 Jul 21 12:33 uevent

/sys/class/backlight/acpi_video0/power:
total 0
-rw-r--r-- 1 root root 4096 Jul 21 12:34 async
-rw-r--r-- 1 root root 4096 Jul 21 12:34 autosuspend_delay_ms
-rw-r--r-- 1 root root 4096 Jul 21 12:34 control
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_active_kids
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_active_time
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_enabled
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_status
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_suspended_time
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_usage

/sys/class/backlight/intel_backlight:
total 0
-r--r--r-- 1 root root 4096 Jul 21 12:33 actual_brightness
-rw-r--r-- 1 root root 4096 Jul 21 12:33 bl_power
-rw-r--r-- 1 root root 4096 Jul 21 12:33 brightness
lrwxrwxrwx 1 root root    0 Jul 21 12:33 device -> ../../card0-eDP-1
-r--r--r-- 1 root root 4096 Jul 21 12:33 max_brightness
drwxr-xr-x 2 root root    0 Jul 21 12:33 power
lrwxrwxrwx 1 root root    0 Jul 21 12:33 subsystem -> ../../../../../../../class/backlight
-r--r--r-- 1 root root 4096 Jul 21 12:33 type
-rw-r--r-- 1 root root 4096 Jul 21 12:33 uevent

/sys/class/backlight/intel_backlight/power:
total 0
-rw-r--r-- 1 root root 4096 Jul 21 12:34 async
-rw-r--r-- 1 root root 4096 Jul 21 12:34 autosuspend_delay_ms
-rw-r--r-- 1 root root 4096 Jul 21 12:34 control
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_active_kids
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_active_time
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_enabled
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_status
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_suspended_time
-r--r--r-- 1 root root 4096 Jul 21 12:34 runtime_usage

I'm listing kern.log instead of dmesg because I read that it has the same content with the timestamps made human readable. I've had to trim it for length, I think the most recent suspend was at 23:09 last night because there was a gap before that time, then I resumed at 12:25 today.

Jul 20 23:09:22 jeanette kernel: [27263.573161] wl0: link down (wlan0)
Jul 20 23:09:22 jeanette kernel: [27263.573504] cfg80211: Calling CRDA to update world regulatory domain
Jul 20 23:09:22 jeanette kernel: [27263.577271] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Jul 20 23:09:22 jeanette kernel: [27263.583658] cfg80211: World regulatory domain updated:
Jul 20 23:09:22 jeanette kernel: [27263.583665] cfg80211:  DFS Master region: unset
Jul 20 23:09:22 jeanette kernel: [27263.583667] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 20 23:09:22 jeanette kernel: [27263.583672] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 23:09:22 jeanette kernel: [27263.583675] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 23:09:22 jeanette kernel: [27263.583677] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 23:09:22 jeanette kernel: [27263.583680] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 20 23:09:22 jeanette kernel: [27263.583684] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 20 23:09:22 jeanette kernel: [27263.583687] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Jul 20 23:09:22 jeanette kernel: [27263.583689] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 23:09:22 jeanette kernel: [27263.583692] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Jul 21 12:25:45 jeanette kernel: [27268.659819] PM: Syncing filesystems ... done.
Jul 21 12:25:45 jeanette kernel: [27268.672951] PM: Preparing system for mem sleep
Jul 21 12:25:45 jeanette kernel: [27268.673089] Freezing user space processes ... (elapsed 0.001 seconds) done.
Jul 21 12:25:45 jeanette kernel: [27268.674676] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Jul 21 12:25:45 jeanette kernel: [27268.675814] PM: Entering mem sleep
Jul 21 12:25:45 jeanette kernel: [27268.675849] Suspending console(s) (use no_console_suspend to debug)
Jul 21 12:25:45 jeanette kernel: [27268.676169] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Jul 21 12:25:45 jeanette kernel: [27268.676332] wl_suspend: PCI Suspend handler
Jul 21 12:25:45 jeanette kernel: [27268.676341] wl_suspend: Not WOWL capable
Jul 21 12:25:45 jeanette kernel: [27268.678876] sd 0:0:0:0: [sda] Stopping disk
Jul 21 12:25:45 jeanette kernel: [27269.037367] PM: suspend of devices complete after 361.120 msecs
Jul 21 12:25:45 jeanette kernel: [27269.085305] PM: late suspend of devices complete after 47.897 msecs
Jul 21 12:25:45 jeanette kernel: [27269.085541] thunderbolt 0000:07:00.0: suspending...
Jul 21 12:25:45 jeanette kernel: [27269.085599] thunderbolt 0000:07:00.0: stopping RX ring 0
Jul 21 12:25:45 jeanette kernel: [27269.085603] thunderbolt 0000:07:00.0: disabling interrupt at register 0x38200 bit 12 (0x1001 -> 0x1)
Jul 21 12:25:45 jeanette kernel: [27269.085609] thunderbolt 0000:07:00.0: stopping TX ring 0
Jul 21 12:25:45 jeanette kernel: [27269.085613] thunderbolt 0000:07:00.0: disabling interrupt at register 0x38200 bit 0 (0x1 -> 0x0)
Jul 21 12:25:45 jeanette kernel: [27269.085616] thunderbolt 0000:07:00.0: control channel stopped
Jul 21 12:25:45 jeanette kernel: [27269.085617] thunderbolt 0000:07:00.0: suspend finished
Jul 21 12:25:45 jeanette kernel: [27269.086305] xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI
Jul 21 12:25:45 jeanette kernel: [27269.125260] PM: noirq suspend of devices complete after 39.922 msecs
Jul 21 12:25:45 jeanette kernel: [27269.125506] ACPI: Preparing to enter system sleep state S3
Jul 21 12:25:45 jeanette kernel: [27269.189358] PM: Saving platform NVS memory
Jul 21 12:25:45 jeanette kernel: [27269.189361] Disabling non-boot CPUs ...
Jul 21 12:25:45 jeanette kernel: [27269.189394] intel_pstate CPU 1 exiting
Jul 21 12:25:45 jeanette kernel: [27269.190559] kvm: disabling virtualization on CPU1
Jul 21 12:25:45 jeanette kernel: [27269.190567] smpboot: CPU 1 is now offline
Jul 21 12:25:45 jeanette kernel: [27269.190834] intel_pstate CPU 2 exiting
Jul 21 12:25:45 jeanette kernel: [27269.191981] kvm: disabling virtualization on CPU2
Jul 21 12:25:45 jeanette kernel: [27269.192234] smpboot: CPU 2 is now offline
Jul 21 12:25:45 jeanette kernel: [27269.192464] intel_pstate CPU 3 exiting
Jul 21 12:25:45 jeanette kernel: [27269.192600] Broke affinity for irq 48
Jul 21 12:25:45 jeanette kernel: [27269.193608] kvm: disabling virtualization on CPU3
Jul 21 12:25:45 jeanette kernel: [27269.193625] smpboot: CPU 3 is now offline
Jul 21 12:25:45 jeanette kernel: [27269.195274] ACPI: Low-level resume complete
Jul 21 12:25:45 jeanette kernel: [27269.195352] PM: Restoring platform NVS memory
Jul 21 12:25:45 jeanette kernel: [27269.195767] Enabling non-boot CPUs ...
Jul 21 12:25:45 jeanette kernel: [27269.195860] x86: Booting SMP configuration:
Jul 21 12:25:45 jeanette kernel: [27269.195862] smpboot: Booting Node 0 Processor 1 APIC 0x2
Jul 21 12:25:45 jeanette kernel: [27269.210562] kvm: enabling virtualization on CPU1
Jul 21 12:25:45 jeanette kernel: [27269.216865] CPU1 is up
Jul 21 12:25:45 jeanette kernel: [27269.227983] smpboot: Booting Node 0 Processor 2 APIC 0x1
Jul 21 12:25:45 jeanette kernel: [27269.239982] kvm: enabling virtualization on CPU2
Jul 21 12:25:45 jeanette kernel: [27269.312799] CPU2 is up
Jul 21 12:25:45 jeanette kernel: [27269.312841] smpboot: Booting Node 0 Processor 3 APIC 0x3
Jul 21 12:25:45 jeanette kernel: [27269.325593] kvm: enabling virtualization on CPU3
Jul 21 12:25:45 jeanette kernel: [27269.329547] CPU3 is up
Jul 21 12:25:45 jeanette kernel: [27269.332889] ACPI: Waking up from system sleep state S3
Jul 21 12:25:45 jeanette kernel: [27269.491636] xhci_hcd 0000:00:14.0: System wakeup disabled by ACPI
Jul 21 12:25:45 jeanette kernel: [27269.492304] pcieport 0000:06:03.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 12:25:45 jeanette kernel: [27269.492569] pcieport 0000:06:04.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 12:25:45 jeanette kernel: [27269.492578] pcieport 0000:06:05.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 12:25:45 jeanette kernel: [27269.492580] pcieport 0000:06:06.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 12:25:45 jeanette kernel: [27269.507886] thunderbolt 0000:07:00.0: resuming...
Jul 21 12:25:45 jeanette kernel: [27269.507888] thunderbolt 0000:07:00.0: control channel starting...
Jul 21 12:25:45 jeanette kernel: [27269.507889] thunderbolt 0000:07:00.0: starting TX ring 0
Jul 21 12:25:45 jeanette kernel: [27269.507894] thunderbolt 0000:07:00.0: enabling interrupt at register 0x38200 bit 0 (0x0 -> 0x1)
Jul 21 12:25:45 jeanette kernel: [27269.507896] thunderbolt 0000:07:00.0: starting RX ring 0
Jul 21 12:25:45 jeanette kernel: [27269.507900] thunderbolt 0000:07:00.0: enabling interrupt at register 0x38200 bit 12 (0x1 -> 0x1001)
Jul 21 12:25:45 jeanette kernel: [27269.507903] thunderbolt 0000:07:00.0: resetting switch at 0
Jul 21 12:25:45 jeanette kernel: [27269.515526] thunderbolt 0000:07:00.0: 0: resuming switch
Jul 21 12:25:45 jeanette kernel: [27269.520273] thunderbolt 0000:07:00.0: resume finished
Jul 21 12:25:45 jeanette kernel: [27269.520340] PM: noirq resume of devices complete after 28.761 msecs
Jul 21 12:25:45 jeanette kernel: [27269.543663] PM: early resume of devices complete after 23.284 msecs
Jul 21 12:25:45 jeanette kernel: [27269.543881] wl_resume: PCI Resume handler
Jul 21 12:25:45 jeanette kernel: [27269.559482] sd 0:0:0:0: [sda] Starting disk
Jul 21 12:25:45 jeanette kernel: [27269.607866] bcm5974: bad trackpad package, length: 8
Jul 21 12:25:45 jeanette kernel: [27269.647524] pciehp 0000:06:00.0:pcie24: Device 0000:07:00.0 already exists at 0000:07:00, cannot hot-add
Jul 21 12:25:45 jeanette kernel: [27269.647526] pciehp 0000:06:00.0:pcie24: Cannot add device at 0000:07:00
Jul 21 12:25:45 jeanette kernel: [27269.647549] rtc_cmos 00:02: System wakeup disabled by ACPI
Jul 21 12:25:45 jeanette kernel: [27269.708418] wl0: link down (wlan0)
Jul 21 12:25:45 jeanette kernel: [27269.708548] cfg80211: Calling CRDA to update world regulatory domain
Jul 21 12:25:45 jeanette kernel: [27269.708594] thunderbolt 0000:07:00.0: resetting error on 0:b.
Jul 21 12:25:45 jeanette kernel: [27269.708602] thunderbolt 0000:07:00.0: 0:b: hotplug: scanning
Jul 21 12:25:45 jeanette kernel: [27269.708603] thunderbolt 0000:07:00.0: 0:b: hotplug: no switch found
Jul 21 12:25:45 jeanette kernel: [27269.708612] thunderbolt 0000:07:00.0: resetting error on 0:c.
Jul 21 12:25:45 jeanette kernel: [27269.708617] thunderbolt 0000:07:00.0: 0:c: hotplug: scanning
Jul 21 12:25:45 jeanette kernel: [27269.708618] thunderbolt 0000:07:00.0: 0:c: hotplug: no switch found
Jul 21 12:25:45 jeanette kernel: [27269.708718] PM: resume of devices complete after 164.928 msecs
Jul 21 12:25:45 jeanette kernel: [27269.708871] PM: Finishing wakeup.
Jul 21 12:25:45 jeanette kernel: [27269.708873] Restarting tasks ... done.
Jul 21 12:25:45 jeanette kernel: [27269.710016] video LNXVIDEO:00: Restoring backlight state
Jul 21 12:25:45 jeanette kernel: [27269.714011] cfg80211: World regulatory domain updated:
Jul 21 12:25:45 jeanette kernel: [27269.714015] cfg80211:  DFS Master region: unset
Jul 21 12:25:45 jeanette kernel: [27269.714016] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 12:25:45 jeanette kernel: [27269.714018] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:25:45 jeanette kernel: [27269.714019] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:25:45 jeanette kernel: [27269.714020] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:25:45 jeanette kernel: [27269.714022] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 12:25:45 jeanette kernel: [27269.714024] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 12:25:45 jeanette kernel: [27269.714025] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Jul 21 12:25:45 jeanette kernel: [27269.714026] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:25:45 jeanette kernel: [27269.714027] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Jul 21 12:25:45 jeanette kernel: [27269.887770] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Jul 21 12:25:45 jeanette kernel: [27269.888030] ata1.00: unexpected _GTF length (8)
Jul 21 12:25:45 jeanette kernel: [27269.888356] ata1.00: unexpected _GTF length (8)
Jul 21 12:25:45 jeanette kernel: [27269.888391] ata1.00: configured for UDMA/133
Jul 21 12:25:49 jeanette kernel: [27273.810701] wl0: link up (wlan0)
Jul 21 12:25:49 jeanette kernel: [27273.810894] cfg80211: Calling CRDA for country: GB
Jul 21 12:25:49 jeanette kernel: [27273.813805] cfg80211: Regulatory domain changed to country: GB
Jul 21 12:25:49 jeanette kernel: [27273.813808] cfg80211:  DFS Master region: ETSI
Jul 21 12:25:49 jeanette kernel: [27273.813810] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 12:25:49 jeanette kernel: [27273.813812] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:25:49 jeanette kernel: [27273.813815] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 12:25:49 jeanette kernel: [27273.813817] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 12:25:49 jeanette kernel: [27273.813819] cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
Jul 21 12:25:49 jeanette kernel: [27273.813820] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Comment 7 Tony Houghton 2015-07-21 11:48:18 UTC
(In reply to Thiyagarajan Purusothaman from comment #2)
> For me had same problem with Mac Air 6,2, But it is solved by using the
> following kernel module :- https://github.com/patjak/mba6x_bl

I tried that and I thought it was working at first, but the problem came back. I don't think the module includes the ids for my Pro Retina model.

I've added a systemd service to run powertop --auto-tune at boot and since then the failures to suspend and lock-ups on suspend have been much rarer, possibly even cured.
Comment 8 Tony Houghton 2015-07-21 12:16:27 UTC
I just had a successful resume with kernel 4.0, I don't know if you can see any difference here:

Jul 21 12:49:58 jeanette kernel: [28723.421204] wl0: link down (wlan0)
Jul 21 12:49:58 jeanette kernel: [28723.424072] cfg80211: Calling CRDA to update world regulatory domain
Jul 21 12:49:58 jeanette kernel: [28723.425309] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Jul 21 12:49:58 jeanette kernel: [28723.431735] cfg80211: World regulatory domain updated:
Jul 21 12:49:58 jeanette kernel: [28723.431742] cfg80211:  DFS Master region: unset
Jul 21 12:49:58 jeanette kernel: [28723.431745] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 12:49:58 jeanette kernel: [28723.431750] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:49:58 jeanette kernel: [28723.431754] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:49:58 jeanette kernel: [28723.431758] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:49:58 jeanette kernel: [28723.431762] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 12:49:58 jeanette kernel: [28723.431767] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 12:49:58 jeanette kernel: [28723.431770] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Jul 21 12:49:58 jeanette kernel: [28723.431774] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 12:49:58 jeanette kernel: [28723.431778] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Jul 21 13:13:31 jeanette kernel: [28728.511536] PM: Syncing filesystems ... done.
Jul 21 13:13:31 jeanette kernel: [28728.524550] PM: Preparing system for mem sleep
Jul 21 13:13:31 jeanette kernel: [28728.524776] Freezing user space processes ... (elapsed 0.001 seconds) done.
Jul 21 13:13:31 jeanette kernel: [28728.526758] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Jul 21 13:13:31 jeanette kernel: [28728.527977] PM: Entering mem sleep
Jul 21 13:13:31 jeanette kernel: [28728.528044] Suspending console(s) (use no_console_suspend to debug)
Jul 21 13:13:31 jeanette kernel: [28728.528653] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Jul 21 13:13:31 jeanette kernel: [28728.529083] wl_suspend: PCI Suspend handler
Jul 21 13:13:31 jeanette kernel: [28728.529100] wl_suspend: Not WOWL capable
Jul 21 13:13:31 jeanette kernel: [28728.530058] sd 0:0:0:0: [sda] Stopping disk
Jul 21 13:13:31 jeanette kernel: [28728.886591] PM: suspend of devices complete after 358.033 msecs
Jul 21 13:13:31 jeanette kernel: [28728.933469] PM: late suspend of devices complete after 46.827 msecs
Jul 21 13:13:31 jeanette kernel: [28728.933712] thunderbolt 0000:07:00.0: suspending...
Jul 21 13:13:31 jeanette kernel: [28728.934310] xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI
Jul 21 13:13:31 jeanette kernel: [28728.934396] thunderbolt 0000:07:00.0: stopping RX ring 0
Jul 21 13:13:31 jeanette kernel: [28728.934400] thunderbolt 0000:07:00.0: disabling interrupt at register 0x38200 bit 12 (0x1001 -> 0x1)
Jul 21 13:13:31 jeanette kernel: [28728.934405] thunderbolt 0000:07:00.0: stopping TX ring 0
Jul 21 13:13:31 jeanette kernel: [28728.934408] thunderbolt 0000:07:00.0: disabling interrupt at register 0x38200 bit 0 (0x1 -> 0x0)
Jul 21 13:13:31 jeanette kernel: [28728.934411] thunderbolt 0000:07:00.0: control channel stopped
Jul 21 13:13:31 jeanette kernel: [28728.934411] thunderbolt 0000:07:00.0: suspend finished
Jul 21 13:13:31 jeanette kernel: [28728.973391] PM: noirq suspend of devices complete after 39.889 msecs
Jul 21 13:13:31 jeanette kernel: [28728.973637] ACPI: Preparing to enter system sleep state S3
Jul 21 13:13:31 jeanette kernel: [28729.037488] PM: Saving platform NVS memory
Jul 21 13:13:31 jeanette kernel: [28729.037491] Disabling non-boot CPUs ...
Jul 21 13:13:31 jeanette kernel: [28729.037522] intel_pstate CPU 1 exiting
Jul 21 13:13:31 jeanette kernel: [28729.038697] kvm: disabling virtualization on CPU1
Jul 21 13:13:31 jeanette kernel: [28729.038950] smpboot: CPU 1 is now offline
Jul 21 13:13:31 jeanette kernel: [28729.039181] intel_pstate CPU 2 exiting
Jul 21 13:13:31 jeanette kernel: [28729.040322] kvm: disabling virtualization on CPU2
Jul 21 13:13:31 jeanette kernel: [28729.040328] smpboot: CPU 2 is now offline
Jul 21 13:13:31 jeanette kernel: [28729.040466] intel_pstate CPU 3 exiting
Jul 21 13:13:31 jeanette kernel: [28729.040597] Broke affinity for irq 16
Jul 21 13:13:31 jeanette kernel: [28729.040599] Broke affinity for irq 18
Jul 21 13:13:31 jeanette kernel: [28729.040602] Broke affinity for irq 43
Jul 21 13:13:31 jeanette kernel: [28729.040603] Broke affinity for irq 44
Jul 21 13:13:31 jeanette kernel: [28729.040605] Broke affinity for irq 45
Jul 21 13:13:31 jeanette kernel: [28729.040607] Broke affinity for irq 46
Jul 21 13:13:31 jeanette kernel: [28729.040609] Broke affinity for irq 47
Jul 21 13:13:31 jeanette kernel: [28729.040611] Broke affinity for irq 48
Jul 21 13:13:31 jeanette kernel: [28729.041621] kvm: disabling virtualization on CPU3
Jul 21 13:13:31 jeanette kernel: [28729.041650] smpboot: CPU 3 is now offline
Jul 21 13:13:31 jeanette kernel: [28729.044041] ACPI: Low-level resume complete
Jul 21 13:13:31 jeanette kernel: [28729.044118] PM: Restoring platform NVS memory
Jul 21 13:13:31 jeanette kernel: [28729.044535] Enabling non-boot CPUs ...
Jul 21 13:13:31 jeanette kernel: [28729.044628] x86: Booting SMP configuration:
Jul 21 13:13:31 jeanette kernel: [28729.044630] smpboot: Booting Node 0 Processor 1 APIC 0x2
Jul 21 13:13:31 jeanette kernel: [28729.059326] kvm: enabling virtualization on CPU1
Jul 21 13:13:31 jeanette kernel: [28729.066392] CPU1 is up
Jul 21 13:13:31 jeanette kernel: [28729.071544] smpboot: Booting Node 0 Processor 2 APIC 0x1
Jul 21 13:13:31 jeanette kernel: [28729.083567] kvm: enabling virtualization on CPU2
Jul 21 13:13:31 jeanette kernel: [28729.117752] CPU2 is up
Jul 21 13:13:31 jeanette kernel: [28729.117796] smpboot: Booting Node 0 Processor 3 APIC 0x3
Jul 21 13:13:31 jeanette kernel: [28729.130770] kvm: enabling virtualization on CPU3
Jul 21 13:13:31 jeanette kernel: [28729.135042] CPU3 is up
Jul 21 13:13:31 jeanette kernel: [28729.138448] ACPI: Waking up from system sleep state S3
Jul 21 13:13:31 jeanette kernel: [28729.296153] xhci_hcd 0000:00:14.0: System wakeup disabled by ACPI
Jul 21 13:13:31 jeanette kernel: [28729.296890] pcieport 0000:06:03.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 13:13:31 jeanette kernel: [28729.296894] pcieport 0000:06:06.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 13:13:31 jeanette kernel: [28729.297063] pcieport 0000:06:04.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 13:13:31 jeanette kernel: [28729.297067] pcieport 0000:06:05.0: quirk: wating for thunderbolt to reestablish pci tunnels...
Jul 21 13:13:31 jeanette kernel: [28729.312286] thunderbolt 0000:07:00.0: resuming...
Jul 21 13:13:31 jeanette kernel: [28729.312288] thunderbolt 0000:07:00.0: control channel starting...
Jul 21 13:13:31 jeanette kernel: [28729.312289] thunderbolt 0000:07:00.0: starting TX ring 0
Jul 21 13:13:31 jeanette kernel: [28729.312294] thunderbolt 0000:07:00.0: enabling interrupt at register 0x38200 bit 0 (0x0 -> 0x1)
Jul 21 13:13:31 jeanette kernel: [28729.312295] thunderbolt 0000:07:00.0: starting RX ring 0
Jul 21 13:13:31 jeanette kernel: [28729.312300] thunderbolt 0000:07:00.0: enabling interrupt at register 0x38200 bit 12 (0x1 -> 0x1001)
Jul 21 13:13:31 jeanette kernel: [28729.312303] thunderbolt 0000:07:00.0: resetting switch at 0
Jul 21 13:13:31 jeanette kernel: [28729.320238] thunderbolt 0000:07:00.0: 0: resuming switch
Jul 21 13:13:31 jeanette kernel: [28729.324560] thunderbolt 0000:07:00.0: resume finished
Jul 21 13:13:31 jeanette kernel: [28729.324627] PM: noirq resume of devices complete after 28.536 msecs
Jul 21 13:13:31 jeanette kernel: [28729.348181] PM: early resume of devices complete after 23.516 msecs
Jul 21 13:13:31 jeanette kernel: [28729.348333] wl_resume: PCI Resume handler
Jul 21 13:13:31 jeanette kernel: [28729.364003] sd 0:0:0:0: [sda] Starting disk
Jul 21 13:13:31 jeanette kernel: [28729.412361] bcm5974: bad trackpad package, length: 8
Jul 21 13:13:31 jeanette kernel: [28729.413558] thunderbolt 0000:07:00.0: resetting error on 0:b.
Jul 21 13:13:31 jeanette kernel: [28729.413575] thunderbolt 0000:07:00.0: 0:b: hotplug: scanning
Jul 21 13:13:31 jeanette kernel: [28729.413576] thunderbolt 0000:07:00.0: 0:b: hotplug: no switch found
Jul 21 13:13:31 jeanette kernel: [28729.413622] thunderbolt 0000:07:00.0: resetting error on 0:c.
Jul 21 13:13:31 jeanette kernel: [28729.413635] thunderbolt 0000:07:00.0: 0:c: hotplug: scanning
Jul 21 13:13:31 jeanette kernel: [28729.413636] thunderbolt 0000:07:00.0: 0:c: hotplug: no switch found
Jul 21 13:13:31 jeanette kernel: [28729.452044] pciehp 0000:06:00.0:pcie24: Device 0000:07:00.0 already exists at 0000:07:00, cannot hot-add
Jul 21 13:13:31 jeanette kernel: [28729.452045] pciehp 0000:06:00.0:pcie24: Cannot add device at 0000:07:00
Jul 21 13:13:31 jeanette kernel: [28729.452066] rtc_cmos 00:02: System wakeup disabled by ACPI
Jul 21 13:13:31 jeanette kernel: [28729.512827] wl0: link down (wlan0)
Jul 21 13:13:31 jeanette kernel: [28729.513002] cfg80211: Calling CRDA to update world regulatory domain
Jul 21 13:13:31 jeanette kernel: [28729.692254] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Jul 21 13:13:31 jeanette kernel: [28729.692503] ata1.00: unexpected _GTF length (8)
Jul 21 13:13:31 jeanette kernel: [28729.692830] ata1.00: unexpected _GTF length (8)
Jul 21 13:13:31 jeanette kernel: [28729.692902] ata1.00: configured for UDMA/133
Jul 21 13:13:31 jeanette kernel: [28729.866139] PM: resume of devices complete after 517.566 msecs
Jul 21 13:13:31 jeanette kernel: [28729.866306] PM: Finishing wakeup.
Jul 21 13:13:31 jeanette kernel: [28729.866308] Restarting tasks ... 
Jul 21 13:13:31 jeanette kernel: [28729.870424] cfg80211: World regulatory domain updated:
Jul 21 13:13:31 jeanette kernel: [28729.870428] cfg80211:  DFS Master region: unset
Jul 21 13:13:31 jeanette kernel: [28729.870429] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 13:13:31 jeanette kernel: [28729.870431] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:13:31 jeanette kernel: [28729.870432] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:13:31 jeanette kernel: [28729.870433] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:13:31 jeanette kernel: [28729.870435] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 13:13:31 jeanette kernel: [28729.870436] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 13:13:31 jeanette kernel: [28729.870437] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Jul 21 13:13:31 jeanette kernel: [28729.870439] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:13:31 jeanette kernel: [28729.870440] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Jul 21 13:13:31 jeanette kernel: [28729.872936] done.
Jul 21 13:13:31 jeanette kernel: [28729.872959] video LNXVIDEO:00: Restoring backlight state
Jul 21 13:13:35 jeanette kernel: [28733.989750] wl0: link up (wlan0)
Jul 21 13:13:35 jeanette kernel: [28733.989921] cfg80211: Calling CRDA for country: GB
Jul 21 13:13:35 jeanette kernel: [28733.992241] cfg80211: Regulatory domain changed to country: GB
Jul 21 13:13:35 jeanette kernel: [28733.992244] cfg80211:  DFS Master region: ETSI
Jul 21 13:13:35 jeanette kernel: [28733.992245] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 13:13:35 jeanette kernel: [28733.992247] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:13:35 jeanette kernel: [28733.992249] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 13:13:35 jeanette kernel: [28733.992251] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 13:13:35 jeanette kernel: [28733.992252] cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
Jul 21 13:13:35 jeanette kernel: [28733.992253] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Comment 9 Tony Houghton 2015-07-21 16:21:50 UTC
The contents of /sys do look slightly different under kernel 3.16:

$ ls -lHR /sys/class/backlight/*
/sys/class/backlight/intel_backlight:
total 0
-r--r--r-- 1 root root 4096 Jul 21 17:17 actual_brightness
-rw-r--r-- 1 root root 4096 Jul 21 13:21 bl_power
-rw-r--r-- 1 root root 4096 Jul 21 13:21 brightness
lrwxrwxrwx 1 root root    0 Jul 21 17:17 device -> ../../card0-eDP-1
-r--r--r-- 1 root root 4096 Jul 21 13:21 max_brightness
drwxr-xr-x 2 root root    0 Jul 21 17:17 power
lrwxrwxrwx 1 root root    0 Jul 21 13:21 subsystem -> ../../../../../../../class/backlight
-r--r--r-- 1 root root 4096 Jul 21 13:21 type
-rw-r--r-- 1 root root 4096 Jul 21 13:21 uevent

/sys/class/backlight/intel_backlight/power:
total 0
-rw-r--r-- 1 root root 4096 Jul 21 17:17 async
-rw-r--r-- 1 root root 4096 Jul 21 17:17 autosuspend_delay_ms
-rw-r--r-- 1 root root 4096 Jul 21 17:17 control
-r--r--r-- 1 root root 4096 Jul 21 17:17 runtime_active_kids
-r--r--r-- 1 root root 4096 Jul 21 17:17 runtime_active_time
-r--r--r-- 1 root root 4096 Jul 21 17:17 runtime_enabled
-r--r--r-- 1 root root 4096 Jul 21 17:17 runtime_status
-r--r--r-- 1 root root 4096 Jul 21 17:17 runtime_suspended_time
-r--r--r-- 1 root root 4096 Jul 21 17:17 runtime_usage
Comment 10 Tony Houghton 2015-07-21 16:32:06 UTC
Here's a kern.log from 3.16. I suspended at 13:33 and resumed at 17:15. Note that with this kernel I often have to reload the Broadcom wl module after resuming to get wifi to work, but this problem seems to be resolved in 4.0.  Again, trying to include more of the log, to show the boot sequence, made it too long to post.

Jul 21 13:33:01 jeanette kernel: [  682.459110] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Jul 21 13:33:01 jeanette kernel: [  682.460722] wl0: link down (wlan0)
Jul 21 13:33:01 jeanette kernel: [  682.461189] cfg80211: Calling CRDA to update world regulatory domain
Jul 21 13:33:01 jeanette kernel: [  682.468678] cfg80211: World regulatory domain updated:
Jul 21 13:33:01 jeanette kernel: [  682.468716] cfg80211:  DFS Master region: unset
Jul 21 13:33:01 jeanette kernel: [  682.468719] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 13:33:01 jeanette kernel: [  682.468724] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:33:01 jeanette kernel: [  682.468729] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:33:01 jeanette kernel: [  682.468733] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:33:01 jeanette kernel: [  682.468738] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 13:33:01 jeanette kernel: [  682.468742] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 13:33:01 jeanette kernel: [  682.468746] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Jul 21 13:33:01 jeanette kernel: [  682.468750] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 13:33:01 jeanette kernel: [  682.468754] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Jul 21 17:15:32 jeanette kernel: [  687.551268] PM: Syncing filesystems ... done.
Jul 21 17:15:32 jeanette kernel: [  687.559709] PM: Preparing system for mem sleep
Jul 21 17:15:32 jeanette kernel: [  687.559907] Freezing user space processes ... (elapsed 0.001 seconds) done.
Jul 21 17:15:32 jeanette kernel: [  687.561622] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Jul 21 17:15:32 jeanette kernel: [  687.562735] PM: Entering mem sleep
Jul 21 17:15:32 jeanette kernel: [  687.562807] Suspending console(s) (use no_console_suspend to debug)
Jul 21 17:15:32 jeanette kernel: [  687.563328] sd 0:0:0:0: [sda] Synchronizing SCSI cache
Jul 21 17:15:32 jeanette kernel: [  687.563534] wl_suspend: PCI Suspend handler
Jul 21 17:15:32 jeanette kernel: [  687.563546] wl_suspend: Not WOWL capable
Jul 21 17:15:32 jeanette kernel: [  687.566097] sd 0:0:0:0: [sda] Stopping disk
Jul 21 17:15:32 jeanette kernel: [  687.925007] PM: suspend of devices complete after 361.745 msecs
Jul 21 17:15:32 jeanette kernel: [  687.940861] PM: late suspend of devices complete after 15.839 msecs
Jul 21 17:15:32 jeanette kernel: [  687.941481] xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI
Jul 21 17:15:32 jeanette kernel: [  687.956886] PM: noirq suspend of devices complete after 16.010 msecs
Jul 21 17:15:32 jeanette kernel: [  687.957134] ACPI: Preparing to enter system sleep state S3
Jul 21 17:15:32 jeanette kernel: [  741.935211] PM: Saving platform NVS memory
Jul 21 17:15:32 jeanette kernel: [  741.935622] Disabling non-boot CPUs ...
Jul 21 17:15:32 jeanette kernel: [  741.935682] intel_pstate CPU 1 exiting
Jul 21 17:15:32 jeanette kernel: [  741.937063] kvm: disabling virtualization on CPU1
Jul 21 17:15:32 jeanette kernel: [  742.037408] smpboot: CPU 1 is now offline
Jul 21 17:15:32 jeanette kernel: [  742.037909] intel_pstate CPU 2 exiting
Jul 21 17:15:32 jeanette kernel: [  742.039257] kvm: disabling virtualization on CPU2
Jul 21 17:15:32 jeanette kernel: [  742.141494] smpboot: CPU 2 is now offline
Jul 21 17:15:32 jeanette kernel: [  742.141940] intel_pstate CPU 3 exiting
Jul 21 17:15:32 jeanette kernel: [  742.142157] Broke affinity for irq 16
Jul 21 17:15:32 jeanette kernel: [  742.142167] Broke affinity for irq 58
Jul 21 17:15:32 jeanette kernel: [  742.142171] Broke affinity for irq 59
Jul 21 17:15:32 jeanette kernel: [  742.142174] Broke affinity for irq 60
Jul 21 17:15:32 jeanette kernel: [  742.142178] Broke affinity for irq 61
Jul 21 17:15:32 jeanette kernel: [  742.142182] Broke affinity for irq 62
Jul 21 17:15:32 jeanette kernel: [  742.142186] Broke affinity for irq 63
Jul 21 17:15:32 jeanette kernel: [  742.143209] kvm: disabling virtualization on CPU3
Jul 21 17:15:32 jeanette kernel: [  742.245568] smpboot: CPU 3 is now offline
Jul 21 17:15:32 jeanette kernel: [  742.247798] ACPI: Low-level resume complete
Jul 21 17:15:32 jeanette kernel: [  742.247870] PM: Restoring platform NVS memory
Jul 21 17:15:32 jeanette kernel: [  742.248371] Enabling non-boot CPUs ...
Jul 21 17:15:32 jeanette kernel: [  742.248514] x86: Booting SMP configuration:
Jul 21 17:15:32 jeanette kernel: [  742.248515] smpboot: Booting Node 0 Processor 1 APIC 0x2
Jul 21 17:15:32 jeanette kernel: [  742.262580] kvm: enabling virtualization on CPU1
Jul 21 17:15:32 jeanette kernel: [  742.265445] Intel pstate controlling: cpu 1
Jul 21 17:15:32 jeanette kernel: [  742.265527] CPU1 is up
Jul 21 17:15:32 jeanette kernel: [  742.265649] smpboot: Booting Node 0 Processor 2 APIC 0x1
Jul 21 17:15:32 jeanette kernel: [  742.277734] kvm: enabling virtualization on CPU2
Jul 21 17:15:32 jeanette kernel: [  742.279951] Intel pstate controlling: cpu 2
Jul 21 17:15:32 jeanette kernel: [  742.279988] CPU2 is up
Jul 21 17:15:32 jeanette kernel: [  742.280050] smpboot: Booting Node 0 Processor 3 APIC 0x3
Jul 21 17:15:32 jeanette kernel: [  742.292766] kvm: enabling virtualization on CPU3
Jul 21 17:15:32 jeanette kernel: [  742.295110] Intel pstate controlling: cpu 3
Jul 21 17:15:32 jeanette kernel: [  742.295152] CPU3 is up
Jul 21 17:15:32 jeanette kernel: [  742.298552] ACPI: Waking up from system sleep state S3
Jul 21 17:15:32 jeanette kernel: [  744.337720] xhci_hcd 0000:00:14.0: System wakeup disabled by ACPI
Jul 21 17:15:32 jeanette kernel: [  744.373586] PM: noirq resume of devices complete after 35.923 msecs
Jul 21 17:15:32 jeanette kernel: [  744.374035] PM: early resume of devices complete after 0.411 msecs
Jul 21 17:15:32 jeanette kernel: [  744.374361] snd_hda_intel 0000:00:03.0: irq 64 for MSI/MSI-X
Jul 21 17:15:32 jeanette kernel: [  744.374551] mei_me 0000:00:16.0: irq 65 for MSI/MSI-X
Jul 21 17:15:32 jeanette kernel: [  744.374709] snd_hda_intel 0000:00:1b.0: irq 67 for MSI/MSI-X
Jul 21 17:15:32 jeanette kernel: [  744.375260] wl_resume: PCI Resume handler
Jul 21 17:15:32 jeanette kernel: [  744.389582] sd 0:0:0:0: [sda] Starting disk
Jul 21 17:15:32 jeanette kernel: [  744.397847] wl0: link down (wlan0)
Jul 21 17:15:32 jeanette kernel: [  744.397977] cfg80211: Calling CRDA to update world regulatory domain
Jul 21 17:15:32 jeanette kernel: [  744.442537] bcm5974: bad trackpad package, length: 8
Jul 21 17:15:32 jeanette kernel: [  744.462271] PM: resume of devices complete after 88.162 msecs
Jul 21 17:15:32 jeanette kernel: [  744.462422] PM: Finishing wakeup.
Jul 21 17:15:32 jeanette kernel: [  744.462423] Restarting tasks ... done.
Jul 21 17:15:32 jeanette kernel: [  744.473749] cfg80211: World regulatory domain updated:
Jul 21 17:15:32 jeanette kernel: [  744.473752] cfg80211:  DFS Master region: unset
Jul 21 17:15:32 jeanette kernel: [  744.473754] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 17:15:32 jeanette kernel: [  744.473757] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 17:15:32 jeanette kernel: [  744.473759] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 17:15:32 jeanette kernel: [  744.473761] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 17:15:32 jeanette kernel: [  744.473764] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 17:15:32 jeanette kernel: [  744.473767] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 17:15:32 jeanette kernel: [  744.473769] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Jul 21 17:15:32 jeanette kernel: [  744.473771] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 17:15:32 jeanette kernel: [  744.473773] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Jul 21 17:15:32 jeanette kernel: [  744.717805] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Jul 21 17:15:32 jeanette kernel: [  744.718029] ata1.00: unexpected _GTF length (8)
Jul 21 17:15:32 jeanette kernel: [  744.718287] ata1.00: unexpected _GTF length (8)
Jul 21 17:15:32 jeanette kernel: [  744.718320] ata1.00: configured for UDMA/133
Jul 21 17:15:33 jeanette kernel: [  745.734596] [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off
Jul 21 17:16:58 jeanette kernel: [  830.655708] wl0: online cpus 1
Jul 21 17:16:58 jeanette kernel: [  830.656091] wlan0: Broadcom BCM43a0 802.11 Hybrid Wireless Controller 6.30.223.248 (r487574)
Jul 21 17:17:02 jeanette kernel: [  835.135824] wl0: link up (wlan0)
Jul 21 17:17:02 jeanette kernel: [  835.135965] cfg80211: Calling CRDA for country: GB
Jul 21 17:17:02 jeanette kernel: [  835.138259] cfg80211: Regulatory domain changed to country: GB
Jul 21 17:17:02 jeanette kernel: [  835.138262] cfg80211:  DFS Master region: ETSI
Jul 21 17:17:02 jeanette kernel: [  835.138263] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 21 17:17:02 jeanette kernel: [  835.138265] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 21 17:17:02 jeanette kernel: [  835.138267] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 21 17:17:02 jeanette kernel: [  835.138268] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 21 17:17:02 jeanette kernel: [  835.138270] cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
Jul 21 17:17:02 jeanette kernel: [  835.138271] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Comment 11 Aaron Lu 2015-07-22 03:04:53 UTC
I think it has something to do with the acpi_video interface re-appeared in later kernels, I have no idea why this is the case though. With a v4.0 kernel, you can add video.use_native_backlight=1 to kernel cmdline and then verify if /sys/class/backlight/acpi_videoX isn't there and do the suspend test again, see if the backlight is back on resume.
Comment 12 Tony Houghton 2015-07-25 12:32:40 UTC
I've added that but it hasn't made any difference to the contents of /sys/class/backlight and it's still intermittently failing to light up on resume.
Comment 13 Aaron Lu 2015-07-30 06:26:34 UTC
acpidump please:
# acpidump > acpidump.txt
Comment 14 Tony Houghton 2015-07-30 12:33:07 UTC
Created attachment 184011 [details]
Output of acpidump
Comment 15 Tony Houghton 2015-08-02 15:22:32 UTC
I just had another failure to suspend (twice). There was nothing in the logs at all for the times when I closed the log. I checked messages, syslog and kern.log from /var/log, dmesg and journalctl.

I think this is a separate issue, it looks as if the lid button was just ignored for some reason. I didn't remember to try using pm-suspend this time. The problem could even be caused by GNOME; it had queued some Debian updates for installation at reboot, and it does sometimes do strange things around updates.
Comment 16 Aaron Lu 2015-08-21 07:34:11 UTC
BTW, can you please boot into console mode and do the suspend/resume to see if backlight behaves the same?
Comment 17 Tony Houghton 2015-08-22 20:05:18 UTC
Since upgrading to kernel 4.1 it seems much better; the backlight usually comes back on now, but I'm not sure whether it's every time. It still often does a sort of blink on-off-on sequence.
Comment 18 Aaron Lu 2015-08-24 02:10:50 UTC
(In reply to Tony Houghton from comment #17)
> Since upgrading to kernel 4.1 it seems much better; the backlight usually
> comes back on now, but I'm not sure whether it's every time. It still often
> does a sort of blink on-off-on sequence.

When will it do a sort of blink on-off-on sequence? During normal using time?
Comment 19 Tony Houghton 2015-08-27 14:48:15 UTC
No, it only blinks when I resume from suspend (by opening the lid).
Comment 20 Aaron Lu 2015-08-28 02:42:14 UTC
After it blinks, is it normal then?
Comment 21 Tony Houghton 2015-08-31 10:33:33 UTC
Yes, it behaves normally after the blinks.
Comment 22 Aaron Lu 2015-09-01 02:12:25 UTC
I'm not sure what caused the on-off-on sequence during resume, can you try another distro please(fedora perhaps)? Since it works well after that sequence, I don't think there is a kernel/driver issue.
Comment 23 Tony Houghton 2015-09-04 13:53:24 UTC
Apart from the blinking, it looks like the backlight always manages to come back on with kernel 4.1. But the failure to suspend is still sometimes a problem. I think I've got a clue as to how I can reproduce it, related to plugging/unplugging the PSU. Should I open a new bug for that, and is it more likely to be something else like systemd or gnome? FWIW the battery indicator is failing to indicate that the power is connected too. These symptoms are very similar to problems I experienced with a Samsung NP900X3C last year eg #44161.
Comment 24 Aaron Lu 2015-09-06 01:32:24 UTC
(In reply to Tony Houghton from comment #23)
> Apart from the blinking, it looks like the backlight always manages to come
> back on with kernel 4.1. But the failure to suspend is still sometimes a
> problem. I think I've got a clue as to how I can reproduce it, related to
> plugging/unplugging the PSU. Should I open a new bug for that, and is it
> more likely to be something else like systemd or gnome? FWIW the battery
> indicator is failing to indicate that the power is connected too. These
> symptoms are very similar to problems I experienced with a Samsung NP900X3C
> last year eg #44161.

I think you can file two new bugs:
1 For the suspend failed problem;
2 For the battery.

And since this bug is about backlight and it doesn't have this problem any more with v4.1, I'll close it.
Comment 25 Tony Houghton 2015-10-05 11:17:39 UTC
The backlight problem seems to have come back again since upgrading to 4.2 :-(.
Comment 26 Aaron Lu 2015-10-08 02:17:25 UTC
More detail please, is it that after resume, the screen isn't turned on?
Comment 27 Tony Houghton 2015-10-08 12:34:31 UTC
Yes, but it comes on when I press one of the brightness keys, Fn+F1 or Fn+F2. It seems to be intermittent again, pretty much as I originally reported with 3.19.
Comment 28 Aaron Lu 2015-10-09 02:13:28 UTC
What interfaces do you have under /sys/class/backlight now?
Comment 29 Tony Houghton 2015-10-09 13:08:55 UTC
I've got the two again, acpi_video0 and intel_backlight.
Comment 30 Aaron Lu 2015-10-10 02:08:11 UTC
Created attachment 189871 [details]
print is_win8

Please apply this patch and attach dmesg after boot up, I would like to see why acpi_video interface is still registered.
Comment 31 Aaron Lu 2015-10-15 02:09:11 UTC
ping?
Comment 32 Tony Houghton 2015-10-15 14:32:55 UTC
Created attachment 190271 [details]
dmesg output from 4.2.3

I applied patch 189871 to Debian's 4.2.3-1.
Comment 33 Aaron Lu 2015-10-16 06:16:47 UTC
Hi Lv,

Can you please take a look at this dump and why Linux doesn't think it is a Win8 firmware? Notice that this is a MacBook so it may respond true to _OSI("Darwin"). Thanks!
Comment 34 Lv Zheng 2015-10-16 07:58:21 UTC
Hi,

Please upload 2 dmesg outputs:

A> Execution logs for \PINI
1. add the following boot parameters:
    acpi.trace_state=opcode acpi.trace_method_name=\PINI
2. boot the kernel and upload the dmesg

B> Execution logs for \_SB.PCI0._INI
1. add the following boot parameters:
    acpi.trace_state=opcode acpi.trace_method_name=\_SB.PCI0._INI
2. boot the kernel and upload the dmesg

Thanks and best regards
-Lv
Comment 35 Lv Zheng 2015-10-16 08:00:30 UTC
You need to enable CONFIG_ACPI_DEBUG to build the kernels.
And if grub failed to pass correct "\" to the kernel (you can confirm it via dmesg outputs).

You can use:
acpi.trace_state=opcode acpi.trace_method_name=PINI
acpi.trace_state=opcode acpi.trace_method_name=_SB.PCI0._INI

Thanks and best regards
-Lv
Comment 36 Tony Houghton 2015-10-16 16:08:53 UTC
Created attachment 190351 [details]
dmesg output from 4.2.3-2 + acpi.trace_method_name=PINI
Comment 37 Tony Houghton 2015-10-16 16:09:41 UTC
Created attachment 190361 [details]
dmesg output from 4.2.3-2 + acpi.trace_method_name=_SB.PCI0._INI
Comment 38 Tony Houghton 2015-10-16 16:15:56 UTC
I don't know if these logs will do what you want, because it seems to be objecting to the "opcode" parameter.

Meanwhile I've resized my partitions and have been able to start a git bisect after all. I'm looking for the point between 3.16 and 4.0 when it started to make two entries in /sys/class/backlight because the suspend/resume misbehaviour is somewhat difficult to test. I've got an estimated 8 steps left, so it will probably take another day or more to complete them all.
Comment 39 Tony Houghton 2015-10-18 13:30:41 UTC
Created attachment 190461 [details]
Result of git bisect, see comment #38
Comment 40 Tony Houghton 2015-10-18 13:31:09 UTC
Created attachment 190471 [details]
git bisect log, see comment #38
Comment 41 Aaron Lu 2015-10-19 02:10:42 UTC
Thanks a lot for the bisect, it's very useful!

So the problem is, since commit [7bc5a2bad0b8d9d1ac9f7b8b33150e4ddf197334] ACPI: Support _OSI("Darwin") correctly, Linux will not recognize the firmware as Win8 compliant and thus the acpi_videoX interface gets created.

I suppose if you add acpi_backlight=native to kernel cmdline, then the system will not create acpi_videoX interface?

In the meantime, can you please verify if acpi_videoX works by doing (as root):
# cd /sys/class/backlight/acpi_video0
# cat max_brightness
XXX
# echo YYY > brightness
where YYY is between 0 ~ XXX

If it works, then we can see why it failed to restore the backlight on resume. Thanks again.
Comment 42 Lv Zheng 2015-10-19 02:48:15 UTC
(In reply to Tony Houghton from comment #38)
> I don't know if these logs will do what you want, because it seems to be
> objecting to the "opcode" parameter.

The command line is correct, but the AML trace feature can only be found on 4.3.1+ kernels:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7901a05

Thanks and best regards
-Lv
Comment 43 Tony Houghton 2015-10-19 14:47:28 UTC
(In reply to Aaron Lu from comment #41)
> Thanks a lot for the bisect, it's very useful!
> 
> So the problem is, since commit [7bc5a2bad0b8d9d1ac9f7b8b33150e4ddf197334]
> ACPI: Support _OSI("Darwin") correctly, Linux will not recognize the
> firmware as Win8 compliant and thus the acpi_videoX interface gets created.
> 
> I suppose if you add acpi_backlight=native to kernel cmdline, then the
> system will not create acpi_videoX interface?

Yes, with that parameter I only get intel_backlight. I haven't tested suspend/resume with it yet, but everything else seems to be working correctly, ie if I write a value to the /sys/... pseudo-file the brightness changes and the GNOME brightness widget syncs with the new value. It also even seems to have fixed this for me: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=787939>, but it's still too early to confirm that.

> In the meantime, can you please verify if acpi_videoX works by doing (as
> root):
> # cd /sys/class/backlight/acpi_video0
> # cat max_brightness
> XXX
> # echo YYY > brightness
> where YYY is between 0 ~ XXX
> 
> If it works, then we can see why it failed to restore the backlight on
> resume. Thanks again.

Yes, that did change the brightness, and it was synced with the GNOME widget. intel_backlight also changed the brightness, but it had a different max (1388 vs 100) and the GNOME widget didn't pick up the changes.
Comment 44 Aaron Lu 2015-10-30 02:08:46 UTC
Created attachment 191511 [details]
Add debug print to see the backlight value set by acpi_video

Somehow I forgot this bug, sorry.

I have made a patch to add debug print on resume to see the backlight value set by ACPI video driver, in the meantime, the i915 GPU driver may also set a backlight value, so please add drm.debug=0xe to kernel commandline when testing this patch, and attach dmesg after system resumed.

Since it is a black screen after resume(but the system is otherwise alive), I think you can do somehting like this:
1 issue the following command
# echo mem > /sys/power/state; dmesg > dmesg_after_resume; reboot
2 wakeup the system with power button, and the system should reboot itself
3 find the dmesg_after_resume file and attach.

Thanks!
Comment 45 Tony Houghton 2015-10-30 14:01:51 UTC
I don't have to reboot because I can restore the backlight with the Fn keys. I'm not sure exactly what you want me to do. Do I have to write to /sys/power/state while the backlight is off or before or after sleep/resume?
Comment 46 Aaron Lu 2015-11-02 01:36:29 UTC
(In reply to Tony Houghton from comment #45)
> I don't have to reboot because I can restore the backlight with the Fn keys.

Right, but that would emit some more related messages into the dmesg buffer and that additional messages could make checking information more difficult.

> I'm not sure exactly what you want me to do. Do I have to write to
> /sys/power/state while the backlight is off or before or after sleep/resume?

Issue the above command right after boot up, you do not need to do anything after resume, since the above command will reboot the system after taking the dmesg.
Comment 47 Aaron Lu 2015-11-09 08:07:27 UTC
Any update?
Comment 48 Tony Houghton 2015-11-09 18:42:58 UTC
Created attachment 192561 [details]
dmesg log from 4.3 as requested in comment 44.

Sorry about the delay; I'd been experiencing some hard crashes while using Android Studio so I resorted to OS X. I'll see how it goes with a different JDK and newer kernel...

I downloaded 4.3 from kernel.org and did what you said in comment #44 (adding a sleep before the reboot because it occurred to me that the symptom is intermittent and I might not be able to tell the difference if it rebooted immediately). The results were a bit unexpected.

When running that command the laptop appeared to suspend, but resumed on its own after a couple of seconds. I tried about five times, and each time the backlight came back on immediately. I'm attaching one of the logs anyway.

Suspending by closing the lid seems to work OK (not appearing to resume until I reopen it), but again the backlight comes back on immediately, without the flicker I had before.

I still have the two entries in /sys/class/backlight while I have removed acpi_backlight=native from the grub command line for debugging.
Comment 49 Tony Houghton 2015-11-09 18:46:09 UTC
I enabled CONFIG_ACPI_DEBUG with the new kernel, but I don't know whether I can run the other test for Lv, because it appears to be 4.3(.0) rather than 4.3.1. I tried linux-latest.zip from github, but that failed to build with some circular depmod dependencies.
Comment 50 Lv Zheng 2015-11-10 03:18:31 UTC
(In reply to Tony Houghton from comment #49)
> I enabled CONFIG_ACPI_DEBUG with the new kernel, but I don't know whether I
> can run the other test for Lv, because it appears to be 4.3(.0) rather than
> 4.3.1. I tried linux-latest.zip from github, but that failed to build with
> some circular depmod dependencies.

With kernel 4.3, the feature should be avaiable.
If you want, you can give it a try.

But since you've bisected the culprit, I think Aaron should have known what's going on there. So I'm not sure if the test is necessary.

Thanks and best regards
-Lv
Comment 51 Lv Zheng 2015-11-10 03:22:01 UTC
I mean the git tag - "v4.3-rc1", which is the tag of the earliest release candidate for 4.3 kernels. So the feature should be available for all 4.3 releases.

Thanks and best regards
-Lv
Comment 52 Aaron Lu 2015-11-10 05:19:55 UTC
[   62.156417] PM: Finishing wakeup.
[   62.156418] Restarting tasks ... done.
[   62.157100] video LNXVIDEO:00: Restoring backlight state
[   62.157104] acpi device:02: Restoring backlight state to 86
[   62.157657] [drm:asle_set_backlight] bclp = 0x800000db
[   62.157668] [drm:asle_set_backlight] updating opregion backlight 219/255
[   62.157675] [drm:intel_panel_actually_set_backlight] set backlight PWM = 1192

According to the above log, on resume, the acpi_videoX interface is setting a reasonable value so you get the backlight on.

Maybe you need to keep the drm.debug=0xe and keep skipping the acpi_backlight=native cmdline option, then if the problem occurs again after resume, you can use FN key to increase the backlight and then attach dmesg here.
In the meantime, since it is not reproducible right now, I'll close it. Please re-open if you reproduce it and attach the dmesg, thanks.

BTW, there is no need to do any ACPI trace debug etc. requested by Lv, I asked Lv for help to decide why _OSI("Windows 2012") failed but since we knew the support of _OSI("Darwin") will make that happen, we do not need to track that issue further. Lv, please let me know if you think otherwise, thanks.
Comment 53 Tony Houghton 2015-12-07 16:10:17 UTC
Created attachment 196551 [details]
dmesg after resume with backlight off

It hasn't done it for a long time, but it just did today.

Note You need to log in before you can comment on or make changes to this bug.