Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796316109; b=JdA0en5SGb78NwBPU+xm9zKx4kVAZtclGYFaCF7uzMfxo0knNG4GTjNRlwf6zeQW3b+t fW/uwEAO+tMNPS8AwjGsmIRy4840/ZmXHD7pBFNeAnS5eDZZvGl9ItlLU/jZVHEXGbQZq 3v592sPKtdUenubOTlhQDLtHi8lCMwmocF/A8EAq+kgB7bpfclMOk9yV+woU46iK/bsUS wMNpHHSHGvhjLo/h1NYfCiQHz4a7nGFZhuLEWjLW1WBtlqvUTkEZH1oQT6NNdcqBUjYqt 8G2x14ZBZyRwENCwawahtCs0F0wLzPmlmxhD74h8j4GM/QH0e0rgCDXs5tBBh8z5wPg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796316109; h=Received:DKIM-Signature:Received:From:Date:MIME-Version:Content-Type: Content-Transfer-Encoding:To:Message-ID:In-Reply-To:References: Subject:X-Bugzilla-Product:X-Bugzilla-Component:X-Mailer; bh=nPmJyeqA/ADXrdzgduSLk/kUF31805gSJlRIBQumTSU=; b=axtZsw7uWSD99imZzUl175wzbXdddwgGABnnGJJz8ZPiKnASLgbGPhlgMbL4a/g/wBWc 5etkkF54Byl2NGzbLiGKdsqSn+UL0j5vsYNt6LI/GlFiTan8sPhjt6vnnu1FNWBpQV+vf va+vYhcO3mqfh4bOM8/exJHZO8jJ6qECH9URu87ue/9wA6rxfWnLNmPXuWIufnkbMWxtK IOYPc1KrYbYg75LUKd2wjqlGJu1rDLooFDlI5QaCERFL0iy/zKLY+V9XK/4/bedmfPonU a0gATziE+dgUQEM7WXF1HqB+g89+EzT35kKg9mMtZLH1vSE13+6GRrRXBPeDjJ3d/yQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fVTI0SMr; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48D6E606A32C for ; Thu, 3 Dec 2026 16:41:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fVTI0SMr Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24A9F1F00896 for ; Thu, 3 Dec 2026 16:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796316109; bh=nPmJyeqA/ADXrdzgduSLk/kUF31805gSJlRIBQumTSU=; h=From:Date:To:In-Reply-To:References:Subject; b=fVTI0SMrCFwXsCHmzT9rK0NS740yTz/v6xdd4kW2xggXCJoIuh3IYVUe8jvwMflem 5PgRH9Lye0RezhGO/yoVXpbQlTzVNeYvXf6dpRsUjZ1tPsehSMj2IKhEMHTEp9xWZ6 7wwbBOsxTnYn/F/eamFtOqNpvz7y3Fhx2uN4W/J2EZycdz0T82nQuod18eeCaNuIff twupLuGOUK5sSCWlxZ/IgkXtQLAKTP9Db9VJBConzU2d02zXBON8TUVgrv2ParjU0V JXMqkE7V0I90FGee9zXaPWK56EW8vJTzicxJ+qYzpnmKNyz74gSXEb8cyTJ+czO6oi 0TN+qTDjV1f8g== Received: from [10.30.226.235] (localhost [IPv6:::1]) by aws-us-west-2-korg-oddjob-rhel9-1.codeaurora.org (Postfix) with ESMTP id 1CABB3805D97 for ; Thu, 3 Dec 2026 16:41:49 +0000 (UTC) From: Munique Feitoza via Bugspray Bot Date: Thu, 03 Dec 2026 16:41:39 +0000 X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: linux-gpio@vger.kernel.org Message-ID: <20261203-b222242c6-06d82dfa9167@bugzilla.kernel.org> In-Reply-To: <20261203-b222242c0-7291acd67c07@bugzilla.kernel.org> References: <20261203-b222242c0-7291acd67c07@bugzilla.kernel.org> Subject: Re: Spurious GPIO interrupt storm on AMD A520 / Ryzen 5 5500 (floating GPIO) X-Bugzilla-Product: Drivers X-Bugzilla-Component: GPIO/Pin Control X-Mailer: bugspray 0.1-dev 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)