mbox series

[0/2,SRU,OEM-5.14,U] Fix power button wakeup with shared IRQs on AMD platforms

Message ID 20211208211459.1358692-1-alex.hung@canonical.com
Headers show
Series Fix power button wakeup with shared IRQs on AMD platforms | expand

Message

Alex Hung Dec. 8, 2021, 9:14 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1953540

[Impact]
 On some platform designs the the power button wakeup from s0i3 doesn't work
 even with the existing changes to IRQ handling for the GPIO controller.

 In these designs the ACPI SCI and GPIO controller share an IRQ. Due to the
 way the s2idle loop handles the IRQ for the ACPI SCI the GPIO controller
 driver doesn't get a chance to wake the system in this circumstance.

[Fix]
 To fix this rework the existing IRQ handler function to function as a checker
 and an IRQ handler depending on the calling arguments.

 The patches were cherry-picked from 5.16rc3.

[Test]
 This is requested by AMD. The test was done on two systems L15 AMD Gen2 and
 P14s AMD Gen2 and both can be waken up by power button presses.

[Where problems could occur]
 Risk is low. This only affects AMD platforms with s0i3 enabled. Suspends (S3)
 and resumes are not affect.

Mario Limonciello (2):
  ACPI: Add stubs for wakeup handler functions
  pinctrl: amd: Fix wakeups when IRQ is shared with SCI

 drivers/pinctrl/pinctrl-amd.c | 29 ++++++++++++++++++++++++++---
 include/linux/acpi.h          |  9 +++++++++
 2 files changed, 35 insertions(+), 3 deletions(-)

Comments

Timo Aaltonen Dec. 13, 2021, 1:06 p.m. UTC | #1
On 8.12.2021 23.14, Alex Hung wrote:
> BugLink: https://bugs.launchpad.net/bugs/1953540
> 
> [Impact]
>   On some platform designs the the power button wakeup from s0i3 doesn't work
>   even with the existing changes to IRQ handling for the GPIO controller.
> 
>   In these designs the ACPI SCI and GPIO controller share an IRQ. Due to the
>   way the s2idle loop handles the IRQ for the ACPI SCI the GPIO controller
>   driver doesn't get a chance to wake the system in this circumstance.
> 
> [Fix]
>   To fix this rework the existing IRQ handler function to function as a checker
>   and an IRQ handler depending on the calling arguments.
> 
>   The patches were cherry-picked from 5.16rc3.
> 
> [Test]
>   This is requested by AMD. The test was done on two systems L15 AMD Gen2 and
>   P14s AMD Gen2 and both can be waken up by power button presses.
> 
> [Where problems could occur]
>   Risk is low. This only affects AMD platforms with s0i3 enabled. Suspends (S3)
>   and resumes are not affect.
> 
> Mario Limonciello (2):
>    ACPI: Add stubs for wakeup handler functions
>    pinctrl: amd: Fix wakeups when IRQ is shared with SCI
> 
>   drivers/pinctrl/pinctrl-amd.c | 29 ++++++++++++++++++++++++++---
>   include/linux/acpi.h          |  9 +++++++++
>   2 files changed, 35 insertions(+), 3 deletions(-)
> 

applied to oem-5.14, thanks
Andrea Righi Dec. 16, 2021, 7:32 a.m. UTC | #2
On Wed, Dec 08, 2021 at 02:14:57PM -0700, Alex Hung wrote:
> BugLink: https://bugs.launchpad.net/bugs/1953540
> 
> [Impact]
>  On some platform designs the the power button wakeup from s0i3 doesn't work
>  even with the existing changes to IRQ handling for the GPIO controller.
> 
>  In these designs the ACPI SCI and GPIO controller share an IRQ. Due to the
>  way the s2idle loop handles the IRQ for the ACPI SCI the GPIO controller
>  driver doesn't get a chance to wake the system in this circumstance.
> 
> [Fix]
>  To fix this rework the existing IRQ handler function to function as a checker
>  and an IRQ handler depending on the calling arguments.
> 
>  The patches were cherry-picked from 5.16rc3.
> 
> [Test]
>  This is requested by AMD. The test was done on two systems L15 AMD Gen2 and
>  P14s AMD Gen2 and both can be waken up by power button presses.
> 
> [Where problems could occur]
>  Risk is low. This only affects AMD platforms with s0i3 enabled. Suspends (S3)
>  and resumes are not affect.

Applied only [PATCH 2/2] to jammy:linux, [PATCH 1/1] was already applied
via stable updates.

Thanks,
-Andrea