2011-02-06 01:50:53

by Jeff Chua

[permalink] [raw]
Subject: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
>> The suspend monster is back! The suspend-to-ram is fine, but upon
>> resume, screen is blank. Haven't bisected in case someone has also
>> done so.
>
> BTW, please don't reply to messages containing patches with reports of problems
> that aren't caused by those patches. It's confusing at best and at worst it
> may result in the patches being rejected.

Sorry. New subject now:)


On Sun, Feb 6, 2011 at 2:51 AM, Linus Torvalds
<[email protected]> wrote:
>> It's very recent. ... between commit
>> 831d52bc153971b70e64eccfbed2b232394f22f8 and
>> 44f2c5c841da1b1e0864d768197ab1497b5c2cc1.
>
> Hmm. It's almost certainly one of the DRI patches, but which one? I
> think bisection is the only way to figure it out. It shouldn't be too
> bad, since there's only 120 commits in that range.
>
> In fact, you can almost certainly just bisect from 89840966c579 to
> bb5b583b5279, which is just 31 commits and should get you bisected in
> just five tries or so.

Yea, I've just done that. It came down to the following commit.
Reverting it solves the problem. I've gone thru a few cycles, and
notebook still survives.

Thanks,
Jeff


commit 500f7147cf5bafd139056d521536b10c2bc2e154
Author: Chris Wilson <[email protected]>
Date: Mon Jan 24 15:14:41 2011 +0000

drm/i915: Reset state after a GPU reset or resume

Call drm_mode_config_reset() after an invalidation event to restore any
cached state to unknown.

Tested-by: Takashi Iwai <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>


2011-02-06 08:20:07

by Marc Burkhardt

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

Hi,

* Jeff Chua <[email protected]> [2011-02-06 09:50:51 +0800]:
> On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
> >> The suspend monster is back! The suspend-to-ram is fine, but upon
> >> resume, screen is blank. Haven't bisected in case someone has also
> >> done so.
> >
> > BTW, please don't reply to messages containing patches with reports of problems
> > that aren't caused by those patches. It's confusing at best and at worst it
> > may result in the patches being rejected.
>
> Sorry. New subject now:)
>
>
> On Sun, Feb 6, 2011 at 2:51 AM, Linus Torvalds
> <[email protected]> wrote:
> >> It's very recent. ... between commit
> >> 831d52bc153971b70e64eccfbed2b232394f22f8 and
> >> 44f2c5c841da1b1e0864d768197ab1497b5c2cc1.
> >
> > Hmm. It's almost certainly one of the DRI patches, but which one? I
> > think bisection is the only way to figure it out. It shouldn't be too
> > bad, since there's only 120 commits in that range.
> >
> > In fact, you can almost certainly just bisect from 89840966c579 to
> > bb5b583b5279, which is just 31 commits and should get you bisected in
> > just five tries or so.
>
> Yea, I've just done that. It came down to the following commit.
> Reverting it solves the problem. I've gone thru a few cycles, and
> notebook still survives.
>
> Thanks,
> Jeff

I reverted the specified commit and my box still suffers the
resume-turns-into-cold-boot behavior. Retried two times with the commit reverted
on top of HEAD...

Regards,
Marc

>
>
> commit 500f7147cf5bafd139056d521536b10c2bc2e154
> Author: Chris Wilson <[email protected]>
> Date: Mon Jan 24 15:14:41 2011 +0000
>
> drm/i915: Reset state after a GPU reset or resume
>
> Call drm_mode_config_reset() after an invalidation event to restore any
> cached state to unknown.
>
> Tested-by: Takashi Iwai <[email protected]>
> Signed-off-by: Chris Wilson <[email protected]>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>

--
Marc Koschewski

2011-02-06 11:00:21

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Sun, 6 Feb 2011 09:50:51 +0800,
Jeff Chua wrote:
>
> On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
> >> The suspend monster is back! The suspend-to-ram is fine, but upon
> >> resume, screen is blank. Haven't bisected in case someone has also
> >> done so.
> >
> > BTW, please don't reply to messages containing patches with reports of problems
> > that aren't caused by those patches. It's confusing at best and at worst it
> > may result in the patches being rejected.
>
> Sorry. New subject now:)
>
>
> On Sun, Feb 6, 2011 at 2:51 AM, Linus Torvalds
> <[email protected]> wrote:
> >> It's very recent. ... between commit
> >> 831d52bc153971b70e64eccfbed2b232394f22f8 and
> >> 44f2c5c841da1b1e0864d768197ab1497b5c2cc1.
> >
> > Hmm. It's almost certainly one of the DRI patches, but which one? I
> > think bisection is the only way to figure it out. It shouldn't be too
> > bad, since there's only 120 commits in that range.
> >
> > In fact, you can almost certainly just bisect from 89840966c579 to
> > bb5b583b5279, which is just 31 commits and should get you bisected in
> > just five tries or so.
>
> Yea, I've just done that. It came down to the following commit.
> Reverting it solves the problem. I've gone thru a few cycles, and
> notebook still survives.

Hrm, what is the symptom? I couldn't find it because you cut off the
thread, and it's not cited.

The commit you mentioned just adds an interface, and the the callbacks
aren't defined. The real change is either in
commit f3269058e7a80083dcdf89698bfcd1a6c6f8fd12
drm/i915/crt: Force the initial probe after reset
or
commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
drm/i915: Reset crtc after resume

Also the fix might interact with
commit 811aaa55ba21ab37407018cfc01770d6b037d3fb
drm: Only set DPMS ON when actually configuring a mode


thanks,

Takashi

>
> Thanks,
> Jeff
>
>
> commit 500f7147cf5bafd139056d521536b10c2bc2e154
> Author: Chris Wilson <[email protected]>
> Date: Mon Jan 24 15:14:41 2011 +0000
>
> drm/i915: Reset state after a GPU reset or resume
>
> Call drm_mode_config_reset() after an invalidation event to restore any
> cached state to unknown.
>
> Tested-by: Takashi Iwai <[email protected]>
> Signed-off-by: Chris Wilson <[email protected]>
>

2011-02-06 11:02:34

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Sun, 6 Feb 2011 09:19:51 +0100,
Marc Koschewski wrote:
>
> Hi,
>
> * Jeff Chua <[email protected]> [2011-02-06 09:50:51 +0800]:
> > On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
> > >> The suspend monster is back! The suspend-to-ram is fine, but upon
> > >> resume, screen is blank. Haven't bisected in case someone has also
> > >> done so.
> > >
> > > BTW, please don't reply to messages containing patches with reports of problems
> > > that aren't caused by those patches. It's confusing at best and at worst it
> > > may result in the patches being rejected.
> >
> > Sorry. New subject now:)
> >
> >
> > On Sun, Feb 6, 2011 at 2:51 AM, Linus Torvalds
> > <[email protected]> wrote:
> > >> It's very recent. ... between commit
> > >> 831d52bc153971b70e64eccfbed2b232394f22f8 and
> > >> 44f2c5c841da1b1e0864d768197ab1497b5c2cc1.
> > >
> > > Hmm. It's almost certainly one of the DRI patches, but which one? I
> > > think bisection is the only way to figure it out. It shouldn't be too
> > > bad, since there's only 120 commits in that range.
> > >
> > > In fact, you can almost certainly just bisect from 89840966c579 to
> > > bb5b583b5279, which is just 31 commits and should get you bisected in
> > > just five tries or so.
> >
> > Yea, I've just done that. It came down to the following commit.
> > Reverting it solves the problem. I've gone thru a few cycles, and
> > notebook still survives.
> >
> > Thanks,
> > Jeff
>
> I reverted the specified commit and my box still suffers the
> resume-turns-into-cold-boot behavior. Retried two times with the commit reverted
> on top of HEAD...

The cold-boot problem is very likely irrelevant with i915 patches.
I've got the same issue with and without the i915 fix patches on test
machines here.


thanks,

Takashi

2011-02-06 11:06:20

by Dave Airlie

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

