amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: Add missing LPS0 functions for AMD
@ 2021-05-04 22:11 Alex Deucher
  2021-05-04 22:33 ` Limonciello, Mario
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2021-05-04 22:11 UTC (permalink / raw)
  To: amd-gfx, linux-acpi, rjw, lenb
  Cc: Shyam-sundar.S-k, Marcin Bachry, hdegoede, Prike.Liang,
	Mario Limonciello, Alex Deucher

These are supposedly not required for AMD platforms,
but at least some HP laptops seem to require it to
properly turn off the keyboard backlight.

Based on a patch from Marcin Bachry <hegel666@gmail.com>.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marcin Bachry <hegel666@gmail.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
---

Dropping patch 2/2 for now.  This patch fixes several
systems and doesn't appear to cause any issues.

 drivers/acpi/x86/s2idle.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 2b69536cdccb..2d7ddb8a8cb6 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
 
 /* AMD */
 #define ACPI_LPS0_DSM_UUID_AMD      "e3f32452-febc-43ce-9039-932122d37721"
+#define ACPI_LPS0_ENTRY_AMD         2
+#define ACPI_LPS0_EXIT_AMD          3
 #define ACPI_LPS0_SCREEN_OFF_AMD    4
 #define ACPI_LPS0_SCREEN_ON_AMD     5
 
@@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void)
 
 	if (acpi_s2idle_vendor_amd()) {
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD);
+		acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD);
 	} else {
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY);
@@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void)
 		return;
 
 	if (acpi_s2idle_vendor_amd()) {
+		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD);
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD);
 	} else {
 		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);
-- 
2.30.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] platform/x86: Add missing LPS0 functions for AMD
  2021-05-04 22:11 [PATCH] platform/x86: Add missing LPS0 functions for AMD Alex Deucher
@ 2021-05-04 22:33 ` Limonciello, Mario
  2021-05-05  9:00   ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Limonciello, Mario @ 2021-05-04 22:33 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx, linux-acpi, rjw, lenb
  Cc: hdegoede, Liang, Prike, S-k, Shyam-sundar, Marcin Bachry

[AMD Public Use]

> Subject: [PATCH] platform/x86: Add missing LPS0 functions for AMD

Rafael might be willing to fix it up on commit, but if you end up needing to re-spin
I think technically this subsystem prefix to match other stuff committed to this file
should be:

"ACPI: PM: s2idle:"

> 
> These are supposedly not required for AMD platforms,
> but at least some HP laptops seem to require it to
> properly turn off the keyboard backlight.
> 
> Based on a patch from Marcin Bachry <hegel666@gmail.com>.
> 
> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: Marcin Bachry <hegel666@gmail.com>
> Cc: Mario Limonciello <mario.limonciello@amd.com>
> ---
> 
> Dropping patch 2/2 for now.  This patch fixes several
> systems and doesn't appear to cause any issues.
> 
>  drivers/acpi/x86/s2idle.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
> index 2b69536cdccb..2d7ddb8a8cb6 100644
> --- a/drivers/acpi/x86/s2idle.c
> +++ b/drivers/acpi/x86/s2idle.c
> @@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
> 
>  /* AMD */
>  #define ACPI_LPS0_DSM_UUID_AMD      "e3f32452-febc-43ce-9039-
> 932122d37721"
> +#define ACPI_LPS0_ENTRY_AMD         2
> +#define ACPI_LPS0_EXIT_AMD          3
>  #define ACPI_LPS0_SCREEN_OFF_AMD    4
>  #define ACPI_LPS0_SCREEN_ON_AMD     5
> 
> @@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void)
> 
>  	if (acpi_s2idle_vendor_amd()) {
>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD);
> +		acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD);
>  	} else {
>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY);
> @@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void)
>  		return;
> 
>  	if (acpi_s2idle_vendor_amd()) {
> +		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD);
>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD);
>  	} else {
>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);
> --
> 2.30.2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] platform/x86: Add missing LPS0 functions for AMD
  2021-05-04 22:33 ` Limonciello, Mario
@ 2021-05-05  9:00   ` Hans de Goede
  2021-05-05 13:11     ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2021-05-05  9:00 UTC (permalink / raw)
  To: Limonciello, Mario, Deucher, Alexander, amd-gfx, linux-acpi, rjw, lenb
  Cc: Liang, Prike, S-k, Shyam-sundar, Marcin Bachry

Hi,

On 5/5/21 12:33 AM, Limonciello, Mario wrote:
> [AMD Public Use]
> 
>> Subject: [PATCH] platform/x86: Add missing LPS0 functions for AMD
> 
> Rafael might be willing to fix it up on commit, but if you end up needing to re-spin
> I think technically this subsystem prefix to match other stuff committed to this file
> should be:
> 
> "ACPI: PM: s2idle:"

