Hi Rafael,
This series fixes a regression reported in 6.6:
https://lore.kernel.org/regressions/9f36fb06-64c4-4264-aaeb-4e1289e764c4@owe... https://gitlab.freedesktop.org/drm/nouveau/-/issues/273 https://bugzilla.kernel.org/show_bug.cgi?id=218124
The reporter has confirmed that this series fixes things and Kai-Heng has confirmed that backlight control still works on the HP ZBook Fury 16 G10 for which the original acpi_device_fix_up_power_extended() call this replaces was added.
Assuming you agree with this series, can you get it on its way to Linus so that it can be backported to 6.6 please ?
Regards,
Hans
Hans de Goede (2): ACPI: PM: Add acpi_device_fix_up_power_children() function ACPI: video: Use acpi_device_fix_up_power_children()
drivers/acpi/acpi_video.c | 2 +- drivers/acpi/device_pm.c | 13 +++++++++++++ include/acpi/acpi_bus.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-)
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.
Signed-off-by: Hans de Goede hdegoede@redhat.com --- drivers/acpi/device_pm.c | 13 +++++++++++++ include/acpi/acpi_bus.h | 1 + 2 files changed, 14 insertions(+)
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index f007116a8427..3b4d048c4941 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -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; diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 254685085c82..0b7eab0ef7d7 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -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);
On Sun, Nov 12, 2023 at 09:36:26PM +0100, Hans de Goede wrote:
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.
Signed-off-by: Hans de Goede hdegoede@redhat.com
drivers/acpi/device_pm.c | 13 +++++++++++++ include/acpi/acpi_bus.h | 1 + 2 files changed, 14 insertions(+)
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.
</formletter>
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.
Fixes: 89c290ea7589 ("ACPI: video: Put ACPI video and its child devices into D0 on boot") Reported-by: Owen T. Heisler writer@owenh.net Closes: https://lore.kernel.org/regressions/9f36fb06-64c4-4264-aaeb-4e1289e764c4@owe... Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218124 Tested-by: Kai-Heng Feng kai.heng.feng@canonical.com Tested-by: Owen T. Heisler writer@owenh.net Signed-off-by: Hans de Goede hdegoede@redhat.com --- drivers/acpi/acpi_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index b411948594ff..4e868454b38d 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -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),
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#opti...
Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree. Subject: [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children() Link: https://lore.kernel.org/stable/20231112203627.34059-3-hdegoede%40redhat.com
Hi Hans,
On Sun, Nov 12, 2023 at 9:36 PM Hans de Goede hdegoede@redhat.com wrote:
Hi Rafael,
This series fixes a regression reported in 6.6:
https://lore.kernel.org/regressions/9f36fb06-64c4-4264-aaeb-4e1289e764c4@owe... https://gitlab.freedesktop.org/drm/nouveau/-/issues/273 https://bugzilla.kernel.org/show_bug.cgi?id=218124
The reporter has confirmed that this series fixes things and Kai-Heng has confirmed that backlight control still works on the HP ZBook Fury 16 G10 for which the original acpi_device_fix_up_power_extended() call this replaces was added.
Assuming you agree with this series, can you get it on its way to Linus so that it can be backported to 6.6 please ?
Both patches applied as 6.7-rc material, thanks!
linux-stable-mirror@lists.linaro.org