From nobody Sat Jun 13 06:06:38 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C90F31F4C96; Sat, 9 May 2026 12:17:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778329069; cv=none; b=hyLF1z5uhTxTKP1olB8v+2q9xRIBIgSFGV40xMyo1hWJNVMxMo/wVVwvWeBzYlyiG/DYzhR7HdGW6dYcXrxIe8cXrowwUBVuo1xbskk9LtOs37/CrJ4CJ5ES20XWoq12r05ihvIyT7+E81TtuBfVBc43kNnqKDMmTeZw69vVVcQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778329069; c=relaxed/simple; bh=aDPkwUp4pYWvUND8tW1IfaLH2ItaEiRIZ1lGDFKsO7o=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=RvGp5ISKDTwcUhebUUMVjJsg3CA9+h/XfuRMnfLk1TPxeUjqGBBv4KYM4en8Mopot8mVnbeVvMOjTII2pWy6bKrlLif5MKv/lX9KZC64RZNUnEWkteyM96GYEdKzVi6QfPjSr5AucUXNPk8qxwkPYgv5vDR2OaVVBzdE1ZMaGHQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=LSvrDWvm; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="LSvrDWvm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=S9 EEv97wazfBbBhdHVjiBEW1+/VV0NUuK2gicyUD6Jc=; b=LSvrDWvmvtd1x7aguc ZZRrSy2ROaOerip4pYohY43vEZwko33FX1kZcgd4iz/Ox94WT/WqDxHF7/ChB8U9 NpksSOni2EaTfi0AhNAES9O/4T64rsnSuDrhioy3ebPn5YqeGhEVZm932VFmlxKO WDOKPptZw3RKCftAnWTuBODCQ= Received: from wmy.localdomain (unknown []) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wAH+4u5Jf9p6KORAQ--.12465S2; Sat, 09 May 2026 20:17:09 +0800 (CST) From: w15303746062@163.com To: wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Mingyu Wang <25181214217@stu.xidian.edu.cn> Subject: [PATCH] watchdog: wdt_pci: Fix shared IRQ storm and complete system lockup Date: Sat, 9 May 2026 20:16:55 +0800 Message-Id: <20260509121655.275311-1-w15303746062@163.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wAH+4u5Jf9p6KORAQ--.12465S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uFyDZryUuryxKrWkur18uFg_yoW8CF45pa yUKayav3Z8tFW8Kw17u3Z2vrWrCw4fXrW3Cryvyws5Aw15t34Fvr4SkFyjgry5CrZxJa1Y yF1Uta48uay5ZFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jryCJUUUUU= X-CM-SenderInfo: jzrvjiatxuliiws6il2tof0z/xtbC-wXUuGn-JcWYnQAA3l Content-Type: text/plain; charset="utf-8" From: Mingyu Wang <25181214217@stu.xidian.edu.cn> The wdt_pci driver registers its interrupt handler with the IRQF_SHARED flag. However, the interrupt handler wdtpci_interrupt() fails to check whether the interrupt actually originated from the watchdog device. If another device on the same shared IRQ line (e.g., an I2C controller) triggers an interrupt, wdtpci_interrupt() will erroneously process it, blindly log hardware status (e.g., "Reset in 5ms") to the console, and unconditionally return IRQ_HANDLED. This behavior defeats the kernel's spurious interrupt detector. Under heavy load from other devices sharing the IRQ, it causes a severe printk storm and keeps the CPU trapped in hard IRQ context. This eventually leads to a complete system lockup and RCU/Hung Task panics. Fix this by checking the WDC_SR_IRQ bit (which is active low) in the status register. If the bit is high, the interrupt is not ours, and we must release the lock and return IRQ_NONE immediately. Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn> --- drivers/watchdog/wdt_pci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c index 3918a600f2a0..a35ac064b690 100644 --- a/drivers/watchdog/wdt_pci.c +++ b/drivers/watchdog/wdt_pci.c @@ -304,6 +304,17 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev= _id) spin_lock(&wdtpci_lock); =20 status =3D inb(WDT_SR); + /* + * The WDT500/501 supports shared interrupts (IRQF_SHARED). + * We must check if the interrupt was generated by this device. + * WDC_SR_IRQ is active low, so if it is set (1), the interrupt + * belongs to another device on the shared line. + */ + if (status & WDC_SR_IRQ) { + spin_unlock(&wdtpci_lock); + return IRQ_NONE; + } + udelay(8); =20 pr_crit("status %d\n", status); --=20 2.34.1