>>
>> I reverted the specified commit and my box still suffers the
>> resume-turns-into-cold-boot behavior. Retried two times with the commit reverted
>> on top of HEAD...
>
> The cold-boot problem is very likely irrelevant with i915 patches.
> I've got the same issue with and without the i915 fix patches on test
> machines here.
>
Yeah its the 32-bit NX stuff most likely if you are using 32-bit kernels.

Dave.

2011-02-06 12:21:07

by Marc Burkhardt

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

I've the NX stuff disabled, so to say DEBUG_RODATA=n and it doesn't resume... so
what's next?

I use an i7 with 32bit code as I think 64bit is a) useless for me and b) I just
plugged my old HDD into my new machine.

Marc

* Dave Airlie <[email protected]> [2011-02-06 21:06:18 +1000]:

> >>
> >> I reverted the specified commit and my box still suffers the
> >> resume-turns-into-cold-boot behavior. Retried two times with the commit reverted
> >> on top of HEAD...
> >
> > The cold-boot problem is very likely irrelevant with i915 patches.
> > I've got the same issue with and without the i915 fix patches on test
> > machines here.
> >
> Yeah its the 32-bit NX stuff most likely if you are using 32-bit kernels.
>
> Dave.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>

--
Marc Koschewski

2011-02-06 12:24:13

by Marc Burkhardt

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

Read this

[REGRESSION g01539ba] Hibernate broken on T510i

or this

[REGRESSION] S3 resume on SandyBridge doesn't work with NX protection (5bd5a45)

Marc

* Takashi Iwai <[email protected]> [2011-02-06 12:00:15 +0100]:

> At Sun, 6 Feb 2011 09:50:51 +0800,
> Jeff Chua wrote:
> >
> > On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
> > >> The suspend monster is back! The suspend-to-ram is fine, but upon
> > >> resume, screen is blank. Haven't bisected in case someone has also
> > >> done so.
> > >
> > > BTW, please don't reply to messages containing patches with reports of problems
> > > that aren't caused by those patches. It's confusing at best and at worst it
> > > may result in the patches being rejected.
> >
> > Sorry. New subject now:)
> >
> >
> > On Sun, Feb 6, 2011 at 2:51 AM, Linus Torvalds
> > <[email protected]> wrote:
> > >> It's very recent. ... between commit
> > >> 831d52bc153971b70e64eccfbed2b232394f22f8 and
> > >> 44f2c5c841da1b1e0864d768197ab1497b5c2cc1.
> > >
> > > Hmm. It's almost certainly one of the DRI patches, but which one? I
> > > think bisection is the only way to figure it out. It shouldn't be too
> > > bad, since there's only 120 commits in that range.
> > >
> > > In fact, you can almost certainly just bisect from 89840966c579 to
> > > bb5b583b5279, which is just 31 commits and should get you bisected in
> > > just five tries or so.
> >
> > Yea, I've just done that. It came down to the following commit.
> > Reverting it solves the problem. I've gone thru a few cycles, and
> > notebook still survives.
>
> Hrm, what is the symptom? I couldn't find it because you cut off the
> thread, and it's not cited.
>
> The commit you mentioned just adds an interface, and the the callbacks
> aren't defined. The real change is either in
> commit f3269058e7a80083dcdf89698bfcd1a6c6f8fd12
> drm/i915/crt: Force the initial probe after reset
> or
> commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
> drm/i915: Reset crtc after resume
>
> Also the fix might interact with
> commit 811aaa55ba21ab37407018cfc01770d6b037d3fb
> drm: Only set DPMS ON when actually configuring a mode
>
>
> thanks,
>
> Takashi
>
> >
> > Thanks,
> > Jeff
> >
> >
> > commit 500f7147cf5bafd139056d521536b10c2bc2e154
> > Author: Chris Wilson <[email protected]>
> > Date: Mon Jan 24 15:14:41 2011 +0000
> >
> > drm/i915: Reset state after a GPU reset or resume
> >
> > Call drm_mode_config_reset() after an invalidation event to restore any
> > cached state to unknown.
> >
> > Tested-by: Takashi Iwai <[email protected]>
> > Signed-off-by: Chris Wilson <[email protected]>
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>

--
Marc Koschewski

2011-02-06 13:04:45

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sunday, February 06, 2011, Marc Koschewski wrote:
> I've the NX stuff disabled, so to say DEBUG_RODATA=n and it doesn't resume... so
> what's next?

Did you actually try to revert the NX commits or go back to the version of the
kernel where they aren't present?

Also, what's the last known working kernel?

> I use an i7 with 32bit code as I think 64bit is a) useless for me

You're most probably wrong, because memory management is mush simpler in the
64-bit mode. Basically, if your machine supports 64-bitness, you should use
it.

> and b) I just plugged my old HDD into my new machine.

Well, that's a good reason to stay backwards-compatible.

Thanks,
Rafael


> > >> I reverted the specified commit and my box still suffers the
> > >> resume-turns-into-cold-boot behavior. Retried two times with the commit reverted
> > >> on top of HEAD...
> > >
> > > The cold-boot problem is very likely irrelevant with i915 patches.
> > > I've got the same issue with and without the i915 fix patches on test
> > > machines here.
> > >
> > Yeah its the 32-bit NX stuff most likely if you are using 32-bit kernels.

2011-02-06 13:19:59

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Sun, 6 Feb 2011 13:24:08 +0100,
Marc Koschewski wrote:
>
> Read this
>
> [REGRESSION g01539ba] Hibernate broken on T510i
>
> or this
>
> [REGRESSION] S3 resume on SandyBridge doesn't work with NX protection (5bd5a45)

But this should be definitely irrelevant with i915 fixes I've been
involved with. The NX problem already existed in rc1, IIRC.

I wonder what problem is fixed for Jeff.


thanks,

Takashi


Takashi

>
> Marc
>
> * Takashi Iwai <[email protected]> [2011-02-06 12:00:15 +0100]:
>
> > At Sun, 6 Feb 2011 09:50:51 +0800,
> > Jeff Chua wrote:
> > >
> > > On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
> > > >> The suspend monster is back! The suspend-to-ram is fine, but upon
> > > >> resume, screen is blank. Haven't bisected in case someone has also
> > > >> done so.
> > > >
> > > > BTW, please don't reply to messages containing patches with reports of problems
> > > > that aren't caused by those patches. It's confusing at best and at worst it
> > > > may result in the patches being rejected.
> > >
> > > Sorry. New subject now:)
> > >
> > >
> > > On Sun, Feb 6, 2011 at 2:51 AM, Linus Torvalds
> > > <[email protected]> wrote:
> > > >> It's very recent. ... between commit
> > > >> 831d52bc153971b70e64eccfbed2b232394f22f8 and
> > > >> 44f2c5c841da1b1e0864d768197ab1497b5c2cc1.
> > > >
> > > > Hmm. It's almost certainly one of the DRI patches, but which one? I
> > > > think bisection is the only way to figure it out. It shouldn't be too
> > > > bad, since there's only 120 commits in that range.
> > > >
> > > > In fact, you can almost certainly just bisect from 89840966c579 to
> > > > bb5b583b5279, which is just 31 commits and should get you bisected in
> > > > just five tries or so.
> > >
> > > Yea, I've just done that. It came down to the following commit.
> > > Reverting it solves the problem. I've gone thru a few cycles, and
> > > notebook still survives.
> >
> > Hrm, what is the symptom? I couldn't find it because you cut off the
> > thread, and it's not cited.
> >
> > The commit you mentioned just adds an interface, and the the callbacks
> > aren't defined. The real change is either in
> > commit f3269058e7a80083dcdf89698bfcd1a6c6f8fd12
> > drm/i915/crt: Force the initial probe after reset
> > or
> > commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
> > drm/i915: Reset crtc after resume
> >
> > Also the fix might interact with
> > commit 811aaa55ba21ab37407018cfc01770d6b037d3fb
> > drm: Only set DPMS ON when actually configuring a mode
> >
> >
> > thanks,
> >
> > Takashi
> >
> > >
> > > Thanks,
> > > Jeff
> > >
> > >
> > > commit 500f7147cf5bafd139056d521536b10c2bc2e154
> > > Author: Chris Wilson <[email protected]>
> > > Date: Mon Jan 24 15:14:41 2011 +0000
> > >
> > > drm/i915: Reset state after a GPU reset or resume
> > >
> > > Call drm_mode_config_reset() after an invalidation event to restore any
> > > cached state to unknown.
> > >
> > > Tested-by: Takashi Iwai <[email protected]>
> > > Signed-off-by: Chris Wilson <[email protected]>
> > >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
> >
>
> --
> Marc Koschewski
>