Ack, please get the subject next right time. I was about the put this in a folder
with patches to apply to the pdx86 kernel tree once 5.13-rc1 is out, but this
should not go upstream through the pdx86 tree at all.

Regards,

Hans



> 
>>
>> These are supposedly not required for AMD platforms,
>> but at least some HP laptops seem to require it to
>> properly turn off the keyboard backlight.
>>
>> Based on a patch from Marcin Bachry <hegel666@gmail.com>.
>>
>> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> Cc: Marcin Bachry <hegel666@gmail.com>
>> Cc: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>
>> Dropping patch 2/2 for now.  This patch fixes several
>> systems and doesn't appear to cause any issues.
>>
>>  drivers/acpi/x86/s2idle.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
>> index 2b69536cdccb..2d7ddb8a8cb6 100644
>> --- a/drivers/acpi/x86/s2idle.c
>> +++ b/drivers/acpi/x86/s2idle.c
>> @@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
>>
>>  /* AMD */
>>  #define ACPI_LPS0_DSM_UUID_AMD      "e3f32452-febc-43ce-9039-
>> 932122d37721"
>> +#define ACPI_LPS0_ENTRY_AMD         2
>> +#define ACPI_LPS0_EXIT_AMD          3
>>  #define ACPI_LPS0_SCREEN_OFF_AMD    4
>>  #define ACPI_LPS0_SCREEN_ON_AMD     5
>>
>> @@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void)
>>
>>  	if (acpi_s2idle_vendor_amd()) {
>>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD);
>> +		acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD);
>>  	} else {
>>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
>>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY);
>> @@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void)
>>  		return;
>>
>>  	if (acpi_s2idle_vendor_amd()) {
>> +		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD);
>>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD);
>>  	} else {
>>  		acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);
>> --
>> 2.30.2
> 

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] platform/x86: Add missing LPS0 functions for AMD
  2021-05-05  9:00   ` Hans de Goede
@ 2021-05-05 13:11     ` Alex Deucher
  2021-05-05 13:14       ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2021-05-05 13:11 UTC (permalink / raw)
  To: Hans de Goede
  Cc: S-k, Shyam-sundar, rjw, Marcin Bachry, amd-gfx, linux-acpi,
	Liang, Prike, Limonciello, Mario, Deucher, Alexander, lenb

On Wed, May 5, 2021 at 9:10 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 5/5/21 12:33 AM, Limonciello, Mario wrote:
> > [AMD Public Use]
> >
> >> Subject: [PATCH] platform/x86: Add missing LPS0 functions for AMD
> >
> > Rafael might be willing to fix it up on commit, but if you end up needing to re-spin
> > I think technically this subsystem prefix to match other stuff committed to this file
> > should be:
> >
> > "ACPI: PM: s2idle:"
>
> Ack, please get the subject next right time. I was about the put this in a folder
> with patches to apply to the pdx86 kernel tree once 5.13-rc1 is out, but this
> should not go upstream through the pdx86 tree at all.

Do you want me to resend with the corrected subject?  What tree does
this need to go through?

Alex

>
> Regards,
>
> Hans
>
>
>
> >
> >>
> >> These are supposedly not required for AMD platforms,
> >> but at least some HP laptops seem to require it to
> >> properly turn off the keyboard backlight.
> >>
> >> Based on a patch from Marcin Bachry <hegel666@gmail.com>.
> >>
> >> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230
> >> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> >> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> >> Cc: Marcin Bachry <hegel666@gmail.com>
> >> Cc: Mario Limonciello <mario.limonciello@amd.com>
> >> ---
> >>
> >> Dropping patch 2/2 for now.  This patch fixes several
> >> systems and doesn't appear to cause any issues.
> >>
> >>  drivers/acpi/x86/s2idle.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >>
> >> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
> >> index 2b69536cdccb..2d7ddb8a8cb6 100644
> >> --- a/drivers/acpi/x86/s2idle.c
> >> +++ b/drivers/acpi/x86/s2idle.c
> >> @@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
> >>
> >>  /* AMD */
> >>  #define ACPI_LPS0_DSM_UUID_AMD      "e3f32452-febc-43ce-9039-
> >> 932122d37721"
> >> +#define ACPI_LPS0_ENTRY_AMD         2
> >> +#define ACPI_LPS0_EXIT_AMD          3
> >>  #define ACPI_LPS0_SCREEN_OFF_AMD    4
> >>  #define ACPI_LPS0_SCREEN_ON_AMD     5
> >>
> >> @@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void)
> >>
> >>      if (acpi_s2idle_vendor_amd()) {
> >>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD);
> >> +            acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD);
> >>      } else {
> >>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
> >>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY);
> >> @@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void)
> >>              return;
> >>
> >>      if (acpi_s2idle_vendor_amd()) {
> >> +            acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD);
> >>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD);
> >>      } else {
> >>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);
> >> --
> >> 2.30.2
> >
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] platform/x86: Add missing LPS0 functions for AMD
  2021-05-05 13:11     ` Alex Deucher
@ 2021-05-05 13:14       ` Hans de Goede
  0 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2021-05-05 13:14 UTC (permalink / raw)
  To: Alex Deucher
  Cc: S-k, Shyam-sundar, rjw, Marcin Bachry, amd-gfx, linux-acpi,
	Liang, Prike, Limonciello, Mario, Deucher, Alexander, lenb

