stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ACPI: video: Use acpi_device_fix_up_power_children()
@ 2023-11-12 20:36 Hans de Goede
  2023-11-12 20:36 ` [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children() function Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hans de Goede @ 2023-11-12 20:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: Hans de Goede, Owen T . Heisler, Kai-Heng Feng, linux-acpi,
	regressions, stable

Hi Rafael,

This series fixes a regression reported in 6.6:

https://lore.kernel.org/regressions/9f36fb06-64c4-4264-aaeb-4e1289e764c4@owenh.net/
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(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children() function
  2023-11-12 20:36 [PATCH 0/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
@ 2023-11-12 20:36 ` Hans de Goede
  2023-11-13 14:32   ` Greg KH
  2023-11-12 20:36 ` [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
  2023-11-20 16:32 ` [PATCH 0/2] " Rafael J. Wysocki
  2 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2023-11-12 20:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: Hans de Goede, Owen T . Heisler, Kai-Heng Feng, linux-acpi,
	regressions, stable

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);
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children()
  2023-11-12 20:36 [PATCH 0/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
  2023-11-12 20:36 ` [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children() function Hans de Goede
@ 2023-11-12 20:36 ` Hans de Goede
  2023-11-12 22:35   ` kernel test robot
  2023-11-20 16:32 ` [PATCH 0/2] " Rafael J. Wysocki
  2 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2023-11-12 20:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: Hans de Goede, Owen T . Heisler, Kai-Heng Feng, linux-acpi,
	regressions, stable

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@owenh.net/
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),
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children()
  2023-11-12 20:36 ` [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
@ 2023-11-12 22:35   ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2023-11-12 22:35 UTC (permalink / raw)
  To: Hans de Goede; +Cc: stable, oe-kbuild-all

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#option-1

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

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children() function
  2023-11-12 20:36 ` [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children() function Hans de Goede
@ 2023-11-13 14:32   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2023-11-13 14:32 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Rafael J . Wysocki, Owen T . Heisler, Kai-Heng Feng, linux-acpi,
	regressions, stable

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] ACPI: video: Use acpi_device_fix_up_power_children()
  2023-11-12 20:36 [PATCH 0/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
  2023-11-12 20:36 ` [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children() function Hans de Goede
  2023-11-12 20:36 ` [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
@ 2023-11-20 16:32 ` Rafael J. Wysocki
  2 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2023-11-20 16:32 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Rafael J . Wysocki, Owen T . Heisler, Kai-Heng Feng, linux-acpi,
	regressions, stable

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@owenh.net/
> 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!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-20 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-12 20:36 [PATCH 0/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
2023-11-12 20:36 ` [PATCH 1/2] ACPI: PM: Add acpi_device_fix_up_power_children() function Hans de Goede
2023-11-13 14:32   ` Greg KH
2023-11-12 20:36 ` [PATCH 2/2] ACPI: video: Use acpi_device_fix_up_power_children() Hans de Goede
2023-11-12 22:35   ` kernel test robot
2023-11-20 16:32 ` [PATCH 0/2] " Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).