2011-02-06 13:44:15

by Marc Burkhardt

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

* Rafael J. Wysocki <[email protected]> [2011-02-06 14:04:23 +0100]:

> On Sunday, February 06, 2011, Marc Koschewski wrote:
> > I've the NX stuff disabled, so to say DEBUG_RODATA=n and it doesn't resume... so
> > what's next?
>
> Did you actually try to revert the NX commits or go back to the version of the
> kernel where they aren't present?
>
> Also, what's the last known working kernel?

2.6.37 works perfectly. After the first chunk of code after the release of
2.6.37 (so to say 2.6.37 + some stuff, but not 2.6.38-rc1) is broke.

I did not bisect it down to something. But it seems many people have trapped
into it and have pointed at some things that probably broke it - see the
SandyBridge thread.

>
> > I use an i7 with 32bit code as I think 64bit is a) useless for me
>
> You're most probably wrong, because memory management is mush simpler in the
> 64-bit mode. Basically, if your machine supports 64-bitness, you should use
> it.

I didn't see any advantage in 64 bit from what I've read. And I ignore the ~1% overhead
of PAE. The hardware is fat enough...

>
> > and b) I just plugged my old HDD into my new machine.
>
> Well, that's a good reason to stay backwards-compatible.
>
> Thanks,
> Rafael
>
>
> > > >> I reverted the specified commit and my box still suffers the
> > > >> resume-turns-into-cold-boot behavior. Retried two times with the commit reverted
> > > >> on top of HEAD...
> > > >
> > > > The cold-boot problem is very likely irrelevant with i915 patches.
> > > > I've got the same issue with and without the i915 fix patches on test
> > > > machines here.
> > > >
> > > Yeah its the 32-bit NX stuff most likely if you are using 32-bit kernels.
>
>

--
Marc Koschewski

2011-02-06 13:56:14

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sunday, February 06, 2011, Marc Koschewski wrote:
> * Rafael J. Wysocki <[email protected]> [2011-02-06 14:04:23 +0100]:
>
> > On Sunday, February 06, 2011, Marc Koschewski wrote:
> > > I've the NX stuff disabled, so to say DEBUG_RODATA=n and it doesn't resume... so
> > > what's next?
> >
> > Did you actually try to revert the NX commits or go back to the version of the
> > kernel where they aren't present?
> >
> > Also, what's the last known working kernel?
>
> 2.6.37 works perfectly. After the first chunk of code after the release of
> 2.6.37 (so to say 2.6.37 + some stuff, but not 2.6.38-rc1) is broke.
>
> I did not bisect it down to something. But it seems many people have trapped
> into it and have pointed at some things that probably broke it - see the
> SandyBridge thread.

I saw it, but it's not conclusive. You're the last person reporting a suspend
problem which doesn't seem to be related to the NX patches and no one else
seems to be able to reproduce it (obviously including me).

If you suspend what might broke it, why don't you just try to confirm your
suspicions?

> > > I use an i7 with 32bit code as I think 64bit is a) useless for me
> >
> > You're most probably wrong, because memory management is mush simpler in the
> > 64-bit mode. Basically, if your machine supports 64-bitness, you should use
> > it.
>
> I didn't see any advantage in 64 bit from what I've read.

Well, with all due respect to what you have read ...

> And I ignore the ~1% overhead of PAE. The hardware is fat enough...

... what about the kernel memory being confined to the first 1/4 of virtual
address space? The fact that we have to use highmem on 32 bits is a good
enough reason to switch to 64 bits IMnsHO.

Thanks,
Rafael

2011-02-06 14:01:23

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sun, Feb 6, 2011 at 7:00 PM, Takashi Iwai <[email protected]> wrote:
> At Sun, 6 Feb 2011 09:50:51 +0800,
> Jeff Chua wrote:
>>
>> On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
>> >> The suspend monster is back! The suspend-to-ram is fine, but upon
>> >> resume, screen is blank. Haven't bisected in case someone has also
>> >> done so.

> Hrm, what is the symptom? ?I couldn't find it because you cut off the
> thread, and it's not cited.

Takashi-san,

It's the commit below. I've checked it twice. Reverting it solves the
problem. Suspend to Ram ok. Upon resume, screen is blank. Keyboard
hangs. Had to do a hard reset.

My notebook is the Lenovo X201s, 64-bit. Part of Xorg.0.log here ...

[ 8492.036] (II) LoadModule: "intel"
[ 8492.036] (II) Loading /usr/X11/lib/xorg/modules/drivers/intel_drv.so
[ 8492.036] (II) Module intel: vendor="X.Org Foundation"
[ 8492.036] compiled for 1.9.99.901, module version = 2.14.0
[ 8492.036] Module class: X.Org Video Driver
[ 8492.036] ABI class: X.Org Video Driver, version 9.0


Thanks,
Jeff


>> commit 500f7147cf5bafd139056d521536b10c2bc2e154
>> Author: Chris Wilson <[email protected]>
>> Date: ? Mon Jan 24 15:14:41 2011 +0000
>>
>> ? ? drm/i915: Reset state after a GPU reset or resume
>>
>> ? ? Call drm_mode_config_reset() after an invalidation event to restore any
>> ? ? cached state to unknown.
>>
>> ? ? Tested-by: Takashi Iwai <[email protected]>
>> ? ? Signed-off-by: Chris Wilson <[email protected]>

2011-02-06 14:47:57

by Chris Wilson

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sun, 6 Feb 2011 22:01:22 +0800, Jeff Chua <[email protected]> wrote:
> It's the commit below. I've checked it twice. Reverting it solves the
> problem. Suspend to Ram ok. Upon resume, screen is blank. Keyboard
> hangs. Had to do a hard reset.

> >> commit 500f7147cf5bafd139056d521536b10c2bc2e154
> >> Author: Chris Wilson <[email protected]>
> >> Date:   Mon Jan 24 15:14:41 2011 +0000
> >>
> >>     drm/i915: Reset state after a GPU reset or resume

Makes no difference to my x201s.

I would have thought a bisection would have resulted in either
f3269058e7a80083dcdf89698bfcd1a6c6f8fd12 or
5d1d0cc87fc0887921993ea0742932e0c8adeda0

Can you try reverting those two to see if either of those is the true
culprit?
-Chris

--
Chris Wilson, Intel Open Source Technology Centre

2011-02-06 14:49:40

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sun, Feb 6, 2011 at 10:01 PM, Jeff Chua <[email protected]> wrote:
> On Sun, Feb 6, 2011 at 7:00 PM, Takashi Iwai <[email protected]> wrote:
>> At Sun, 6 Feb 2011 09:50:51 +0800,
>> Jeff Chua wrote:
>>>
>>> On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
>>> >> The suspend monster is back! The suspend-to-ram is fine, but upon
>>> >> resume, screen is blank. Haven't bisected in case someone has also
>>> >> done so.
>
>> Hrm, what is the symptom? ?I couldn't find it because you cut off the
>> thread, and it's not cited.
>
> Takashi-san,
>
> It's the commit below. I've checked it twice. Reverting it solves the
> problem. Suspend to Ram ok. Upon resume, screen is blank. Keyboard
> hangs. Had to do a hard reset.

