Skip to contentSkip to conversation

drm/i915: apply the PCI_D0/D3 hibernation workaround everywhere on pre GEN6

PATCH Applied Imre Deak 7 participants 14 messages Jun 30, 2015 – Aug 31, 2015

Subsystems (3)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/1 drm/i915: apply the PCI_D0/D3 hibernation workaround everywhere on pre GEN6

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns with our future plans to unify more the runtime and system suspend/resume paths. Since an exact blacklist seems to be impractical (multiple GENs and BIOS vendors are affected) apply the workaround on everything pre GEN6.

[1] http://lists.freedesktop.org/archives/intel-gfx/2015-February/060710.html
[2] https://lkml.org/lkml/2015/6/22/274

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95061

---
 drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +9 -6
index e44dc0d..1e675ff 100644
@@ -664,15 +664,18 @@ static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation)
 
 	pci_disable_device(drm_dev->pdev);
 	/*
-	 * During hibernation on some GEN4 platforms the BIOS may try to access
+	 * During hibernation on some platforms the BIOS may try to access
 	 * the device even though it's already in D3 and hang the machine. So
 	 * leave the device in D0 on those platforms and hope the BIOS will
-	 * power down the device properly. Platforms where this was seen:
-	 * Lenovo Thinkpad X301, X61s
+	 * power down the device properly. The issue was seen on multiple old
+	 * GENs with different BIOS vendors, so having an explicit blacklist
+	 * is inpractical; apply the workaround on everything pre GEN6. The
+	 * platforms where the issue was seen:
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T
 	 */
-	if (!(hibernation &&
-	      drm_dev->pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO &&
-	      INTEL_INFO(dev_priv)->gen == 4))
+	if (!(hibernation && INTEL_INFO(dev_priv)->gen < 6))
 		pci_set_power_state(drm_dev->pdev, PCI_D3hot);
 
 	return 0;
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Hi!

Quoted 15 lines

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

Quoted 7 lines

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns

Hmm, so the reasons according to you are:

Quoted 5 lines

- ACPI mandates that the OSPM (the kernel in our case) puts all devices
into D3 that are not wake-up sources (i915 is not) (Kudos to Ville for
pointing this out)

Clearly, BIOS vendors did not read this, and pretty clearly Windows do not follow the specs, either. That means that it is bad idea for us to follow the specs, and trigger BIOS bugs.

Quoted 5 lines

- Embedded panels have a well defined shutdown sequence. We don't have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation) · line 676

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +3 -0
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T

What makes you think that BIOS writers will do something different for Gen6+ hardware? X301 is not that old.
Pavel

Signature · 6 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 43 lines · Pavel Machek

Hi!

Quoted 15 lines

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

Quoted 7 lines

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns

Hmm, so the reasons according to you are:

Quoted 5 lines

- ACPI mandates that the OSPM (the kernel in our case) puts all devices
into D3 that are not wake-up sources (i915 is not) (Kudos to Ville for
pointing this out)

Clearly, BIOS vendors did not read this, and pretty clearly Windows do not follow the specs, either. That means that it is bad idea for us to follow the specs, and trigger BIOS bugs.

Quoted 5 lines

- Embedded panels have a well defined shutdown sequence. We don't have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Quoted 4 lines

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

I was originally referring to reboots, which might not be applicable here. Anyway, we have to go out of our way to handle that properly in some cases:

commit 01527b3127997ef6370d5ad4fa25d96847fbf12a

Author: Clint Taylor <[email protected]>
Date:   Mon Jul 7 13:01:46 2014 -0700

drm/i915/vlv: T12 eDP panel timing enforcement during reboot

BR,
Jani.

Quoted 11 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation) · line 676

Quoted 4 lines
drivers/gpu/drm/i915/i915_drv.c +3 -0
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T

What makes you think that BIOS writers will do something different for Gen6+ hardware? X301 is not that old.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 53 lines · Jani Nikula
Quoted 43 lines · Pavel Machek

Hi!

Quoted 15 lines

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

Quoted 7 lines

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns

Hmm, so the reasons according to you are:

Quoted 5 lines

- ACPI mandates that the OSPM (the kernel in our case) puts all devices
into D3 that are not wake-up sources (i915 is not) (Kudos to Ville for
pointing this out)

Clearly, BIOS vendors did not read this, and pretty clearly Windows do not follow the specs, either. That means that it is bad idea for us to follow the specs, and trigger BIOS bugs.

Quoted 5 lines

- Embedded panels have a well defined shutdown sequence. We don't have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Quoted 4 lines

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

I was originally referring to reboots, which might not be applicable here. Anyway, we have to go out of our way to handle that properly in some cases:

Quoted 5 lines

