From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Tj <tj.iam.tj@proton.me>
Cc: Hans de Goede <hansg@kernel.org>,
"metux IT consult\"" <info@metux.net>,
platform-driver-x86@vger.kernel.org,
Bartosz Golaszewski <brgl@kernel.org>
Subject: Re: pcengines_apuv2: LEDs/Input fails since v6.18
Date: Tue, 17 Feb 2026 09:29:10 -0800 [thread overview]
Message-ID: <aZSkqGTqMp_57qC7@google.com> (raw)
In-Reply-To: <54082217-0eff-49f6-b4f1-0daed58c2568@proton.me>
On Tue, Feb 17, 2026 at 03:25:01PM +0000, Tj wrote:
> On 17/02/2026 11:42, Hans de Goede wrote:
> > On 16-Feb-26 20:01, Tj wrote:
> >> Installed v6.19 recently and realised the heartbeat/network LED
> >> configuration I'd set wasn't working. Checking the log I see:
> >>
> >> kernel: platform gpio-keys-polled: deferred probe pending:
> >> gpio-keys-polled: failed to get gpio
> >> kernel: platform leds-gpio: deferred probe pending: leds-gpio: Failed to
> >> get GPIO 'apu2-leds/led-1'
> >>
> >> Looking through commits I found b8754092dfed4fc2fc
> >>
> >> platform/x86: pcengines-apuv2: Use static device properties
> >>
> >> After reverting it the LEDs operate as expected. This entered in v6.18
> >> so will affect it as well.
> >>
> >> In v6.17 I see:
> >>
> >> kernel: platform gpio-keys-polled: deferred probe pending:
> >> gpio-keys-polled: unable to claim gpio 0
> >>
> >> that is a slight variation on the v6.19 report. I've not pin-pointed the
> >> cause yet.
> > This should be fixed by this patch:
> >
> > https://lore.kernel.org/linux-gpio/20260211085313.16792-1-bartosz.golaszewski@oss.qualcomm.com/
> >
> > If possible, please give a kernel with that patch added a spin
> > and confirm if it fixes things.
>
> It fixes the LED issue but causes massive log spamming (10's per second)
> related to the gpio-keys-polled:
>
> [ 0.000000] Linux version 6.19.2+debian+tj (linux@iam.tj) (gcc
> (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #404
> SMP PREEMPT_DYNAMIC Tue Feb 17 14:19:16 UTC 2026
> ...
> [ 0.000000] DMI: PC Engines apu2/apu2, BIOS v4.19.0.1 01/31/2023
> ...
> [ 6.025741] input: gpio-keys-polled as
> /devices/platform/gpio-keys-polled/input/input0
> [ 6.035231] gpio-keys-polled gpio-keys-polled: failed to get gpio
> state: -52
> ...
> [ 19.545273] input: Power Button as
> /devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
> ...
> [ 21.742226] input: PC Speaker as /devices/platform/pcspkr/input/input2
> ...
> [ OK ] Started dbus.service - D-Bus System Message Bus.
> [ OK ] Finished e2scrub_reap.service - Re…line ext4 Metadata Check
> Snapshots.
> [ OK ] Started virtlockd.service - libvirt locking daemon.
> [ OK ] Started 819142] gpio 32.-keys-polled gpio 32.-keys-polled:
> failed to get gpio 32. state: -52
> 1;39msystemd-machined.service -…and Container Registration Service.
> [ OK ] Started systemd-logind.service - User Login Management.
> [ 32.930711] gpio-keys-polled gpio-keys-polled: failed to get gpio
> state: -52
> [ OK ] Finished grub2-common.service - Record successful boot for GRUB.
> [ 33.050784] gpio-keys-polled gpio-keys-polled: failed to get gpio
> state: -52
> [ OK ] Started polkit.service - Authorization Manager.
> Starting ModemManager.service - Modem Manager...
> [ OK ] Started virtlogd.service - libvirt logging daemon.
> [ 33.158927] gpio-keys-polled gpio-keys-polled: failed to get gpio
> state: -52
I think the patch below should fix it.
Bartosz, I think you should revert
86ef402d805d606a10e6da8e5a64a51f6f5fb7e2 until after you audit all
existing gpio drivers. Breakign the kernel like that is not great.
Thanks.
--
Dmitry
diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
index e6c6c3ec7656..9f329938202b 100644
--- a/drivers/gpio/gpio-amd-fch.c
+++ b/drivers/gpio/gpio-amd-fch.c
@@ -8,6 +8,7 @@
*
*/
+#include <linux/bitfield.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
@@ -120,15 +121,15 @@ static int amd_fch_gpio_get(struct gpio_chip *gc,
unsigned int offset)
{
unsigned long flags;
- int ret;
+ u32 val;
struct amd_fch_gpio_priv *priv = gpiochip_get_data(gc);
void __iomem *ptr = amd_fch_gpio_addr(priv, offset);
spin_lock_irqsave(&priv->lock, flags);
- ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_READ);
+ val = readl_relaxed(ptr);
spin_unlock_irqrestore(&priv->lock, flags);
- return ret;
+ return FIELD_GET(AMD_FCH_GPIO_FLAG_READ, val);
}
static int amd_fch_gpio_request(struct gpio_chip *chip,
next prev parent reply other threads:[~2026-02-17 17:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 19:01 pcengines_apuv2: LEDs/Input fails since v6.18 Tj
2026-02-17 11:42 ` Hans de Goede
2026-02-17 15:25 ` Tj
2026-02-17 17:29 ` Dmitry Torokhov [this message]
2026-02-17 19:34 ` Tj
2026-02-18 9:55 ` Bartosz Golaszewski
2026-02-18 17:25 ` Dmitry Torokhov
2026-02-18 19:36 ` Dmitry Torokhov
2026-02-18 20:21 ` Bartosz Golaszewski
2026-02-18 21:04 ` Dmitry Torokhov
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=aZSkqGTqMp_57qC7@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=brgl@kernel.org \
--cc=hansg@kernel.org \
--cc=info@metux.net \
--cc=platform-driver-x86@vger.kernel.org \
--cc=tj.iam.tj@proton.me \
/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