> The commit you mentioned just adds an interface, and the the callbacks
> aren't defined. The real change is either in
> commit f3269058e7a80083dcdf89698bfcd1a6c6f8fd12
> drm/i915/crt: Force the initial probe after reset
> or
> commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
> drm/i915: Reset crtc after resume

uh, Sorry, misread your original post. I've retest it, and it's the 2nd one.

commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
Author: Chris Wilson <[email protected]>
Date: Mon Jan 24 15:02:15 2011 +0000

drm/i915: Reset crtc after resume

Based on a patch by Takashi Iwai.


I wasn't really doing a bisect last night. Just reverting those
patches that seems to be the problem last night. Just arrived in Tokyo
last night. Long flight, too tired to do the bisect. By luck, the
commit I reverted worked, but you caught me!

This time. it down to the root cause!

Thanks,
Jeff.

2011-02-06 14:51:01

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sun, Feb 6, 2011 at 10:47 PM, Chris Wilson <[email protected]> wrote:
> On Sun, 6 Feb 2011 22:01:22 +0800, Jeff Chua <[email protected]> wrote:
>> It's the commit below. I've checked it twice. Reverting it solves the
>> problem. Suspend to Ram ok. Upon resume, screen is blank. Keyboard
>> hangs. Had to do a hard reset.
>
>> >> commit 500f7147cf5bafd139056d521536b10c2bc2e154
>> >> Author: Chris Wilson <[email protected]>
>> >> Date: ? Mon Jan 24 15:14:41 2011 +0000
>> >>
>> >> ? ? drm/i915: Reset state after a GPU reset or resume
>
> Makes no difference to my x201s.
>
> I would have thought a bisection would have resulted in either
> f3269058e7a80083dcdf89698bfcd1a6c6f8fd12 or
> 5d1d0cc87fc0887921993ea0742932e0c8adeda0
>
> Can you try reverting those two to see if either of those is the true
> culprit?

You're too fast. It's the commit below.

commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
Author: Chris Wilson <[email protected]>
Date: Mon Jan 24 15:02:15 2011 +0000

drm/i915: Reset crtc after resume

Based on a patch by Takashi Iwai.

Reported-by: Matthias Hopf <[email protected]>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=27272
Tested-by: Takashi Iwai <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>


Thanks,
Jeff.

2011-02-06 15:27:35

by Chris Wilson

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sun, 6 Feb 2011 22:49:38 +0800, Jeff Chua <[email protected]> wrote:
> On Sun, Feb 6, 2011 at 10:01 PM, Jeff Chua <[email protected]> wrote:
> > On Sun, Feb 6, 2011 at 7:00 PM, Takashi Iwai <[email protected]> wrote:
> >> At Sun, 6 Feb 2011 09:50:51 +0800,
> >> Jeff Chua wrote:
> >>>
> >>> On Sun, Feb 6, 2011 at 2:24 AM, Rafael J. Wysocki <[email protected]> wrote:
> >>> >> The suspend monster is back! The suspend-to-ram is fine, but upon
> >>> >> resume, screen is blank. Haven't bisected in case someone has also
> >>> >> done so.
> >
> >> Hrm, what is the symptom?  I couldn't find it because you cut off the
> >> thread, and it's not cited.
> >
> > Takashi-san,
> >
> > It's the commit below. I've checked it twice. Reverting it solves the
> > problem. Suspend to Ram ok. Upon resume, screen is blank. Keyboard
> > hangs. Had to do a hard reset.
>
> > The commit you mentioned just adds an interface, and the the callbacks
> > aren't defined. The real change is either in
> > commit f3269058e7a80083dcdf89698bfcd1a6c6f8fd12
> > drm/i915/crt: Force the initial probe after reset
> > or
> > commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
> > drm/i915: Reset crtc after resume
>
> uh, Sorry, misread your original post. I've retest it, and it's the 2nd one.
>
> commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
> Author: Chris Wilson <[email protected]>
> Date: Mon Jan 24 15:02:15 2011 +0000
>
> drm/i915: Reset crtc after resume
>
> Based on a patch by Takashi Iwai.
>
>
> I wasn't really doing a bisect last night. Just reverting those
> patches that seems to be the problem last night. Just arrived in Tokyo
> last night. Long flight, too tired to do the bisect. By luck, the
> commit I reverted worked, but you caught me!
>
> This time. it down to the root cause!

One last step: move contents of intel_crtc_reset() back to
intel_crtc_init() one by one.

The active flag is my suspicion. I was thinking that we brought up the
outputs in a similar manner upon resume as upon initial boot. On
reflection, this is the not case.

However, the first action we take inside modesetting is to disable the
outputs about to be reconfigured. So setting active should be the right
course of action so that cleanup any residual state from resume.

So I am intrigued as to which line is the cause, and just where the
machine becomes unresponsive...
-Chris

--
Chris Wilson, Intel Open Source Technology Centre

2011-02-07 04:49:00

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> One last step: move contents of intel_crtc_reset() back to
> intel_crtc_init() one by one.
>
> The active flag is my suspicion. I was thinking that we brought up the
> outputs in a similar manner upon resume as upon initial boot. On
> reflection, this is the not case.
>
> However, the first action we take inside modesetting is to disable the
> outputs about to be reconfigured. So setting active should be the right
> course of action so that cleanup any residual state from resume.
>
> So I am intrigued as to which line is the cause, and just where the
> machine becomes unresponsive...

It's this line causing the problem.

intel_crtc->active = true; /* force the pipe off on setup_init_config */


When it's called before entering intel_crtc_reset(&intel_crtc->base),
it works, but if called within the function, it doesn't work. Strange.
Not sure whether is passing the correct value to to_intel_crtc(crtc)?


Jeff

2011-02-07 05:02:47

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
>> One last step: move contents of intel_crtc_reset() back to
>> intel_crtc_init() one by one.
>>
>> The active flag is my suspicion. I was thinking that we brought up the
>> outputs in a similar manner upon resume as upon initial boot. On
>> reflection, this is the not case.
>>
>> However, the first action we take inside modesetting is to disable the
>> outputs about to be reconfigured. So setting active should be the right
>> course of action so that cleanup any residual state from resume.
>>
>> So I am intrigued as to which line is the cause, and just where the
>> machine becomes unresponsive...
>
> It's this line causing the problem.
>
> intel_crtc->active = true; /* force the pipe off on setup_init_config */
>
>
> When it's called before entering intel_crtc_reset(&intel_crtc->base),
> it works, but if called within the function, it doesn't work. Strange.
> Not sure whether is passing the correct value to to_intel_crtc(crtc)?

I've added printk() below and the function returns a different value
of intel_crtc.


static void intel_crtc_reset(struct drm_crtc *crtc)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000

}

printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
intel_crtc_reset(&intel_crtc->base);


Jeff

2011-02-07 08:25:47

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Mon, 7 Feb 2011 13:02:46 +0800,
Jeff Chua wrote:
>
> On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> >> One last step: move contents of intel_crtc_reset() back to
> >> intel_crtc_init() one by one.
> >>
> >> The active flag is my suspicion. I was thinking that we brought up the
> >> outputs in a similar manner upon resume as upon initial boot. On
> >> reflection, this is the not case.
> >>
> >> However, the first action we take inside modesetting is to disable the
> >> outputs about to be reconfigured. So setting active should be the right
> >> course of action so that cleanup any residual state from resume.
> >>
> >> So I am intrigued as to which line is the cause, and just where the
> >> machine becomes unresponsive...
> >
> > It's this line causing the problem.
> >
> > intel_crtc->active = true; /* force the pipe off on setup_init_config */
> >
> >
> > When it's called before entering intel_crtc_reset(&intel_crtc->base),
> > it works, but if called within the function, it doesn't work. Strange.
> > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
>
> I've added printk() below and the function returns a different value
> of intel_crtc.
>
>
> static void intel_crtc_reset(struct drm_crtc *crtc)
> {
> struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
>
> }
>
> printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
> intel_crtc_reset(&intel_crtc->base);

That's weird. Since base is the first member, both intel_crtc and crtc
must be identical.


Takashi

