Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Linus Walleij <linusw@kernel.org>
Cc: Basavaraj.Natikar@amd.com, Shyam-sundar.S-k@amd.com,
	Olzhas Marat <marat.olzhas@gmail.com>,
	stable@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: amd: Clear S4 wake bits when firmware has _AEI
Date: Wed, 7 Oct 2026 14:24:52 -0500	[thread overview]
Message-ID: <b54f6026-b65f-499a-9513-3abfaed97f2b@amd.com> (raw)
In-Reply-To: <CAD++jLnO6QuphZwOiT9kYpn=CiPFiQfxj9bdbDw08d=GdAhD=Q@mail.gmail.com>



On 10/7/26 06:27, Linus Walleij wrote:
> On Mon, Oct 5, 2026 at 8:02 PM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
> 
>> Commit ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe")
>> preserves firmware-programmed S4 wake sources because some PCIe devices
>> rely on them for Wake-on-LAN. The system that motivated that change does
>> not expose ACPI GPIO events through _AEI.
>>
>> On a Chuwi CoreBook Plus, firmware exposes _AEI but also leaves the S4/S5
>> wake bit set for GPIO 24. This causes the machine to power back on
>> immediately after shutdown even though Wake-on-LAN is not enabled.
>>
>> GPIO register dumps show that the only relevant difference is bit 15 on
>> GPIO 24. Clearing that bit makes the machine remain off. GPIO 24 is not
>> itself listed in _AEI, so _AEI is not a per-pin indication of which pins
>> the OS manages; it is a platform level signal of which wake model the
>> firmware follows.
>>
>> Use that signal to decide what to clear. Continue clearing S0i3/S3 bits on
>> every system. Clear S4 bits when firmware exposes _AEI, indicating that the
>> platform hands GPIO events to the OS, but preserve S4 bits when _AEI is
>> absent so that firmware-programmed sources such as PCIe PME that bypass the
>> GPIO IRQ wake API keep working.
>>
>> A platform that exposes _AEI for some pins while routing a wake capable
>> device through a raw GPIO not listed in _AEI would lose that wake source
>> unless firmware re-arms it during the sleep transition. No such system has
>> been reported.
>>
>> Fixes: ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe")
>> Reported-by: Olzhas Marat <marat.olzhas@gmail.com>
>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222041
>> Cc: stable@vger.kernel.org
>> Tested-by: Olzhas Marat <marat.olzhas@gmail.com>
>> Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> 
> Patch applied for fixes.
> 
> Yours,
> Linus Walleij

Thanks!

Next cycle I'll send out a change to drop the #ifdef CONFIG_ACPI (there 
is a change in linux-next that adds a stub).

      reply	other threads:[~2026-10-07 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 18:01 [PATCH v2] pinctrl: amd: Clear S4 wake bits when firmware has _AEI Mario Limonciello
2026-10-07 11:27 ` Linus Walleij
2026-10-07 19:24   ` Mario Limonciello [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b54f6026-b65f-499a-9513-3abfaed97f2b@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=marat.olzhas@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox