From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E619CC43458 for ; Thu, 9 Jul 2026 10:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:To:From:Subject: Message-Id:Date:Mime-Version:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QB7UYwWpXJ2VF2wI2P3SEZEtL5EXtddCOvjxtFprtRk=; b=H9l0jg6LVzyXF+ LTys81zK1St9WZCWDpF9XSqGmaiOIDIHPV13c9tsjlAsUjwdycp8SzBwSAEgnZUgNwgfBd0C2cSTY lUEpWcngZJ5ezUPMiLXtHvp1SrDgt/TWczrTpADc934q0AW799/Eu1/4Yu39VpGs+kFwc844mDkIM WBp+m70RnpB/jw0+x7Ys47cxv1G/eLRJdatOk08beu+shzy4AIfKnUdcbP9cQPJLFFhCpMEvfVdzO GEuQLHQMXA/6YjjLCodt2EEXJwijTMyHDllQHiW0y5971RwG3daJunuOgyrxj528FokQDLi5DVr3O XNzoVW5BhNESxUDwl/2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1whloM-00000001vB5-3Zt0; Thu, 09 Jul 2026 10:16:54 +0000 Received: from smtpbgeu1.qq.com ([52.59.177.22]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1whloG-00000001v76-2xOx for linux-riscv@lists.infradead.org; Thu, 09 Jul 2026 10:16:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.spacemit.com; s=mxsw2412; t=1783592181; bh=8ks8tS9iyPaEvRnuaY3eiQzZv5LiwGa2iyJl74LOtow=; h=Mime-Version:Date:Message-Id:Subject:From:To; b=M0ikLyYbVX2b4oXKSDibo+mBTPCzRVwi3zQ4OYmQmcpi0vMIMDe3uLQOu5vKJdXK+ 2V2528mWvHa6q53TDCEhr92W9t5agfVVgRwG3lLEy1yTGf+RF5htUixqHC8ZgugxNK ERPu4X9rM32F3/eTDD1vnFZSLzFgxwxWYXglrswE= X-QQ-mid: esmtpsz19t1783592180t823f00b7 X-QQ-Originating-IP: 0lJFCcJVDe7RW2lM7DqlNDhhQOjOY7zdXnSHxwVW+EI= Received: from = ( [120.237.158.181]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 09 Jul 2026 18:16:18 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 12591070103831271671 EX-QQ-RecipientCnt: 7 Mime-Version: 1.0 Date: Thu, 09 Jul 2026 03:16:17 -0700 Message-Id: Subject: Re: [PATCH] i2c: spacemit: fix spurious IRQ handling returning IRQ_HANDLED From: "Troy Mitchell" To: "Pei Xiao" , , , , , , X-Mailer: aerc 0.21.0-0-g5549850facc2 References: In-Reply-To: X-QQ-SENDSIZE: 520 Feedback-ID: esmtpsz:linux.spacemit.com:qybglogicsvrgz:qybglogicsvrgz3a-0 X-QQ-XMAILINFO: MRoXHVs8e1kF0Nqz67nsbk6tetZapFEPTSaQ9WpoMwE5tEwWYqX4Zlfi 87mzRK43Ru2hVR1o65W1CPreu2rhx55dWFz3GV87dHyP+PX1d363U+DfZbkAOqNFkrj0XpE IEunIKmhoQDV17q/vT9xiRnt63mTirqvA149xchUEEc4CwFlKXTgADFSmWXRjGnbaofoHgw cJU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20260709_031649_717343_7A2A27E5 X-CRM114-Status: UNSURE ( 9.01 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Thu Jul 9, 2026 at 2:54 AM PDT, Pei Xiao wrote: > When the interrupt status register reads zero (no interrupt pending > from this device), the handler should return IRQ_NONE. Returning > IRQ_HANDLED incorrectly claims the interrupt was serviced, which can > prevent other devices sharing the same IRQ line from receiving their > interrupts. > > Fix this by returning IRQ_NONE instead of IRQ_HANDLED when the > status register is zero. The change goes in the right direction, but the rationale in the commit message doesn't hold, and I think the check itself can be improved. This driver requests its IRQ without IRQF_SHARED (see spacemit_i2c_probe(), which passes only IRQF_NO_SUSPEND), so there are no "other devices sharing the same IRQ line" to begin with. Even on a genuinely shared line, the kernel invokes every handler registered on the line regardless of what previous handlers return, so IRQ_HANDLED cannot prevent other handlers from running. What the return value actually feeds into is the spurious interrupt accounting in note_interrupt(): falsely claiming IRQ_HANDLED defeats the "irq XX: nobody cared" detection, so a stuck interrupt source would never be caught. That applies to dedicated lines as well, and is the real justification for this change. Could you rework the check and the commit message and send a v2? - Troy _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv