: acpi/nouveau: Hardware unavailable upon resume or suspend fails
Subsystems (4)
#regzbot introduced: 89c290ea758911e660878e26270e084d862c03b0 #regzbot link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=218124
## Reproducing
1. Boot system to framebuffer console.
2. Run systemctl suspend. If undocked without secondary display, suspend fails. If docked with secondary display, suspend succeeds.
3. Resume from suspend if applicable.
4. System is now in a broken state.
## Testing
- culprit commit is 89c290ea758911e660878e26270e084d862c03b0
- v6.6 fails
- v6.6 with culprit commit reverted does not fail
- Compiled with <https://gitlab.freedesktop.org/drm/nouveau/uploads/788d7faf22ba2884dcc09d7be931e813/v6.6-config1>
## Hardware
- ThinkPad W530 2438-52U
- Dock with Nvidia-connected DVI ports
- Secondary display connected via DVI
- Nvidia Optimus GPU switching system
```console $ lspci | grep -i vga 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K2000M] (rev a1) ```
## Decoded logs from v6.6
- System is not docked and fails to suspend: <https://gitlab.freedesktop.org/drm/nouveau/uploads/fb8fdf5a6bed1b1491d2544ab67fa257/undocked.log>
- System is docked and fails after resume: <https://gitlab.freedesktop.org/drm/nouveau/uploads/cb3d5ac55c01f663cd80fa000cd6a3b5/docked.log>
Hi Owen,
Quoted 4 lines · Owen T. Heisler
#regzbot introduced:
89c290ea758911e660878e26270e084d862c03b0#regzbot link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=218124
Thanks for the bug report. Do you prefer to continue the discussion here, on gitlab or on bugzilla?
Quoted 8 lines
## Reproducing
1. Boot system to framebuffer console.
2. Runsystemctl suspend. If undocked without secondary display, suspend fails. If docked with secondary display, suspend succeeds.
3. Resume from suspend if applicable.
4. System is now in a broken state.
So I guess we need to put those devices to ACPI D3 for suspend. Let's discuss this on your preferred platform.
Kai-Heng
Quoted 30 lines
## Testing
- culprit commit is
89c290ea758911e660878e26270e084d862c03b0
- v6.6 fails
- v6.6 with culprit commit reverted does not fail
- Compiled with
<https://gitlab.freedesktop.org/drm/nouveau/uploads/788d7faf22ba2884dcc09d7be931e813/v6.6-config1>## Hardware
- ThinkPad W530 2438-52U
- Dock with Nvidia-connected DVI ports
- Secondary display connected via DVI
- Nvidia Optimus GPU switching system```console $ lspci | grep -i vga 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K2000M] (rev a1) ```## Decoded logs from v6.6
- System is not docked and fails to suspend:
<https://gitlab.freedesktop.org/drm/nouveau/uploads/fb8fdf5a6bed1b1491d2544ab67fa257/undocked.log>
- System is docked and fails after resume:
<https://gitlab.freedesktop.org/drm/nouveau/uploads/cb3d5ac55c01f663cd80fa000cd6a3b5/docked.log>
Hi All,
Quoted 10 lines · Kai-Heng Feng
Hi Owen,
Quoted 4 lines · Owen T. Heisler
#regzbot introduced:
89c290ea758911e660878e26270e084d862c03b0#regzbot link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=218124Thanks for the bug report. Do you prefer to continue the discussion here, on gitlab or on bugzilla?
Owen, as Kai-Heng said thank you for reporting this.
Quoted 10 lines
Quoted 7 lines
## Reproducing
1. Boot system to framebuffer console.
2. Runsystemctl suspend. If undocked without secondary display, suspend fails. If docked with secondary display, suspend succeeds.
3. Resume from suspend if applicable.
4. System is now in a broken state.So I guess we need to put those devices to ACPI D3 for suspend. Let's discuss this on your preferred platform.
Ok, so I was already sort of afraid we might see something like this happening because of:
As I mentioned during the review of that, it might be better to not touch the video-card ACPI power-state at all and instead only do acpi_device_fix_up_power() on the child devices.
Owen, attached are 2 patches which implement only calling acpi_device_fix_up_power() on the child devices, can you build a v6.6 kernel with these 2 patches added on top please and see if that fixes things ?
Kai-Heng can you test that the issue on the HP ZBook Fury 16 G10 is still resolved after applying these patches ?
Regards,
Hans
From 68a819101c580bb89f34a31196ace81244ca8eb5 Mon Sep 17 00:00:00 2001
From: Hans de Goede <[email protected]>
Date: Fri, 10 Nov 2023 12:52:39 +0100
Subject: [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children()
function
In some cases it is necessary to fix-up the power-state of an ACPI device's children without touching the ACPI device itself add a new acpi_device_fix_up_power_children() function for this.
--- drivers/acpi/device_pm.c | 13 +++++++++++++ include/acpi/acpi_bus.h | 1 + 2 files changed, 14 insertions(+)
drivers/acpi/device_pm.c +13 -0
@@ -397,6 +397,19 @@ void acpi_device_fix_up_power_extended(struct acpi_device *adev) }EXPORT_SYMBOL_GPL (acpi_device_fix_up_power_extended); +/** +* acpi_device_fix_up_power_children - Force a device's children into D0. +* @adev: Parent device object whose children's power state is to be fixed up. +* +* Call acpi_device_fix_up_power() for @adev's children so long as they +* are reported as present and enabled. +*/ +void acpi_device_fix_up_power_children (struct acpi_device *adev) +{ +acpi_dev_for_each_child (adev, fix_up_power_if_applicable,NULL ); +} +EXPORT_SYMBOL_GPL (acpi_device_fix_up_power_children); +int acpi_device_update_power (struct acpi_device *device,int *state_p) {int state;
include/acpi/acpi_bus.h +1 -0
@@ -539,6 +539,7 @@ int acpi_device_set_power(struct acpi_device *device, int state);int acpi_bus_init_power (struct acpi_device *device);int acpi_device_fix_up_power (struct acpi_device *device);void acpi_device_fix_up_power_extended (struct acpi_device *adev); +void acpi_device_fix_up_power_children (struct acpi_device *adev);int acpi_bus_update_power (acpi_handle handle,int *state_p);int acpi_device_update_power (struct acpi_device *device,int *state_p);bool acpi_bus_power_manageable (acpi_handle handle);
Signature · 1 line
2.41.0
From 33e2d55917ac7082e8d98dc2a678a856f8d48352 Mon Sep 17 00:00:00 2001
From: Hans de Goede <[email protected]>
Date: Fri, 10 Nov 2023 13:10:02 +0100
Subject: [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children()
Commit 89c290ea7589 ("ACPI: video: Put ACPI video and its child devices into D0 on boot") introduced calling acpi_device_fix_up_power_extended() on the video card for which the ACPI video bus is the companion device.
This unnecessarily touches the power-state of the GPU itself, while the issue it tries to address only requires calling _PS0 on the child devices.
Touching the power-state of the GPU itself is causing suspend / resume issues on e.g. a Lenovo ThinkPad W530.
Instead use acpi_device_fix_up_power_children(), which only touches the child devices, to fix this.
--- drivers/acpi/acpi_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_video.c +1 -1
@@ -2031,7 +2031,7 @@ static int acpi_video_bus_add(struct acpi_device *device)* HP ZBook Fury 16 G10 requires ACPI video's child devices have _PS0 * evaluated to have functional panel brightness control. */ -acpi_device_fix_up_power_extended (device); +acpi_device_fix_up_power_children (device); pr_info("%s [%s] (multi-head: %s rom: %s post: %s)\n", ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
Signature · 1 line
2.41.0
Kai-Heng Feng
Tested-byHi Hans,
Quoted 28 lines · Hans de Goede
Hi All,
Quoted 10 lines · Kai-Heng Feng
Hi Owen,
Quoted 4 lines · Owen T. Heisler
#regzbot introduced:
89c290ea758911e660878e26270e084d862c03b0#regzbot link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=218124Thanks for the bug report. Do you prefer to continue the discussion here, on gitlab or on bugzilla?
Owen, as Kai-Heng said thank you for reporting this.
Quoted 10 lines
Quoted 7 lines
## Reproducing
1. Boot system to framebuffer console.
2. Runsystemctl suspend. If undocked without secondary display, suspend fails. If docked with secondary display, suspend succeeds.
3. Resume from suspend if applicable.
4. System is now in a broken state.So I guess we need to put those devices to ACPI D3 for suspend. Let's discuss this on your preferred platform.
Quoted 8 lines
Ok, so I was already sort of afraid we might see something like this happening because of:
As I mentioned during the review of that, it might be better to not touch the video-card ACPI power-state at all and instead only do
acpi_device_fix_up_power()on the child devices.
Or the child devices need to be put to D3 during suspend.
Quoted 8 lines
Owen, attached are 2 patches which implement only calling
acpi_device_fix_up_power()on the child devices, can you build a v6.6 kernel with these 2 patches added on top please and see if that fixes things ?Kai-Heng can you test that the issue on the HP ZBook Fury 16 G10 is still resolved after applying these patches ?
Yes. Thanks for the patch.
If this patch also fixes Owen's issue, then
Quoted 5 lines
Regards,
Hans
Owen T. Heisler
Tested-byHi everyone,
Quoted 9 lines · Kai-Heng Feng
Quoted 8 lines · Hans de Goede
Quoted 7 lines · Kai-Heng Feng
Quoted 3 lines · Owen T. Heisler
#regzbot introduced:
89c290ea758911e660878e26270e084d862c03b0#regzbot link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=218124Thanks for the bug report. Do you prefer to continue the discussion here, on gitlab or on bugzilla?
Kai-Heng, you're welcome and thank you too. By email is fine with me.
Quoted 1 line
Quoted 1 line
Owen, as Kai-Heng said thank you for reporting this.
Hans, you're welcome, and thanks for your help too.
Quoted 14 lines
Quoted 14 lines
Quoted 10 lines
Quoted 7 lines
## Reproducing
1. Boot system to framebuffer console.
2. Runsystemctl suspend. If undocked without secondary display, suspend fails. If docked with secondary display, suspend succeeds.
3. Resume from suspend if applicable.
4. System is now in a broken state.So I guess we need to put those devices to ACPI D3 for suspend. Let's discuss this on your preferred platform.
Ok, so I was already sort of afraid we might see something like this happening because of:
Quoted 12 lines
Quoted 5 lines
As I mentioned during the review of that, it might be better to not touch the video-card ACPI power-state at all and instead only do
acpi_device_fix_up_power()on the child devices.Or the child devices need to be put to D3 during suspend.
Quoted 4 lines
Owen, attached are 2 patches which implement only calling
acpi_device_fix_up_power()on the child devices, can you build a v6.6 kernel with these 2 patches added on top please and see if that fixes things ?
Yes, with those patches v6.6 suspend works normally. That's great, thanks!
I tested with v6.6 with the 2 patches at <https://lore.kernel.org/regressions/[email protected]/> using <https://gitlab.freedesktop.org/drm/nouveau/uploads/788d7faf22ba2884dcc09d7be931e813/v6.6-config1>. I tested both docked and un-docked, just in case.
Quoted 7 lines
Quoted 2 lines
Kai-Heng can you test that the issue on the HP ZBook Fury 16 G10 is still resolved after applying these patches ?
Yes. Thanks for the patch.
If this patch also fixes Owen's issue, then
Tested-by Kai-Heng Feng <[email protected]
Please let me know if anything else is needed from me.
Many thanks,
Owen
Hi,
Quoted 46 lines · Owen T. Heisler
Hi everyone,
Quoted 9 lines · Kai-Heng Feng
Quoted 8 lines · Hans de Goede
Quoted 7 lines · Kai-Heng Feng
Quoted 3 lines · Owen T. Heisler
#regzbot introduced:
89c290ea758911e660878e26270e084d862c03b0#regzbot link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=218124Thanks for the bug report. Do you prefer to continue the discussion here, on gitlab or on bugzilla?
Kai-Heng, you're welcome and thank you too. By email is fine with me.
Quoted 1 line
Quoted 1 line
Owen, as Kai-Heng said thank you for reporting this.
Hans, you're welcome, and thanks for your help too.
Quoted 14 lines
Quoted 14 lines
Quoted 10 lines
Quoted 7 lines
## Reproducing
1. Boot system to framebuffer console.
2. Runsystemctl suspend. If undocked without secondary display, suspend fails. If docked with secondary display, suspend succeeds.
3. Resume from suspend if applicable.
4. System is now in a broken state.So I guess we need to put those devices to ACPI D3 for suspend. Let's discuss this on your preferred platform.
Ok, so I was already sort of afraid we might see something like this happening because of:
Quoted 12 lines
Quoted 5 lines
As I mentioned during the review of that, it might be better to not touch the video-card ACPI power-state at all and instead only do
acpi_device_fix_up_power()on the child devices.Or the child devices need to be put to D3 during suspend.
Quoted 4 lines
Owen, attached are 2 patches which implement only calling
acpi_device_fix_up_power()on the child devices, can you build a v6.6 kernel with these 2 patches added on top please and see if that fixes things ?
Quoted 13 lines
Yes, with those patches v6.6 suspend works normally. That's great, thanks!
I tested with v6.6 with the 2 patches at <https://lore.kernel.org/regressions/[email protected]/> using <https://gitlab.freedesktop.org/drm/nouveau/uploads/788d7faf22ba2884dcc09d7be931e813/v6.6-config1>. I tested both docked and un-docked, just in case.
Tested-by Owen T. Heisler <[email protected]>Quoted 7 lines
Quoted 2 lines
Kai-Heng can you test that the issue on the HP ZBook Fury 16 G10 is still resolved after applying these patches ?
Yes. Thanks for the patch.
If this patch also fixes Owen's issue, then
Tested-by Kai-Heng Feng <[email protected]
Owen, Kai-Heng thank you for testing. I've submitted these patches to Rafael (the ACPI maintainer) now (with you on the Cc). Hopefully they will get merged soon.
Regards,
Hans
Quoted 3 lines · Hans de Goede
Owen, Kai-Heng thank you for testing. I've submitted these patches to Rafael (the ACPI maintainer) now (with you on the Cc). Hopefully they will get merged soon.
That's great, thanks!
Owen