Hi,

On 5/5/21 3:11 PM, Alex Deucher wrote:
> On Wed, May 5, 2021 at 9:10 AM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Hi,
>>
>> On 5/5/21 12:33 AM, Limonciello, Mario wrote:
>>> [AMD Public Use]
>>>
>>>> Subject: [PATCH] platform/x86: Add missing LPS0 functions for AMD
>>>
>>> Rafael might be willing to fix it up on commit, but if you end up needing to re-spin
>>> I think technically this subsystem prefix to match other stuff committed to this file
>>> should be:
>>>
>>> "ACPI: PM: s2idle:"
>>
>> Ack, please get the subject next right time. I was about the put this in a folder
>> with patches to apply to the pdx86 kernel tree once 5.13-rc1 is out, but this
>> should not go upstream through the pdx86 tree at all.
> 
> Do you want me to resend with the corrected subject?  What tree does
> this need to go through?

That might be helpful, I think that like how to subject made me
think "Oh I need to pick this one up" it will probably to the
opposite for Rafael.

It should go through Rafael's ACPI/PM tree:

[hans@x1 linux]$ scripts/get_maintainer.pl -f drivers/acpi/x86/s2idle.c
"Rafael J. Wysocki" <rjw@rjwysocki.net> (supporter:ACPI)
Len Brown <lenb@kernel.org> (supporter:ACPI)
linux-acpi@vger.kernel.org (open list:ACPI)
linux-kernel@vger.kernel.org (open list)

Regards,

Hans



>>>> These are supposedly not required for AMD platforms,
>>>> but at least some HP laptops seem to require it to
>>>> properly turn off the keyboard backlight.
>>>>
>>>> Based on a patch from Marcin Bachry <hegel666@gmail.com>.
>>>>
>>>> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230
>>>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>> Cc: Marcin Bachry <hegel666@gmail.com>
>>>> Cc: Mario Limonciello <mario.limonciello@amd.com>
>>>> ---
>>>>
>>>> Dropping patch 2/2 for now.  This patch fixes several
>>>> systems and doesn't appear to cause any issues.
>>>>
>>>>  drivers/acpi/x86/s2idle.c | 4 ++++
>>>>  1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
>>>> index 2b69536cdccb..2d7ddb8a8cb6 100644
>>>> --- a/drivers/acpi/x86/s2idle.c
>>>> +++ b/drivers/acpi/x86/s2idle.c
>>>> @@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
>>>>
>>>>  /* AMD */
>>>>  #define ACPI_LPS0_DSM_UUID_AMD      "e3f32452-febc-43ce-9039-
>>>> 932122d37721"
>>>> +#define ACPI_LPS0_ENTRY_AMD         2
>>>> +#define ACPI_LPS0_EXIT_AMD          3
>>>>  #define ACPI_LPS0_SCREEN_OFF_AMD    4
>>>>  #define ACPI_LPS0_SCREEN_ON_AMD     5
>>>>
>>>> @@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void)
>>>>
>>>>      if (acpi_s2idle_vendor_amd()) {
>>>>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD);
>>>> +            acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD);
>>>>      } else {
>>>>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
>>>>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY);
>>>> @@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void)
>>>>              return;
>>>>
>>>>      if (acpi_s2idle_vendor_amd()) {
>>>> +            acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD);
>>>>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD);
>>>>      } else {
>>>>              acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);
>>>> --
>>>> 2.30.2
>>>
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-05-05 13:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 22:11 [PATCH] platform/x86: Add missing LPS0 functions for AMD Alex Deucher
2021-05-04 22:33 ` Limonciello, Mario
2021-05-05  9:00   ` Hans de Goede
2021-05-05 13:11     ` Alex Deucher
2021-05-05 13:14       ` Hans de Goede

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).