All of lore.kernel.org
 help / color / mirror / Atom feed
From: Munique Feitoza via Bugspray Bot <bugbot@kernel.org>
To: linux-gpio@vger.kernel.org
Subject: Re: Spurious GPIO interrupt storm on AMD A520 / Ryzen 5 5500 (floating GPIO)
Date: Thu, 03 Dec 2026 16:41:39 +0000	[thread overview]
Message-ID: <20261203-b222242c6-06d82dfa9167@bugzilla.kernel.org> (raw)
In-Reply-To: <20261203-b222242c0-7291acd67c07@bugzilla.kernel.org>

Munique Feitoza writes via Kernel.org Bugzilla:

Hi Mario,

Looking closely at the captured dump (STATUS_REG1 = 0x1f000000, MASTER = 0xff000000) and the driver implementation in pinctrl-amd.c, I noticed a couple of structural issues that explain why this storm is unhandled:

Status bits masking out-of-bounds: In do_amd_gpio_irq_handler():

´´´
/* Bit 0-45 contain the relevant status bits */
status &= (1ULL << 46) - 1;
´´´

STATUS_REG1 = 0x1f000000 has bits 24–28 set, which correspond to bits 56–60 of the 64-bit status value. Since the driver masks status &= (1ULL << 46) - 1;, these bits are discarded before the loop. The loop never inspects them and treats the event as having 0 pins active, returning ret = false without clearing or acknowledging the condition. These higher bits correspond to Bank 3 pins (AMD_GPIO_PINS_BANK3 = 32 pins, covering pins 192–223) or extended status lines that the current loop simply overlooks.

Spurious handling should acknowledge the event: When a spurious or unmapped status bit asserts, returning ret = false causes note_interrupt() in the core IRQ subsystem to increment the unhandled counter until it hits 100,000/200,000 and forces Disabling IRQ #7. If the driver silences or disables an unconfigured line (and properly clears both INTERRUPT_MASK_OFF and INTERRUPT_ENABLE_OFF), acknowledging the event (ret = true / EOI) prevents the core kernel from treating it as an unhandled storm.

Would expanding the status loop mask beyond bit 45 to cover Bank 3 and ensuring unhandled/orphan status bits in WAKE_INT_STATUS_REG1 are properly acknowledged/cleared be the right direction for a fix?

Do you foresee any potential regressions or side effects on older AMD hardware generations with this change (e.g., platforms that do not implement Bank 3)?

I would love to actively participate in writing, iterating, and testing this patch series and contribute further to the AMD pinctrl driver. Please let me know how you'd like to proceed!

Best regards,
Munique

View: https://bugzilla.kernel.org/show_bug.cgi?id=222242#c6
You can reply to this message to join the discussion.
-- 
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)


  parent reply	other threads:[~2026-12-03 16:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 16:41 Spurious GPIO interrupt storm on AMD A520 / Ryzen 5 5500 (floating GPIO) Munique Feitoza via Bugspray Bot
2026-12-03 16:41 ` Mario Limonciello (AMD) via Bugspray Bot
2026-12-03 16:41 ` Munique Feitoza via Bugspray Bot
2026-12-03 16:41 ` Munique Feitoza via Bugspray Bot
2026-12-03 16:41 ` Mario Limonciello (AMD) via Bugspray Bot
2026-12-03 16:41 ` Munique Feitoza via Bugspray Bot
2026-12-03 16:41 ` Munique Feitoza via Bugspray Bot [this message]
2026-12-03 16:41 ` Mario Limonciello (AMD) via Bugspray Bot
2026-12-03 16:41 ` Munique Feitoza via Bugspray Bot

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=20261203-b222242c6-06d82dfa9167@bugzilla.kernel.org \
    --to=bugbot@kernel.org \
    --cc=linux-gpio@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.