commit 01527b3127997ef6370d5ad4fa25d96847fbf12a

Author: Clint Taylor <[email protected]>
Date:   Mon Jul 7 13:01:46 2014 -0700

drm/i915/vlv: T12 eDP panel timing enforcement during reboot

So we now have single argument "ACPI specs says so". Unfortunately, BIOSes can not read, and Windows does it the other way around...

What is special about gen6?
Pavel

Signature · 6 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
In reply to Pavel Machek
Quoted 33 lines · Pavel Machek

Hi!

Quoted 15 lines

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

Quoted 7 lines

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns

Hmm, so the reasons according to you are:

Quoted 5 lines

- ACPI mandates that the OSPM (the kernel in our case) puts all devices
into D3 that are not wake-up sources (i915 is not) (Kudos to Ville for
pointing this out)

Quoted 3 lines

Clearly, BIOS vendors did not read this, and pretty clearly Windows do not follow the specs, either. That means that it is bad idea for us to follow the specs, and trigger BIOS bugs.

It's not clear at all. From what I managed to find on the Internets, Windows (at least recent versions) should put devices into D3.

Quoted 12 lines
Quoted 6 lines

- Embedded panels have a well defined shutdown sequence. We don't have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation) · line 676

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +3 -0
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T

What makes you think that BIOS writers will do something different for Gen6+ hardware? X301 is not that old.

Thinkpad X1 Carbon (IVB) is perfectly happy with the D3, so clearly something changed for Lenovo at least. And most machines (old and new) have no problems whatsoever with the D3.

It might be interesting to see if hibernate even works in Windows without some vendor driver on these machines.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#5 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line

- Embedded panels have a well defined shutdown sequence. We

don't

Quoted 17 lines
Quoted 10 lines
Quoted 4 lines

have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

Quoted 6 lines

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation) · line 676

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +3 -0
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T

What makes you think that BIOS writers will do something different for Gen6+ hardware? X301 is not that old.

Quoted 3 lines

Thinkpad X1 Carbon (IVB) is perfectly happy with the D3, so clearly something changed for Lenovo at least. And most machines (old and new) have no problems whatsoever with the D3.

Well, one machine being happy does not matter that much... as going to D3 has no real benefits.

Quoted 2 lines

It might be interesting to see if hibernate even works in Windows without some vendor driver on these machines.

I don't have windows nearby..
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw
Quoted 20 lines · Pavel Machek
Quoted 1 line
Quoted 1 line
Quoted 1 line

- Embedded panels have a well defined shutdown sequence. We

don't

Quoted 17 lines
Quoted 16 lines
Quoted 4 lines

have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation) · line 676

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +3 -0
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T

What makes you think that BIOS writers will do something different for Gen6+ hardware? X301 is not that old.

Quoted 5 lines
Quoted 3 lines

Thinkpad X1 Carbon (IVB) is perfectly happy with the D3, so clearly something changed for Lenovo at least. And most machines (old and new) have no problems whatsoever with the D3.

Well, one machine being happy does not matter that much...

I said most machines, not one.

Quoted 2 lines

as going to
D3 has no real benefits.

Sure it does. Eventually we'll want to avoid resuming runtime suspended devices when entering system suspend. For broken machines we'd need to resume the GPU at that point.

Quoted 5 lines
Quoted 3 lines

It might be interesting to see if hibernate even works in Windows without some vendor driver on these machines.

I don't have windows nearby..

Me neither.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 27 lines · Ville Syrjälä
Quoted 20 lines · Pavel Machek
Quoted 1 line
Quoted 1 line
Quoted 1 line

- Embedded panels have a well defined shutdown sequence. We

don't

Quoted 17 lines
Quoted 16 lines
Quoted 4 lines

have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation) · line 676

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +3 -0
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T

What makes you think that BIOS writers will do something different for Gen6+ hardware? X301 is not that old.

Quoted 5 lines
Quoted 3 lines

Thinkpad X1 Carbon (IVB) is perfectly happy with the D3, so clearly something changed for Lenovo at least. And most machines (old and new) have no problems whatsoever with the D3.

Well, one machine being happy does not matter that much...

Quoted 8 lines

I said most machines, not one.

Quoted 2 lines

as going to
D3 has no real benefits.

Sure it does. Eventually we'll want to avoid resuming runtime suspended devices when entering system suspend. For broken machines we'd need to resume the GPU at that point.

You want to optimize transition between suspend-to-RAM and hibernation? No? I thought so.

So no benefits, 7 real, broken machines.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#8 lore raw
Quoted 33 lines · Pavel Machek
Quoted 32 lines · Ville Syrjälä
Quoted 20 lines · Pavel Machek
Quoted 1 line
Quoted 1 line
Quoted 1 line