2011-02-07 08:36:38

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Mon, Feb 7, 2011 at 4:25 PM, Takashi Iwai <[email protected]> wrote:
> At Mon, 7 Feb 2011 13:02:46 +0800,
> Jeff Chua wrote:
>>
>> On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
>> > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
>> >> One last step: move contents of intel_crtc_reset() back to
>> >> intel_crtc_init() one by one.
>> >>
>> >> The active flag is my suspicion. I was thinking that we brought up the
>> >> outputs in a similar manner upon resume as upon initial boot. On
>> >> reflection, this is the not case.
>> >>
>> >> However, the first action we take inside modesetting is to disable the
>> >> outputs about to be reconfigured. So setting active should be the right
>> >> course of action so that cleanup any residual state from resume.
>> >>
>> >> So I am intrigued as to which line is the cause, and just where the
>> >> machine becomes unresponsive...
>> >
>> > It's this line causing the problem.
>> >
>> > intel_crtc->active = true; /* force the pipe off on setup_init_config */
>> >
>> >
>> > When it's called before entering intel_crtc_reset(&intel_crtc->base),
>> > it works, but if called within the function, it doesn't work. Strange.
>> > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
>>
>> I've added printk() below and the function returns a different value
>> of intel_crtc.
>>
>>
>> static void intel_crtc_reset(struct drm_crtc *crtc)
>> {
>> ? ? ? ? struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>> ? ? ? ? printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
>>
>> }
>>
>> printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
>> intel_crtc_reset(&intel_crtc->base);
>
> That's weird. ?Since base is the first member, both intel_crtc and crtc
> must be identical.

In case I'm messing something up, here's my intel_display.c

Thanks,
Jeff


Attachments:
intel_display.c (197.57 kB)

2011-02-07 08:45:19

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Mon, Feb 7, 2011 at 4:36 PM, Jeff Chua <[email protected]> wrote:
> On Mon, Feb 7, 2011 at 4:25 PM, Takashi Iwai <[email protected]> wrote:
>> At Mon, 7 Feb 2011 13:02:46 +0800,
>> Jeff Chua wrote:
>>>
>>> On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
>>> > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
>>> >> One last step: move contents of intel_crtc_reset() back to
>>> >> intel_crtc_init() one by one.
>>> >>
>>> >> The active flag is my suspicion. I was thinking that we brought up the
>>> >> outputs in a similar manner upon resume as upon initial boot. On
>>> >> reflection, this is the not case.
>>> >>
>>> >> However, the first action we take inside modesetting is to disable the
>>> >> outputs about to be reconfigured. So setting active should be the right
>>> >> course of action so that cleanup any residual state from resume.
>>> >>
>>> >> So I am intrigued as to which line is the cause, and just where the
>>> >> machine becomes unresponsive...
>>> >
>>> > It's this line causing the problem.
>>> >
>>> > intel_crtc->active = true; /* force the pipe off on setup_init_config */
>>> >
>>> >
>>> > When it's called before entering intel_crtc_reset(&intel_crtc->base),
>>> > it works, but if called within the function, it doesn't work. Strange.
>>> > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
>>>
>>> I've added printk() below and the function returns a different value
>>> of intel_crtc.
>>>
>>>
>>> static void intel_crtc_reset(struct drm_crtc *crtc)
>>> {
>>> ? ? ? ? struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>>> ? ? ? ? printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
>>>
>>> }
>>>
>>> printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
>>> intel_crtc_reset(&intel_crtc->base);
>>
>> That's weird. ?Since base is the first member, both intel_crtc and crtc
>> must be identical.
>
> In case I'm messing something up, here's my intel_display.c

Why not just pass intel_crtc as in

- static void intel_crtc_reset(struct drm_crtc *crtc)
+ static void intel_crtc_reset(struct intel_crtc *intel_crtc)

Jeff.

2011-02-07 08:52:58

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Mon, 7 Feb 2011 16:36:33 +0800,
Jeff Chua wrote:
>
> On Mon, Feb 7, 2011 at 4:25 PM, Takashi Iwai <[email protected]> wrote:
> > At Mon, 7 Feb 2011 13:02:46 +0800,
> > Jeff Chua wrote:
> >>
> >> On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> >> > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> >> >> One last step: move contents of intel_crtc_reset() back to
> >> >> intel_crtc_init() one by one.
> >> >>
> >> >> The active flag is my suspicion. I was thinking that we brought up the
> >> >> outputs in a similar manner upon resume as upon initial boot. On
> >> >> reflection, this is the not case.
> >> >>
> >> >> However, the first action we take inside modesetting is to disable the
> >> >> outputs about to be reconfigured. So setting active should be the right
> >> >> course of action so that cleanup any residual state from resume.
> >> >>
> >> >> So I am intrigued as to which line is the cause, and just where the
> >> >> machine becomes unresponsive...
> >> >
> >> > It's this line causing the problem.
> >> >
> >> > intel_crtc->active = true; /* force the pipe off on setup_init_config */
> >> >
> >> >
> >> > When it's called before entering intel_crtc_reset(&intel_crtc->base),
> >> > it works, but if called within the function, it doesn't work. Strange.
> >> > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
> >>
> >> I've added printk() below and the function returns a different value
> >> of intel_crtc.
> >>
> >>
> >> static void intel_crtc_reset(struct drm_crtc *crtc)
> >> {
> >>         struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> >>         printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
> >>
> >> }
> >>
> >> printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
> >> intel_crtc_reset(&intel_crtc->base);
> >
> > That's weird.  Since base is the first member, both intel_crtc and crtc
> > must be identical.
>
> In case I'm messing something up, here's my intel_display.c

Thanks, that looks good. What about other files? Did you change
(especially intel_drv.h) from Linus git tree?

I'll also check later to be sure (now I have no machine for testing).


thanks,

Takashi

2011-02-07 08:54:05

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Mon, 7 Feb 2011 16:45:16 +0800,
Jeff Chua wrote:
>
> On Mon, Feb 7, 2011 at 4:36 PM, Jeff Chua <[email protected]> wrote:
> > On Mon, Feb 7, 2011 at 4:25 PM, Takashi Iwai <[email protected]> wrote:
> >> At Mon, 7 Feb 2011 13:02:46 +0800,
> >> Jeff Chua wrote:
> >>>
> >>> On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> >>> > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> >>> >> One last step: move contents of intel_crtc_reset() back to
> >>> >> intel_crtc_init() one by one.
> >>> >>
> >>> >> The active flag is my suspicion. I was thinking that we brought up the
> >>> >> outputs in a similar manner upon resume as upon initial boot. On
> >>> >> reflection, this is the not case.
> >>> >>
> >>> >> However, the first action we take inside modesetting is to disable the
> >>> >> outputs about to be reconfigured. So setting active should be the right
> >>> >> course of action so that cleanup any residual state from resume.
> >>> >>
> >>> >> So I am intrigued as to which line is the cause, and just where the
> >>> >> machine becomes unresponsive...
> >>> >
> >>> > It's this line causing the problem.
> >>> >
> >>> > intel_crtc->active = true; /* force the pipe off on setup_init_config */
> >>> >
> >>> >
> >>> > When it's called before entering intel_crtc_reset(&intel_crtc->base),
> >>> > it works, but if called within the function, it doesn't work. Strange.
> >>> > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
> >>>
> >>> I've added printk() below and the function returns a different value
> >>> of intel_crtc.
> >>>
> >>>
> >>> static void intel_crtc_reset(struct drm_crtc *crtc)
> >>> {
> >>>         struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> >>>         printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
> >>>
> >>> }
> >>>
> >>> printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
> >>> intel_crtc_reset(&intel_crtc->base);
> >>
> >> That's weird.  Since base is the first member, both intel_crtc and crtc
> >> must be identical.
> >
> > In case I'm messing something up, here's my intel_display.c
>
> Why not just pass intel_crtc as in
>
> - static void intel_crtc_reset(struct drm_crtc *crtc)
> + static void intel_crtc_reset(struct intel_crtc *intel_crtc)

