Re: [PATCH] pinctrl-amd: Don't clear S4 wake bits at probe

Linus Walleij <[email protected]>
Newsgroups org.kernel.vger.linux-gpio
Message-ID <CAD++jLnE0ProBMC67fE4JbU0W3Uau_AdLkby8D=FoqNPU6huaw@mail.gmail.com>
On Mon, Jul 20, 2026 at 6:29 PM Mario Limonciello
<[email protected]> wrote:

> commit 6bc3462a0f5e ("pinctrl: amd: Mask wake bits on probe again")
> introduced a regression where Wake-on-LAN no longer works after suspend
> or shutdown on some AMD platforms.
>
> Firmware-programmed S4 wake bits for devices like PCIe NICs using PCI
> PME are cleared at probe, but nothing restores them. Unlike S0i3/S3 wake
> sources that use enable_irq_wake() -> amd_gpio_irq_set_wake(), PCIe PME
> does not use GPIO IRQ infrastructure and relies on firmware configuration.
>
> The original intent of commit 6bc3462a0f5e ("pinctrl: amd: Mask wake
> bits on probe again") was to clear spurious wake bits left by firmware
> to prevent unwanted wakeups. However, S4 wake bits are used for
> hardware-level wake sources like WoL that bypass the kernel's IRQ wake
> API.
>
> Fix by preserving S4 wake bits at probe and only clearing S0i3/S3 bits:
> - Firmware-configured S4 wake sources (WoL) continue working
> - Kernel maintains control of S3/S0i3 wake policy via set_wake()
> - S3-only wake sources work correctly per commit f31f33dbb3ba ("pinctrl:
>   amd: Take suspend type into consideration which pins are non-wake")
>
> The trade-off is that firmware-programmed spurious S4 wake bits remain
> set, but this is less problematic than breaking WoL.
>
> Fixes: 6bc3462a0f5e ("pinctrl: amd: Mask wake bits on probe again")
> Signed-off-by: Mario Limonciello <[email protected]>

Patch applied for fixes, thanks for always fixing these
issues Mario!

Yours,
Linus Walleij
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.