- Embedded panels have a well defined shutdown sequence. We

don't

Quoted 17 lines
Quoted 16 lines
Quoted 4 lines

have
any good reason to not follow this, in fact for some panels the subsequent reinitialization could be problematic in case of a hard power-off. (Thanks to Jani for this info)

Please cite concrete example. I have yet to see machine that would not power up on forced power down. In fact, I argue that such machine would be very broken, and that such machine does not exist. While we have these real machines broken:

drivers/gpu/drm/i915/i915_drv.c static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation) · line 676

Quoted 3 lines
drivers/gpu/drm/i915/i915_drv.c +3 -0
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T

What makes you think that BIOS writers will do something different for Gen6+ hardware? X301 is not that old.

Quoted 5 lines
Quoted 3 lines

Thinkpad X1 Carbon (IVB) is perfectly happy with the D3, so clearly something changed for Lenovo at least. And most machines (old and new) have no problems whatsoever with the D3.

Well, one machine being happy does not matter that much...

I said most machines, not one.

Quoted 2 lines

as going to
D3 has no real benefits.

Quoted 8 lines
Quoted 3 lines

Sure it does. Eventually we'll want to avoid resuming runtime suspended devices when entering system suspend. For broken machines we'd need to resume the GPU at that point.

You want to optimize transition between suspend-to-RAM and hibernation? No? I thought so.

So no benefits, 7 real, broken machines.

runtime suspended != suspend-to-RAM

Quoted 5 lines

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#9 lore raw
In reply to Pavel Machek
Quoted 9 lines · Pavel Machek
Quoted 3 lines · Ville Syrjälä

Sure it does. Eventually we'll want to avoid resuming runtime suspended devices when entering system suspend. For broken machines we'd need to resume the GPU at that point.

You want to optimize transition between suspend-to-RAM and hibernation? No? I thought so.

So no benefits, 7 real, broken machines.

Runtime suspend = things like S0ix and other forms of shallow sleep. System suspend = suspend-to-RAM.

It's not about hibernate (though it'd of course nice if a transition from suspend to hibernate because of low battery won't result in the device consuming so much battery during the intermediate wakeup that the device shuts down rather than hibernates).

Kind regards, David
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Tested-by on v1 1/1
#10 lore raw
In reply to Imre Deak

Task id: 6683 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

ILK                                  302/302              302/302
SNB                                  312/316              312/316
IVB                                  343/343              343/343

BYT -2 287/287 285/287
HSW 380/380 380/380
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*BYT igt@gem_partial_pwrite_pread@reads-display PASS(1) FAIL(1)
*BYT igt@gem_tiled_partial_pwrite_pread@reads PASS(1) FAIL(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Tested-by on v1 1/1
#11 lore raw
In reply to Imre Deak
Quoted 28 lines · Imre Deak

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns with our future plans to unify more the runtime and system suspend/resume paths. Since an exact blacklist seems to be impractical (multiple GENs and BIOS vendors are affected) apply the workaround on everything pre GEN6.

[1] http://lists.freedesktop.org/archives/intel-gfx/2015-February/060710.html
[2] https://lkml.org/lkml/2015/6/22/274

Quoted 8 lines

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95061

on top of v4.1.2.

Could this or any better alternative please be sent Linus and then to stable?

-Mikko

Quoted 36 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +9 -6
index e44dc0d..1e675ff 100644
@@ -664,15 +664,18 @@ static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation)
 
 	pci_disable_device(drm_dev->pdev);
 	/*
-	 * During hibernation on some GEN4 platforms the BIOS may try to access
+	 * During hibernation on some platforms the BIOS may try to access
 	 * the device even though it's already in D3 and hang the machine. So
 	 * leave the device in D0 on those platforms and hope the BIOS will
-	 * power down the device properly. Platforms where this was seen:
-	 * Lenovo Thinkpad X301, X61s
+	 * power down the device properly. The issue was seen on multiple old
+	 * GENs with different BIOS vendors, so having an explicit blacklist
+	 * is inpractical; apply the workaround on everything pre GEN6. The
+	 * platforms where the issue was seen:
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T
 	 */
-	if (!(hibernation &&
-	      drm_dev->pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO &&
-	      INTEL_INFO(dev_priv)->gen == 4))
+	if (!(hibernation && INTEL_INFO(dev_priv)->gen < 6))
 		pci_set_power_state(drm_dev->pdev, PCI_D3hot);
 
 	return 0;
Signature · 1 line
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Tested-by on v1 1/1
#12 lore raw
In reply to Imre Deak

Please, please merge this patch already. Without it hibernation poweroff is broken for several users. There were some doubts raised over the approach on lkml review but Imre as maintainer thinks this is the right thing to do and users like me need this patch.