Because it's called from drm_crtc.c that has no idea about the
driver-local type :)


Takashi

2011-02-07 10:02:15

by Marc Burkhardt

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

Takashi,

is this potentially breaking S3 resume with nouveau cards, too?

Regards,
Marc

* Takashi Iwai <[email protected]> [2011-02-07 09:25:42 +0100]:

> At Mon, 7 Feb 2011 13:02:46 +0800,
> Jeff Chua wrote:
> >
> > On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> > > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> > >> One last step: move contents of intel_crtc_reset() back to
> > >> intel_crtc_init() one by one.
> > >>
> > >> The active flag is my suspicion. I was thinking that we brought up the
> > >> outputs in a similar manner upon resume as upon initial boot. On
> > >> reflection, this is the not case.
> > >>
> > >> However, the first action we take inside modesetting is to disable the
> > >> outputs about to be reconfigured. So setting active should be the right
> > >> course of action so that cleanup any residual state from resume.
> > >>
> > >> So I am intrigued as to which line is the cause, and just where the
> > >> machine becomes unresponsive...
> > >
> > > It's this line causing the problem.
> > >
> > > intel_crtc->active = true; /* force the pipe off on setup_init_config */
> > >
> > >
> > > When it's called before entering intel_crtc_reset(&intel_crtc->base),
> > > it works, but if called within the function, it doesn't work. Strange.
> > > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
> >
> > I've added printk() below and the function returns a different value
> > of intel_crtc.
> >
> >
> > static void intel_crtc_reset(struct drm_crtc *crtc)
> > {
> > struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
> >
> > }
> >
> > printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
> > intel_crtc_reset(&intel_crtc->base);
>
> That's weird. Since base is the first member, both intel_crtc and crtc
> must be identical.
>
>
> Takashi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>

--
Marc Koschewski

2011-02-07 10:06:48

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Mon, 7 Feb 2011 11:02:10 +0100,
Marc Koschewski wrote:
>
> Takashi,
>
> is this potentially breaking S3 resume with nouveau cards, too?

There is no reset callback except for i915, so there shouldn't be any
change for nouveau regarding these commits.


Takashi

> Regards,
> Marc
>
> * Takashi Iwai <[email protected]> [2011-02-07 09:25:42 +0100]:
>
> > At Mon, 7 Feb 2011 13:02:46 +0800,
> > Jeff Chua wrote:
> > >
> > > On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> > > > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> > > >> One last step: move contents of intel_crtc_reset() back to
> > > >> intel_crtc_init() one by one.
> > > >>
> > > >> The active flag is my suspicion. I was thinking that we brought up the
> > > >> outputs in a similar manner upon resume as upon initial boot. On
> > > >> reflection, this is the not case.
> > > >>
> > > >> However, the first action we take inside modesetting is to disable the
> > > >> outputs about to be reconfigured. So setting active should be the right
> > > >> course of action so that cleanup any residual state from resume.
> > > >>
> > > >> So I am intrigued as to which line is the cause, and just where the
> > > >> machine becomes unresponsive...
> > > >
> > > > It's this line causing the problem.
> > > >
> > > > intel_crtc->active = true; /* force the pipe off on setup_init_config */
> > > >
> > > >
> > > > When it's called before entering intel_crtc_reset(&intel_crtc->base),
> > > > it works, but if called within the function, it doesn't work. Strange.
> > > > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
> > >
> > > I've added printk() below and the function returns a different value
> > > of intel_crtc.
> > >
> > >
> > > static void intel_crtc_reset(struct drm_crtc *crtc)
> > > {
> > > struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > > printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
> > >
> > > }
> > >
> > > printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
> > > intel_crtc_reset(&intel_crtc->base);
> >
> > That's weird. Since base is the first member, both intel_crtc and crtc
> > must be identical.
> >
> >
> > Takashi
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
> >
>
> --
> Marc Koschewski
>

2011-02-07 10:09:54

by Marc Burkhardt

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

* Takashi Iwai <[email protected]> [2011-02-07 11:06:45 +0100]:

OK,

seems like there's a fix for ACPI wakeup memory in tip/urgent. Maybe the fix relates to
this resume issue as well.

Marc

> At Mon, 7 Feb 2011 11:02:10 +0100,
> Marc Koschewski wrote:
> >
> > Takashi,
> >
> > is this potentially breaking S3 resume with nouveau cards, too?
>
> There is no reset callback except for i915, so there shouldn't be any
> change for nouveau regarding these commits.
>
>
> Takashi
>
> > Regards,
> > Marc
> >
> > * Takashi Iwai <[email protected]> [2011-02-07 09:25:42 +0100]:
> >
> > > At Mon, 7 Feb 2011 13:02:46 +0800,
> > > Jeff Chua wrote:
> > > >
> > > > On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> > > > > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> > > > >> One last step: move contents of intel_crtc_reset() back to
> > > > >> intel_crtc_init() one by one.
> > > > >>
> > > > >> The active flag is my suspicion. I was thinking that we brought up the
> > > > >> outputs in a similar manner upon resume as upon initial boot. On
> > > > >> reflection, this is the not case.
> > > > >>
> > > > >> However, the first action we take inside modesetting is to disable the
> > > > >> outputs about to be reconfigured. So setting active should be the right
> > > > >> course of action so that cleanup any residual state from resume.
> > > > >>
> > > > >> So I am intrigued as to which line is the cause, and just where the
> > > > >> machine becomes unresponsive...
> > > > >
> > > > > It's this line causing the problem.
> > > > >
> > > > > intel_crtc->active = true; /* force the pipe off on setup_init_config */
> > > > >
> > > > >
> > > > > When it's called before entering intel_crtc_reset(&intel_crtc->base),
> > > > > it works, but if called within the function, it doesn't work. Strange.
> > > > > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
> > > >
> > > > I've added printk() below and the function returns a different value
> > > > of intel_crtc.
> > > >
> > > >
> > > > static void intel_crtc_reset(struct drm_crtc *crtc)
> > > > {
> > > > struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > > > printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
> > > >
> > > > }
> > > >
> > > > printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
> > > > intel_crtc_reset(&intel_crtc->base);
> > >
> > > That's weird. Since base is the first member, both intel_crtc and crtc
> > > must be identical.
> > >
> > >
> > > Takashi
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > > the body of a message to [email protected]
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > Please read the FAQ at http://www.tux.org/lkml/
> > >
> > >
> >
> > --
> > Marc Koschewski
> >
>
>

--
Marc Koschewski

2011-02-07 10:15:04

by Takashi Iwai

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

At Mon, 07 Feb 2011 09:52:55 +0100,
Takashi Iwai wrote:
>
> At Mon, 7 Feb 2011 16:36:33 +0800,
> Jeff Chua wrote:
> >
> > On Mon, Feb 7, 2011 at 4:25 PM, Takashi Iwai <[email protected]> wrote:
> > > At Mon, 7 Feb 2011 13:02:46 +0800,
> > > Jeff Chua wrote:
> > >>
> > >> On Mon, Feb 7, 2011 at 12:48 PM, Jeff Chua <[email protected]> wrote:
> > >> > On Sun, Feb 6, 2011 at 11:27 PM, Chris Wilson <[email protected]> wrote:
> > >> >> One last step: move contents of intel_crtc_reset() back to
> > >> >> intel_crtc_init() one by one.
> > >> >>
> > >> >> The active flag is my suspicion. I was thinking that we brought up the
> > >> >> outputs in a similar manner upon resume as upon initial boot. On
> > >> >> reflection, this is the not case.
> > >> >>
> > >> >> However, the first action we take inside modesetting is to disable the
> > >> >> outputs about to be reconfigured. So setting active should be the right
> > >> >> course of action so that cleanup any residual state from resume.
> > >> >>
> > >> >> So I am intrigued as to which line is the cause, and just where the
> > >> >> machine becomes unresponsive...
> > >> >
> > >> > It's this line causing the problem.
> > >> >
> > >> > intel_crtc->active = true; /* force the pipe off on setup_init_config */
> > >> >
> > >> >
> > >> > When it's called before entering intel_crtc_reset(&intel_crtc->base),
> > >> > it works, but if called within the function, it doesn't work. Strange.
> > >> > Not sure whether is passing the correct value to to_intel_crtc(crtc)?
> > >>
> > >> I've added printk() below and the function returns a different value
> > >> of intel_crtc.
> > >>
> > >>
> > >> static void intel_crtc_reset(struct drm_crtc *crtc)
> > >> {
> > >>         struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > >>         printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d1000
> > >>
> > >> }
> > >>
> > >> printk("intel_crtc %p\n", intel_crtc); ===> intel_crtc ffff8802349d0000
> > >> intel_crtc_reset(&intel_crtc->base);
> > >
> > > That's weird.  Since base is the first member, both intel_crtc and crtc
> > > must be identical.
> >
> > In case I'm messing something up, here's my intel_display.c
>
> Thanks, that looks good. What about other files? Did you change
> (especially intel_drv.h) from Linus git tree?
>
> I'll also check later to be sure (now I have no machine for testing).

