GalliumOS / galliumos-distro

Docs, issues, and artwork sources for GalliumOS
https://galliumos.org/
GNU General Public License v2.0
347 stars 11 forks source link

braswell doesn't wake up from sleep properly #488

Closed chrisjohgorman closed 5 years ago

chrisjohgorman commented 5 years ago

hardware: Acer Chromebook 15, CB3-532, BANON, braswell architecture. issue: When left alone to sleep. Sleep state is entered, but I cannot wake machine after leaving it to sleep for an undetermined period. I have looked around and am currently playing with the idea that this is the same issue as baytrail architectures have with the intel_idle.max_cstate.

Setting intel_idle.max_cstate=2 in the /etc/default/grub fixes the problem. A few thoughts. 1) I haven't figured out if I'm using the correct intel_idle.max_cstate value. 2) When the intel_idle.max_cstate=3, the power manager starts using about 15% of the processor. 3) I have had success with intel_idle.max_cstate=1 and intel_idle.max_cstate=0 as well. These values allow for the machine to wake after I let it go to sleep. I am working on the assumption that I want to have the machine entering the highest integer sleep state possible. This could be wrong. 4) As I understand the baytrail bug, the i915 video driver attempts to enter a sleep state that the processor doesn't support and requires a reboot to get the display going again.

I will report back if I find out any more on this issue.

chrisjohgorman commented 5 years ago

Forgot this detail, Full ROM/UEFI

chrisjohgorman commented 5 years ago

When left overnight, the laptop needed to be rebooted. Upon further searches I found https://bugzilla.kernel.org/show_bug.cgi?id=109051, and consequently powertop. I have no idea how to use powertop, but have poked around with it. It has a section tuneable and allows a binary toggle of some of the kernel's power management settings. I toggled them all to good and left the laptop closed for an hour to see what I'd get. My laptop resumed, but I get a kernel oops.

