From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: westeri@kernel.org, andriy.shevchenko@linux.intel.com,
linusw@kernel.org, brgl@kernel.org, bentiss@kernel.org,
hansg@kernel.org,
Francesco Lauritano <francesco.lauritano1@protonmail.com>,
Marco Scardovi <mscardovi95@gmail.com>,
Armin Wolf <W_Armin@gmx.de>,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH] gpiolib: acpi: Only trigger ActiveBoth interrupts on boot
Date: Wed, 29 Apr 2026 07:32:11 +0200 [thread overview]
Message-ID: <20260429053211.GA557136@black.igk.intel.com> (raw)
In-Reply-To: <20260429025247.1372984-1-mario.limonciello@amd.com>
On Tue, Apr 28, 2026 at 09:52:39PM -0500, Mario Limonciello wrote:
> Commit ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at
> least once on boot") introduced logic to trigger edge-based GPIO
> interrupts during initialization to ensure proper initial state setup
> when firmware doesn't initialize it.
>
> However, according to the Microsoft GPIO documentation, triggering GPIO
> interrupts during initialization should only happen for interrupts
> marked as ActiveBoth (both IRQF_TRIGGER_RISING and IRQF_TRIGGER_FALLING)
> and only when the associated GPIO line is already asserted (logic level
> low).
>
> The current implementation incorrectly triggers:
> 1. Any edge-triggered interrupt (RISING-only or FALLING-only)
> 2. RISING interrupts when value is high and FALLING when value is low
>
> This causes problems at bootup for single-edge interrupts that
> don't follow the ActiveBoth pattern.
>
> Fix this by:
> - Only triggering when BOTH rising and falling edges are configured
> - Only triggering when the GPIO line is asserted (value == 0)
>
> Reported-by: Francesco Lauritano <francesco.lauritano1@protonmail.com>
> Closes: https://lore.kernel.org/all/6iFCwGH2vssb7NRUTWGpkubGMNbgIlBHSz40z8ZsezjxngXpoiiRiJaijviNvhiDAGIr43bfUmdxLmxYoHDjyft4DgwFc3Pnu5hzPguTa0s=@protonmail.com/
> Tested-by: Marco Scardovi <mscardovi95@gmail.com>
> Fixes: ca876c7483b69 ("gpiolib-acpi: make sure we trigger edge events at least once on boot")
> Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/general-purpose-i-o--gpio-
> Suggested-by: Armin Wolf <W_Armin@gmx.de>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
next prev parent reply other threads:[~2026-04-29 5:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 2:52 [PATCH] gpiolib: acpi: Only trigger ActiveBoth interrupts on boot Mario Limonciello
2026-04-29 5:32 ` Mika Westerberg [this message]
2026-04-29 7:19 ` Andy Shevchenko
2026-04-29 7:09 ` Andy Shevchenko
2026-04-29 7:19 ` Andy Shevchenko
2026-04-29 9:48 ` Hans de Goede
2026-04-29 10:24 ` Andy Shevchenko
2026-04-29 11:01 ` Hans de Goede
2026-05-03 14:18 ` Marco Scardovi
2026-05-04 6:33 ` Andy Shevchenko
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=20260429053211.GA557136@black.igk.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=W_Armin@gmx.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bentiss@kernel.org \
--cc=brgl@kernel.org \
--cc=francesco.lauritano1@protonmail.com \
--cc=hansg@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mscardovi95@gmail.com \
--cc=westeri@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