Tested again with Thinkpad T60 and kernel version 4.1.6.

-Mikko

Quoted 72 lines · Imre Deak

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns with our future plans to unify more the runtime and system suspend/resume paths. Since an exact blacklist seems to be impractical (multiple GENs and BIOS vendors are affected) apply the workaround on everything pre GEN6.

[1] http://lists.freedesktop.org/archives/intel-gfx/2015-February/060710.html
[2] https://lkml.org/lkml/2015/6/22/274

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95061

---
 drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +9 -6
index e44dc0d..1e675ff 100644
@@ -664,15 +664,18 @@ static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation)
 
 	pci_disable_device(drm_dev->pdev);
 	/*
-	 * During hibernation on some GEN4 platforms the BIOS may try to access
+	 * During hibernation on some platforms the BIOS may try to access
 	 * the device even though it's already in D3 and hang the machine. So
 	 * leave the device in D0 on those platforms and hope the BIOS will
-	 * power down the device properly. Platforms where this was seen:
-	 * Lenovo Thinkpad X301, X61s
+	 * power down the device properly. The issue was seen on multiple old
+	 * GENs with different BIOS vendors, so having an explicit blacklist
+	 * is inpractical; apply the workaround on everything pre GEN6. The
+	 * platforms where the issue was seen:
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T
 	 */
-	if (!(hibernation &&
-	      drm_dev->pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO &&
-	      INTEL_INFO(dev_priv)->gen == 4))
+	if (!(hibernation && INTEL_INFO(dev_priv)->gen < 6))
 		pci_set_power_state(drm_dev->pdev, PCI_D3hot);
 
 	return 0;
Signature · 1 line
2.1.4
Applied
#13 lore raw
Quoted 8 lines · Mikko Rapeli

Please, please merge this patch already. Without it hibernation poweroff is broken for several users. There were some doubts raised over the approach on lkml review but Imre as maintainer thinks this is the right thing to do and users like me need this patch.

Tested again with Thinkpad T60 and kernel version 4.1.6.

Pushed to drm-intel-next-fixes.

BR,
Jani.

Quoted 76 lines

-Mikko

Quoted 72 lines · Imre Deak

commit da2bc1b9db3351addd293e5b82757efe1f77ed1d

Author: Imre Deak <[email protected]>
Date:   Thu Oct 23 19:23:26 2014 +0300

drm/i915: add poweroff_late handler

introduced a regression on old platforms during hibernation. A workaround was added in

commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb

Author: Imre Deak <[email protected]>
Date:   Mon Mar 2 13:04:41 2015 +0200

drm/i915: gen4: work around hang during hibernation

using an explicit blacklist for the GENs/BIOS vendors where the issue was reported. Later there we had reports of the same failure on platforms not on this list.

To my best knowledge the correct thing to do is still to put the device to PCI D3 state during hibernation, see [1] and [2] for the reasons. This also aligns with our future plans to unify more the runtime and system suspend/resume paths. Since an exact blacklist seems to be impractical (multiple GENs and BIOS vendors are affected) apply the workaround on everything pre GEN6.

[1] http://lists.freedesktop.org/archives/intel-gfx/2015-February/060710.html
[2] https://lkml.org/lkml/2015/6/22/274

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95061

---
 drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +9 -6
index e44dc0d..1e675ff 100644
@@ -664,15 +664,18 @@ static int i915_drm_suspend_late(struct drm_device *drm_dev, bool hibernation)
 
 	pci_disable_device(drm_dev->pdev);
 	/*
-	 * During hibernation on some GEN4 platforms the BIOS may try to access
+	 * During hibernation on some platforms the BIOS may try to access
 	 * the device even though it's already in D3 and hang the machine. So
 	 * leave the device in D0 on those platforms and hope the BIOS will
-	 * power down the device properly. Platforms where this was seen:
-	 * Lenovo Thinkpad X301, X61s
+	 * power down the device properly. The issue was seen on multiple old
+	 * GENs with different BIOS vendors, so having an explicit blacklist
+	 * is inpractical; apply the workaround on everything pre GEN6. The
+	 * platforms where the issue was seen:
+	 * Lenovo Thinkpad X301, X61s, X60, T60, X41
+	 * Fujitsu FSC S7110
+	 * Acer Aspire 1830T
 	 */
-	if (!(hibernation &&
-	      drm_dev->pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO &&
-	      INTEL_INFO(dev_priv)->gen == 4))
+	if (!(hibernation && INTEL_INFO(dev_priv)->gen < 6))
 		pci_set_power_state(drm_dev->pdev, PCI_D3hot);
 
 	return 0;
Signature · 1 line
2.1.4
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center