I don't see any problem with my machine (but running in 32bit).

Are you sure that you are seeing the same CRTC? There are two active
CRTCs on Intel, and both are initialized and set up.


Takashi

2011-02-07 13:38:07

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Mon, Feb 7, 2011 at 6:15 PM, Takashi Iwai <[email protected]> wrote:
>> Thanks, that looks good. ?What about other files? ?Did you change
>> (especially intel_drv.h) from Linus git tree?

I will try again from a fresh build tonight.

>> I'll also check later to be sure (now I have no machine for testing).
> I don't see any problem with my machine (but running in 32bit).
>
> Are you sure that you are seeing the same CRTC? ?There are two active
> CRTCs on Intel, and both are initialized and set up.

I don't know about that. Even when I attempt to just the pointer
directly as in "static void intel_crtc_reset(struct intel_crtc
*intel_crtc)", it ended up getting a different value. Strange.

intel_crtc ffff880239aa5800
intel_crtc ffff880239aa5000


I'm building everything fresh now.

Jeff

2011-02-07 14:11:32

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Mon, Feb 7, 2011 at 9:38 PM, Jeff Chua <[email protected]> wrote:
> On Mon, Feb 7, 2011 at 6:15 PM, Takashi Iwai <[email protected]> wrote:
>>> Thanks, that looks good. ?What about other files? ?Did you change
>>> (especially intel_drv.h) from Linus git tree?
>
> I will try again ?from a fresh build tonight.
>
>>> I'll also check later to be sure (now I have no machine for testing).
>> I don't see any problem with my machine (but running in 32bit).
>>
>> Are you sure that you are seeing the same CRTC? ?There are two active
>> CRTCs on Intel, and both are initialized and set up.
>
> I don't know about that. Even when I attempt to just the pointer
> directly as in "static void intel_crtc_reset(struct intel_crtc
> *intel_crtc)", it ended up getting a different value. Strange.
>
> intel_crtc ffff880239aa5800
> intel_crtc ffff880239aa5000
>
>
> I'm building everything fresh now.

Same issue encountered even after a fresh build.

Jeff

2011-02-07 21:20:41

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Monday, February 07, 2011, Jeff Chua wrote:
> On Mon, Feb 7, 2011 at 9:38 PM, Jeff Chua <[email protected]> wrote:
> > On Mon, Feb 7, 2011 at 6:15 PM, Takashi Iwai <[email protected]> wrote:
> >>> Thanks, that looks good. What about other files? Did you change
> >>> (especially intel_drv.h) from Linus git tree?
> >
> > I will try again from a fresh build tonight.
> >
> >>> I'll also check later to be sure (now I have no machine for testing).
> >> I don't see any problem with my machine (but running in 32bit).
> >>
> >> Are you sure that you are seeing the same CRTC? There are two active
> >> CRTCs on Intel, and both are initialized and set up.
> >
> > I don't know about that. Even when I attempt to just the pointer
> > directly as in "static void intel_crtc_reset(struct intel_crtc
> > *intel_crtc)", it ended up getting a different value. Strange.
> >
> > intel_crtc ffff880239aa5800
> > intel_crtc ffff880239aa5000
> >
> >
> > I'm building everything fresh now.
>
> Same issue encountered even after a fresh build.

So, can you confirm that on your machine the issue is 100% reproducible and
it goes away after reverting

commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
Author: Chris Wilson <[email protected]>
Date: Mon Jan 24 15:02:15 2011 +0000

drm/i915: Reset crtc after resume

?

Rafael

2011-02-08 01:40:36

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Tue, Feb 8, 2011 at 5:20 AM, Rafael J. Wysocki <[email protected]> wrote:
> On Monday, February 07, 2011, Jeff Chua wrote:
>> Same issue encountered even after a fresh build.
>
> So, can you confirm that on your machine the issue is 100% reproducible and
> it goes away after reverting
>
> commit 5d1d0cc87fc0887921993ea0742932e0c8adeda0
> Author: Chris Wilson <[email protected]>
> Date: ? Mon Jan 24 15:02:15 2011 +0000
>
> ? ?drm/i915: Reset crtc after resume

100% confirmed that it works after reverting.

Jeff.

2011-02-08 13:36:12

by Chris Wilson

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Mon, 7 Feb 2011 22:11:29 +0800, Jeff Chua <[email protected]> wrote:
> Same issue encountered even after a fresh build.

I've been testing on the same hardware (x201s, 64bit, with and without
external DP) and I've not encountered the same issue. Every time I look
at the code, by not setting crtc->active we may incorrectly skip disabling
an active output after resume. If the output is inactive, then disabling it
*should* be a no-op, and thus safe. So I am still at a loss to understand
what fails here and so whether we have a bigger problem on our hands.

Please can you add drm.debug=0xe to your boot parameters (or echo 0xe >
/sys/module/drm/parameters/debug might just be enough) and attach the
dmesg whilst resuming. Also attaching the failing Xorg.0.log would be
useful to rule out any other issues.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre

2011-02-09 00:55:47

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Tue, Feb 8, 2011 at 9:36 PM, Chris Wilson <[email protected]> wrote:
> On Mon, 7 Feb 2011 22:11:29 +0800, Jeff Chua <[email protected]> wrote:
>> Same issue encountered even after a fresh build.
>
> I've been testing on the same hardware (x201s, 64bit, with and without
> external DP) and I've not encountered the same issue. Every time I look
> at the code, by not setting crtc->active we may incorrectly skip disabling
> an active output after resume. If the output is inactive, then disabling it
> *should* be a no-op, and thus safe. So I am still at a loss to understand
> what fails here and so whether we have a bigger problem on our hands.

Same X201s ... that's good. I'm using "echo mem >/sys/power/state" to suspend.
>
> Please can you add drm.debug=0xe to your boot parameters (or echo 0xe >
> /sys/module/drm/parameters/debug might just be enough) and attach the
> dmesg whilst resuming. Also attaching the failing Xorg.0.log would be
> useful to rule out any other issues.

Attached. The Xorg.0.log didn't log anything after resume because the
system hanged, and kernel log is "partially" logged. I've attached my
kernel .config as well.

And the console hangs even without starting X.

Thanks,
Jeff


Attachments:
kernel (142.76 kB)
Xorg.0.log.old (18.65 kB)
.config (73.85 kB)
Download all attachments

2011-02-09 01:05:30

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Wed, Feb 9, 2011 at 8:55 AM, Jeff Chua <[email protected]> wrote:

> And the console hangs even without starting X.

I went back to retry suspending without starting X and realized that
it's only the "screen" that's hang .. and that's without drm and i915
loaded. On the console, I could still reboot the machine normally, but
not when in X (everything hangs including keybard).

Here's the kernel log without X.

Thanks.
Jeff


Attachments:
k1 (69.14 kB)

2011-02-09 02:56:43

