Bug 111909 - commit c1132367 "Extract GT render sleep (rc6) management" prevents entering s2idle
Summary: commit c1132367 "Extract GT render sleep (rc6) management" prevents entering ...
Status: NEW
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: Andi
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard: Triaged, ReadyForDev
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-06 22:29 UTC by Kenneth C
Modified: 2019-10-13 17:37 UTC (History)
3 users (show)

See Also:
i915 platform: CFL
i915 features: power/suspend-resume


Attachments
Defer rc6 shutdown to suspend_late (4.39 KB, patch)
2019-10-07 08:40 UTC, Chris Wilson
no flags Details | Splinter Review
Defer rc6 shutdown to suspend_late (5.13 KB, patch)
2019-10-07 10:55 UTC, Chris Wilson
no flags Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth C 2019-10-06 22:29:13 UTC
I've been running the drm-tip for about two weeks now.

I noted that my laptop (HP X360 Spectre 13") has been warm while suspended (and having even greater power drain than normal under s2idle (which is unfortunately all I have on this box).

Plugging in my USB-C power meter there is indeed a 100mA extra drain while suspended, more than just on a vanilla Linus tip kernel.

After bisecting, I narrowed it down to c113236718e89561f309705f1a78126b3df93a21; if I cut a kernel with drm-tip to just before that commit it does not have this issue (my initial quick attempt at fixing up the conflicts while trying to revert this commit crashes the i915 driver on resume, and I didn't go further in trying to fix that).

Please let me know if there's any additional information you'd need.
Comment 1 Chris Wilson 2019-10-06 23:28:25 UTC
So s2idle is S0, which is equivalent to our runtime suspend. Only it calls into our pm hooks that are expecting to go S3+.

echo freeze > /sys/power/state

I think we just need to keep wait_for_idle in gem_suspend and move intel_gt_pm_suspend to pm_late_suspend.
Comment 2 Chris Wilson 2019-10-07 08:40:05 UTC
Created attachment 145672 [details] [review]
Defer rc6 shutdown to suspend_late

I haven't traced the S0 callpath, but this seems like the easiest option we have available. If this fails, we'll have to patch in a few more hooks from pm to the backends.
Comment 3 Chris Wilson 2019-10-07 10:55:29 UTC
Created attachment 145673 [details] [review]
Defer rc6 shutdown to suspend_late
Comment 4 Kenneth C 2019-10-07 16:42:43 UTC
I will try that patch this morning.
Comment 5 Kenneth C 2019-10-07 17:36:47 UTC
Patch applied to drm-tip; did not fix high s2idle power consumption, unfortunately.

What can I do to help you diagnose the suspend path?
Comment 6 Chris Wilson 2019-10-13 14:44:31 UTC
Ok, so the device/base/power treats S0 as a full suspend, so we don't have any differentiates in our callbacks. However, I did find pm_suspend_target_state we can use. See https://patchwork.freedesktop.org/patch/335634/?series=67667&rev=2
Comment 7 Kenneth C 2019-10-13 17:21:54 UTC
(In reply to Chris Wilson from comment #6)
> Ok, so the device/base/power treats S0 as a full suspend, so we don't have
> any differentiates in our callbacks. However, I did find
> pm_suspend_target_state we can use. See
> https://patchwork.freedesktop.org/patch/335634/?series=67667&rev=2

Thank you. I've carved out "drm-next" from Linus' tip for my machine to get me working reliably, but I still have the branch with drm-tip, and will try this later today.

Also:

>> S0 (s2idle) where the device is kept awake but needs to be in a low power mode 

My laptop is plagued with this "s01x" idle, which drains the battery quickly when in "suspend" even under the best case (which apparently Linux can't enter, at least on my hardware). You know this better than I, but is it possible to NOT keep the i915 awake in this mode (or does that mean a kind of restore as in a hibernate on resume)?
Comment 8 Chris Wilson 2019-10-13 17:29:27 UTC
(In reply to Kenneth C from comment #7)
> (In reply to Chris Wilson from comment #6)
> >> S0 (s2idle) where the device is kept awake but needs to be in a low power mode 
> 
> My laptop is plagued with this "s01x" idle, which drains the battery quickly
> when in "suspend" even under the best case (which apparently Linux can't
> enter, at least on my hardware). You know this better than I, but is it
> possible to NOT keep the i915 awake in this mode (or does that mean a kind
> of restore as in a hibernate on resume)?

So the main difference with S0 is that the pci device itself is not powered down. But now that we can detect S0, we should be able to call into intel_runtime_suspend() which should do as put the device into its most power conserving state. Worth a shot.
Comment 9 Chris Wilson 2019-10-13 17:37:42 UTC
https://patchwork.freedesktop.org/series/67954/ is worth a short to see what happens and how much work would be required.


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.