[ 797.930873] ------------[ cut here ]------------ [ 797.930880] Unclaimed read from register 0x1f0034 [ 797.931117] WARNING: CPU: 0 PID: 5249 at drivers/gpu/drm/i915/intel_uncore.c:986 unclaimed_reg_debug+0x45/0x60 [i915] [ 797.931120] Modules linked in: iwlmvm mac80211 iwlwifi cfg80211 msr ccm rfcomm cmac bnep lz4 lz4_compress zram arc4 intel_rapl intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul snd_soc_sst_cht_bsw_rt5645 crc32_pclmul binfmt_misc ghash_clmulni_intel joydev pcbc aesni_intel aes_x86_64 crypto_simd glue_helper cryptd nls_iso8859_1 snd_hda_codec_hdmi btusb snd_intel_sst_acpi uvcvideo btrtl btbcm videobuf2_vmalloc snd_intel_sst_core videobuf2_memops snd_soc_rt5645 snd_hda_intel btintel snd_soc_sst_atom_hifi2_platform videobuf2_v4l2 snd_soc_rt5640 snd_soc_acpi snd_soc_rl6231 snd_soc_acpi_intel_match videobuf2_common snd_hda_codec bluetooth videodev snd_hwdep snd_soc_core snd_hda_core snd_pcm_oss snd_mixer_oss snd_compress snd_pcm_dmaengine media snd_seq_midi snd_seq_midi_event ecdh_generic [ 797.931374] snd_pcm lpc_ich snd_rawmidi shpchp snd_seq cros_ec_core snd_seq_device snd_timer mfd_core snd int3403_thermal elan_i2c processor_thermal_device soundcore int3400_thermal int340x_thermal_zone 8250_dw mac_hid intel_soc_dts_iosf acpi_thermal_rel sch_fq_codel ip_tables x_tables autofs4 btrfs xor zstd_decompress zstd_compress xxhash raid6_pq dm_mirror dm_region_hash dm_log i915 uas usb_storage mmc_block i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm video sdhci_pci cqhci drm_panel_orientation_quirks sdhci [last unloaded: cfg80211] [ 797.931585] CPU: 0 PID: 5249 Comm: systemd-sleep Not tainted 4.16.13-galliumos #1 [ 797.931588] Hardware name: GOOGLE Banon/Banon, BIOS MrChromebox 08/27/2018 [ 797.931691] RIP: 0010:unclaimed_reg_debug+0x45/0x60 [i915] [ 797.931696] RSP: 0018:ffffbaf4424aba90 EFLAGS: 00010082 [ 797.931704] RAX: 0000000000000025 RBX: 0000000000000000 RCX: 0000000000000002 [ 797.931710] RDX: 0000000080000002 RSI: 0000000000000092 RDI: 00000000ffffffff [ 797.931714] RBP: 00000000001f0034 R08: 0000000000000000 R09: 0000000000000025 [ 797.931718] R10: 0000000000000018 R11: 0000000000000000 R12: 0000000000000001 [ 797.931723] R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000202 [ 797.931729] FS: 00007f5ef2cf6940(0000) GS:ffff8fa0bb800000(0000) knlGS:0000000000000000 [ 797.931733] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 797.931737] CR2: 00007f41eff3d200 CR3: 0000000076aac000 CR4: 00000000001006f0 [ 797.931743] Call Trace: [ 797.931862] fwtable_read32+0x171/0x1c0 [i915] [ 797.931954] vlv_program_watermarks+0x42f/0x6d0 [i915] [ 797.932050] vlv_optimize_watermarks+0x99/0xb0 [i915] [ 797.932155] intel_atomic_commit_tail+0x20d/0xcf0 [i915] [ 797.932265] ? intel_atomic_commit_ready+0x44/0x4c [i915] [ 797.932371] intel_atomic_commit+0x21f/0x2d0 [i915] [ 797.932384] ? pci_pm_freeze+0xd0/0xd0 [ 797.932416] drm_atomic_helper_commit_duplicated_state+0xd7/0x100 [drm_kms_helper] [ 797.932523] __intel_display_resume+0x7d/0xc0 [i915] [ 797.932630] intel_display_resume+0xc1/0xf0 [i915] [ 797.932721] i915_drm_resume+0xb8/0x130 [i915] [ 797.932735] dpm_run_callback+0x4d/0x170 [ 797.932748] device_resume+0xd7/0x1e0 [ 797.932760] dpm_resume+0x117/0x320 [ 797.932768] ? dpm_resume_early+0x21c/0x310 [ 797.932775] dpm_resume_end+0xd/0x20 [ 797.932787] suspend_devices_and_enter+0x151/0x8b0 [ 797.932799] pm_suspend+0x318/0x380 [ 797.932810] state_store+0x7d/0xe0 [ 797.932824] kernfs_fop_write+0x105/0x180 [ 797.932837] vfs_write+0xad/0x1a0 [ 797.932847] SyS_write+0x42/0x90 [ 797.932862] do_syscall_64+0x6e/0x120 [ 797.932874] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [ 797.932886] RIP: 0033:0x7f5ef2820154 [ 797.932889] RSP: 002b:00007ffc124ccb78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 797.932898] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f5ef2820154 [ 797.932902] RDX: 0000000000000004 RSI: 000055d06478eeb0 RDI: 0000000000000004 [ 797.932906] RBP: 000055d06478eeb0 R08: 000055d06478d370 R09: 00007f5ef2cf6940 [ 797.932909] R10: 000000000000000a R11: 0000000000000246 R12: 000055d06478d290 [ 797.932913] R13: 0000000000000004 R14: 00007f5ef2af82a0 R15: 00007f5ef2af7760 [ 797.932923] Code: db 74 05 5b 5d 41 5c c3 45 84 e4 48 c7 c0 83 6e 52 c0 48 c7 c6 79 6e 52 c0 48 0f 44 f0 89 ea 48 c7 c7 8c 6e 52 c0 e8 5b 82 be f4 <0f> 0b 83 2d e2 20 10 00 01 5b 5d 41 5c c3 0f 1f 00 66 2e 0f 1f [ 797.933057] ---[ end trace 636191ffea51de89 ]---

I will try to reproduce this.

chrisjohgorman commented 5 years ago

I have since found that this issue has been resolved with the minor change of using powertop. I don't know what settings it has configured to optimize power consumption, but an ancillary benefit was that I can run pm-suspend and the computer goes into sleep mode, then wakes with a key press.