by Indan Zupancic

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Wed, February 9, 2011 02:05, Jeff Chua wrote:
> On Wed, Feb 9, 2011 at 8:55 AM, Jeff Chua <[email protected]> wrote:
>
>> And the console hangs even without starting X.
>
> I went back to retry suspending without starting X and realized that
> it's only the "screen" that's hang .. and that's without drm and i915
> loaded.

According to the dmesg you sent, you do have drm (and probably i915 too) loaded.
It seems the hang is the first bit, and then you rebooted into X to capture the
log.

Perhaps relevant message (probably not):

"No ACPI video bus found"

> On the console, I could still reboot the machine normally, but
> not when in X (everything hangs including keybard).
>
> Here's the kernel log without X.
>
> Thanks.
> Jeff
>

Looking at the commit, all it does is changing the timing.

It used to set active to true when intel_crtc_init() was called, but now
it does it always when the drm reset() callback is called.

intel_crtc->active = true; /* force the pipe off on setup_init_config */

I can't find a setup_init_config anywhere, but looking at the other code
it assumes that *_crtc_disable() will be called just after the forced true.

All in all it seems quite wrong, no matter if it happens to work, because
it depends on the calling order done by the drm layer. If *_crtc_enable()
is called instead it won't do anything because of that active = true thing.
This seems to be happening in your case.

So I'd get rid of that dodgy active = true assignment altogether. Isn't
the introduction of the reset() callback done to avoid exactly this kind
of subtle state fiddling? And removing it might solve the original problem
that the move tried to fix as well.

I can't check the rest of the code as I'm still on patched 37 (won't move
till the fix for bug 23472 is upstream), but my gut feeling is that removing
that weird active = true will solve most problems.

Greetings,

Indan

2011-02-09 05:45:25

by Jeff Chua

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Wed, Feb 9, 2011 at 10:56 AM, Indan Zupancic <[email protected]> wrote:
> On Wed, February 9, 2011 02:05, Jeff Chua wrote:
>> On Wed, Feb 9, 2011 at 8:55 AM, Jeff Chua <[email protected]> wrote:
>>
>>> And the console hangs even without starting X.
>>
>> I went back to retry suspending without starting X and realized that
>> it's only the "screen" that's hang .. and that's without drm and i915
>> loaded.
>
> According to the dmesg you sent, you do have drm (and probably i915 too) loaded.
> It seems the hang is the first bit, and then you rebooted into X to capture the
> log.
>
> Perhaps relevant message (probably not):
>
> "No ACPI video bus found"
>
>> On the console, I could still reboot the machine normally, but
>> not when in X (everything hangs including keybard).
>>
>> Here's the kernel log without X.
>>
>> Thanks.
>> Jeff
>>
>
> Looking at the commit, all it does is changing the timing.
>
> It used to set active to true when intel_crtc_init() was called, but now
> it does it always when the drm reset() callback is called.
>
> intel_crtc->active = true; /* force the pipe off on setup_init_config */
>
> I can't find a setup_init_config anywhere, but looking at the other code
> it assumes that *_crtc_disable() will be called just after the forced true.
>
> All in all it seems quite wrong, no matter if it happens to work, because
> it depends on the calling order done by the drm layer. If *_crtc_enable()
> is called instead it won't do anything because of that active = true thing.
> This seems to be happening in your case.
>
> So I'd get rid of that dodgy active = true assignment altogether. Isn't
> the introduction of the reset() callback done to avoid exactly this kind
> of subtle state fiddling? And removing it might solve the original problem
> that the move tried to fix as well.
>
> I can't check the rest of the code as I'm still on patched 37 (won't move
> till the fix for bug 23472 is upstream), but my gut feeling is that removing
> that weird active = true will solve most problems.

This may help a little. I added printk("intel_crtc 2") inside
intel_crtc_reset() and added printk("intel_crtc 1") before calling
intel_crtc_reset().

Looking at dmesg, it looks like something else is calling
intel_crtc_reset() and not from intel_crtc_init() during resume.

intel_crtc 2 ffff880239cdf000
intel_crtc 2 ffff880239cdf800


Jeff.

2011-02-09 09:32:15

by Chris Wilson

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Wed, 9 Feb 2011 03:56:36 +0100 (CET), "Indan Zupancic" <[email protected]> wrote:
> All in all it seems quite wrong, no matter if it happens to work, because
> it depends on the calling order done by the drm layer. If *_crtc_enable()
> is called instead it won't do anything because of that active = true thing.
> This seems to be happening in your case.

The order is very well defined.

modesetting (upon resume we set the previous mode):
for each enabled crtc:
crtc_helper->prepare -> intel_crtc_disable()
crtc->mode_set -> intel_crtc_mode_set()
crtc_helper->commit -> intel_crtc_enable()
for each !enabled crtc:
crtc->disable -> intel_crtc_disable()
-Chris

--
Chris Wilson, Intel Open Source Technology Centre

2011-02-09 09:42:12

by Indan Zupancic

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Wed, February 9, 2011 06:45, Jeff Chua wrote:
>
> This may help a little. I added printk("intel_crtc 2") inside
> intel_crtc_reset() and added printk("intel_crtc 1") before calling
> intel_crtc_reset().
>
> Looking at dmesg, it looks like something else is calling
> intel_crtc_reset() and not from intel_crtc_init() during resume.

That something else is the drm layer.

(I must say it's very unclear what the the ordering of driver function
calls will be from just looking at drm the code. I hope the drm
abstraction is working out well for others, to me it all seems a bit
awkward. If state needs to be tracked, fine, but do it either in the
drm layer or let the driver handle it.)

> intel_crtc 2 ffff880239cdf000
> intel_crtc 2 ffff880239cdf800

This doesn't really help, all it probably means is that you've got
multiple crtc outputs, or something like that. It might help if you
get two calls with the offending commit, but only one without it.

I'd add printk's to the *_crtc_disable()/*_crtc_enable() calls with
info whether it actually enables or disables something and compare
the result between a working suspend and a broken one.

Greetings,

Indan

2011-02-09 10:20:50

by Indan Zupancic

[permalink] [raw]
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_

On Wed, February 9, 2011 10:32, Chris Wilson wrote:
> On Wed, 9 Feb 2011 03:56:36 +0100 (CET), "Indan Zupancic" <[email protected]> wrote:
>> All in all it seems quite wrong, no matter if it happens to work, because
>> it depends on the calling order done by the drm layer. If *_crtc_enable()
>> is called instead it won't do anything because of that active = true thing.
>> This seems to be happening in your case.
>
> The order is very well defined.
>
> modesetting (upon resume we set the previous mode):
> for each enabled crtc:
> crtc_helper->prepare -> intel_crtc_disable()
> crtc->mode_set -> intel_crtc_mode_set()
> crtc_helper->commit -> intel_crtc_enable()
> for each !enabled crtc:
> crtc->disable -> intel_crtc_disable()

Prepare for what? That could mean anything. Is it only used to
prepare changing a mode, or suspend, or what? Same for commit.
Should it have been named modes_set_prepare and mode_set_commit?

It's clear if you've worked a lot on the code, but if you're just
debugging it's had to tell when anything will be called, the
function pointer chasing isn't fun. And that doesn't guarantee
a driver function won't be called in a different way in the
future anyway.

I'd go as far as saying that if that's always the order, then
just get rid of prepare and commit and do what's needed in the
mode_set function. If prepare and commit don't have any other
purpose or reason for existence.

And back to the original thing, where does that reset() callback
fit in? It's absent from the very well defined order. And judging
by its name, it should be okay to call at any moment, but it seems
that isn't the case.

But the real wrong thing is fiddling with "active" outside of those
state changing functions to force a certain behaviour later on if a
specific function is called just after this (fingers crossed).

My advise is to just remove that active = true line and fix any
breakage that results in some other way. It acts as an out-of-band
message to *crtc_disable() to re-disable already disabled crtcs,
which doesn't always work (either now or in the future). If the state
wasn't already messed up, it is after doing the active = true thing.

Greetings,

Indan