From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) (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 AC2153F660B; Thu, 9 Jul 2026 10:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.92.39.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783592247; cv=none; b=tJqlvVhFFHbgeIkgyemxwbARX4N8GHc6r5x3oen/1YeZSheZh+mkLXT1jVaCPLkPpJQpV/O15e2uZ0mKJjwbr0ngsIFejI3wxHSy2zJPaCNFtlt+NTQTmnNJ1Ee0ZrhPgrIA23atVcmzqS1SBP6+dwNrAZD9KKrWbLVwbiK2CpI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783592247; c=relaxed/simple; bh=wpSbjHnqNS5n5H9tjZJANRhyYNytw5/cTb0Bx8CVvLg=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To: References:In-Reply-To; b=KQtwE/YADKUG7pV8aJfNzAzBpw35J241fFrjeCXxTWXKwxDxwOSV+qTsIt6vDeo4RHeKnsV/l6nP2eCvhsMnISYs+D4d1kjo2Awiu8+4bFhHzmSBkTKiRpST/jyFIeT771ONK5Jc1E1RIW/akfSfOnWc/w7hdQRtlzaWaL3Dnq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.spacemit.com; spf=none smtp.mailfrom=linux.spacemit.com; dkim=pass (1024-bit key) header.d=linux.spacemit.com header.i=@linux.spacemit.com header.b=M0ikLyYb; arc=none smtp.client-ip=54.92.39.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.spacemit.com header.i=@linux.spacemit.com header.b="M0ikLyYb" 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 Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 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 87mzRK43Ru2hVR1o65W1CPreu2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50tPAe92KXseR0ZZmBTk3gLg== X-QQ-RECHKSPAM: 0 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