From: Dave Gordon <david.s.gordon@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Imre Deak <imre.deak@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
intel-gfx@lists.freedesktop.org
Subject: Re: S4 resume breakage with i915 driver
Date: Fri, 2 Sep 2016 19:34:52 +0100 [thread overview]
Message-ID: <c6f4d7fa-2e62-60cd-3264-fee4c9dd97db@intel.com> (raw)
In-Reply-To: <20160829133211.GL10980@phenom.ffwll.local>
On 29/08/16 14:32, Daniel Vetter wrote:
> On Fri, Aug 26, 2016 at 02:42:47PM +0300, Imre Deak wrote:
>> On pe, 2016-08-26 at 14:10 +0300, Imre Deak wrote:
>>> On pe, 2016-08-26 at 11:39 +0100, Chris Wilson wrote:
>>>> On Fri, Aug 26, 2016 at 12:25:01PM +0200, Takashi Iwai wrote:
>>>>> On Fri, 26 Aug 2016 11:18:00 +0200,
>>>>> Takashi Iwai wrote:
>>>>>> I had to modify the intel_gpu_reset() call because the test was
>>>>>> done
>>>>>> on the older kernel, so it's like:
>>>>>>
>>>>>> + intel_gpu_reset(dev_to_i915(dev)->dev);
>>>>>>
>>>>>> And, it seems working on HSW! \o/
>>>>>>
>>>>>> A simple trick, better than the magical register write revert.
>>>>>> I'll check other machines, too, to see whether it has any
>>>>>> negative
>>>>>> impact.
>>>>>
>>>>> The test results look good on all machines.
>>>>
>>>> The theory then is that the GPU's are active across the load of the
>>>> hibernation image and so before the GTT is updated the memory
>>>> currently
>>>> in use by the GPU is reused by the system.
>>>>
>>>> The key question then is the memory of boot kernel still in place
>>>> during
>>>> the hibernate restore phase?
>>>
>>> Before restoring the image all devices are quiesced by calling their
>>> freeze callback, so the GPU should be idle already
>>> in i915_pm_restore_early() already.
>>
>> But this happens in the loader kernel, so if that doesn't have the
>> driver built-in then the freeze callback won't be called either. So any
>> possible BIOS related GPU activity/setup should be quiesced from the
>> restore callback then.
>
> I thought the loader kernel has an entire initrd attached, to allow stuff
> like typing in the disk encryption passwd. Which means we very much do
> load i915 in the loader kernel already.
>
> So maybe we need to throw a gpu reset into the right hook (shutdown or
> whatever it was) to make sure the loader kernel really stops all gpu write
> cycles, including anything done due to power saving context restoring. We
> already know that the only way to get the gpu off the context image
> permanently is a gpu reset, so that would make some sense.
> -Daniel
>
>>
>>>> If we need to add a ->shutdown callback (if
>>>> that is even called before hibernate restore) then we can only fix
>>>> future kernels and are still susceptible to corruption when booing
>>>> from
>>>> old kernels.
>>>>
>>>> Any one familiar with the details of the hibernation restore? (And
>>>> how
>>>> much relates to kexec?)
>>>> -Chris
Seems like:
1. the driver should quiesce the h/w *as much as possible* during the
saving of the hibernation image -- which may mean a reset during this
phase; otherwise there might be some risk of the saved image being
incomplete or inconsistent.
2. the driver should make *no assumptions whatsoever* about the state of
the h/w during resume-from-hibernation, as we don't know what state the
bios may have left it in, or whether a (possibly completely different)
version of the driver in the loader kernel played with it at all. So a
hard reset should be mandatory during resume.
[Aside: that other (fault-tolerant) kernel I used to work on took this
approach. Whenever a driver is *given* control of a device, it should
assume *nothing*, reset the h/w, and reprogram from scratch. And when
it's about to *lose* control of a device, it should quiesce all activity
and then reset the h/w to the default state before handing it back. That
way there are no surprises for anybody.]
.Dave.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-09-02 18:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-25 13:11 S4 resume breakage with i915 driver Takashi Iwai
2016-08-25 15:32 ` Chris Wilson
2016-08-25 15:54 ` Takashi Iwai
2016-08-25 16:12 ` Chris Wilson
2016-08-25 16:15 ` Takashi Iwai
2016-08-26 9:18 ` Takashi Iwai
2016-08-26 10:25 ` Takashi Iwai
2016-08-26 10:39 ` Chris Wilson
2016-08-26 11:10 ` Imre Deak
2016-08-26 11:42 ` Imre Deak
2016-08-29 13:32 ` Daniel Vetter
2016-08-29 14:09 ` Imre Deak
2016-08-29 14:24 ` Takashi Iwai
2016-08-29 14:54 ` Imre Deak
2016-08-29 15:25 ` Chris Wilson
2016-08-29 16:46 ` Lukas Wunner
2016-08-30 11:43 ` Imre Deak
2016-08-30 11:33 ` Imre Deak
2016-09-02 18:34 ` Dave Gordon [this message]
2016-08-26 12:29 ` David Weinehall
2016-08-26 12:38 ` Chris Wilson
2016-08-26 12:54 ` David Weinehall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c6f4d7fa-2e62-60cd-3264-fee4c9dd97db@intel.com \
--to=david.s.gordon@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox