Bug 100759

Summary: [r600] System freeze on resume from sleep on battery with DPM enabled and linux 4.10
Product: DRI Reporter: Nicola Mori <nicolamori>
Component: DRM/RadeonAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: medium CC: nicolamori
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
journalctl log for failed resume none

Description Nicola Mori 2017-04-22 17:16:27 UTC
Created attachment 130983 [details]
journalctl log for failed resume

Since linux 4.10.1 my system freezes every time when resuming from sleep (suspend to ram) while on battery. The screen either remains black or displays garbage, and the only thing to do is a hard poweroff. The problem does not show up when either:

- running on AC or
- using linux 4.9 (tested with 4.9.11) or
- DPM is not enabled (radeon.dpm=0)

I checked journalctl but it does not contain anything useful. I attach the last part of the log, starting from the suspend request; it seems nothing from the failed resume process is logged.

System details:

- Archlinux x86_64
- Mobility Radeon HD 3470
- Plasma desktop 5.9.4
Comment 1 Nicola Mori 2017-12-30 18:35:40 UTC
I found the time to bisect and found that the culprit is:

commit 1c331f75aa6ccbf64ebcc5a019183e617c9d818a
Author: Lucas Stach <dev@lynxeye.de>
Date:   Sun Oct 23 01:05:33 2016 +0200

    drm/radeon/pm: autoswitch power state when in balanced mode
    
    The current default of always using the performance power state leads
    to increased power consumption of mobile devices, which have a dedicated
    battery power state. Switch between the performance and battery power
    state automatically, dpending on the current AC power status, when the
    user asked for the balanced power state.
    
    The user can still override this logic by asking for the performance
    or battery power state explicitly.
    
    Tested-by: Michel Dänzer <michel.daenzer@amd.com>
    Acked-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Lucas Stach <dev@lynxeye.de>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

I don't have the skills to understand what's broken, but I can test an eventual patch if someone provides it. Thanks.
Comment 2 Nicola Mori 2018-02-15 13:21:33 UTC
Is there any chance that this bug report will be addressed?
Comment 3 Alex Deucher 2018-02-15 13:44:00 UTC
Sorry, slipped off my radar.  I just sent the revert out for review.
Comment 4 Nicola Mori 2018-03-12 10:20:10 UTC
Hi Alex, any news about the revert patch? Is there any estimate about if and when it will be mainlined? Thanks.
Comment 5 Alex Deucher 2018-03-12 14:27:07 UTC
In 4.16 and will be flowing back to stable as well:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=53bf277b487eb5ae6695db01bede0fe406792119
Comment 6 Nicola Mori 2018-03-12 16:02:54 UTC
Wow, thanks! I finally can update from kernel 4.9.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.