Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5018776pxb; Tue, 28 Sep 2021 08:57:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfqvnVYSUCaXwOKIxvBOZ5PyUhbHqJDhv4RLJ8p1lF8n2/tcrMxFsTKFVhkQA1qVQWo6g4 X-Received: by 2002:a17:907:7664:: with SMTP id kk4mr7595991ejc.130.1632844648134; Tue, 28 Sep 2021 08:57:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632844648; cv=none; d=google.com; s=arc-20160816; b=U+0ru5wSNE0V9lFLw7Zizvp/TrO0XdhQa3AKujVKJXq4nZfHPeprWpqtMzXx2HRAg5 1NsEusnutYyTRJWUQy5gxn/ZDLUij4iAC5qtezG7nHdR44bvc1BDxCC/wIXSn11K538q a5Ugt8SNjns3SU6umz+jzdptz72c0lf6J6zWhl1ZdpN24DGXybeYqxklLiZWjTL4BYmE WgpvcNP4w47CaAPWyim6cpRgSTmm09w1z1+1sDekExtf6is4SI6O1w/lM3Efyhu+sVww RQmME0qzrHTqSriTc2/9SzXlFEjlyFR10pWSMi/UTr74mRYLg8U+67ab12LglOe+FSDs Y4lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=l7l2ToDgnvybdMl4obXc3cfMQHrVz6bhWaTvDSMxSUA=; b=dTQ6plgUgzYE/30Z7qc8ttPgHOte1zE3HNNxXk1EptXAuveW5lY+rB1IE2KBD3qR9E K9UqPSoZMdzuADCIoDs/0EYVgUyOhsMnTqrLFRfPzn3qfaWk/+jyZSUpXi2C152KdA9Z DTO7t3CTopGk17TRkq8krQ8BLh5kddWB0pkfi8OrNmVVl84snzyc9sgJkG3ejTw4EFlq etWN4XIPM4Sz7peKDBtvtJYs4erjPbwwMLmPltsUt5o1HMqjooqCyveIPKnsww0n/Bdu yOW0lQJa46RH/aOEEozKTN430nKpUuahMTDN1felkrbxt8wcru99D3D4tq4ELVKNMOAj i0Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=Pdm5zUeM; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NJZFzXVy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=svenpeter.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si19255238edc.615.2021.09.28.08.57.04; Tue, 28 Sep 2021 08:57:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=Pdm5zUeM; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NJZFzXVy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=svenpeter.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241755AbhI1P5K (ORCPT + 99 others); Tue, 28 Sep 2021 11:57:10 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:58429 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241729AbhI1P5F (ORCPT ); Tue, 28 Sep 2021 11:57:05 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 9D8FC580C23; Tue, 28 Sep 2021 11:55:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 28 Sep 2021 11:55:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=l7l2ToDgnvybd Ml4obXc3cfMQHrVz6bhWaTvDSMxSUA=; b=Pdm5zUeMOXG2d//6NoexJqLVpWWZ7 UEx+yCZcGbXJeiFPAvdH+mLUcas6ME/Y/fiDGm+dENyqBhzvbm7kvqmy77lY+Oag bktIPzzaoJcbUkBQBUqS03DESeWRMmdCBaUFLS1zaeoR4sYl59aDZ+3KkoP/Ubtz vig+RIGAkMz6AlFRP+gMOqW9J260CCuPB5WUThXehqDLRjG+raMp5qm+t7vr++wk c9ep3dSzHB6YuLvJwNd7o2t3jgLjulOPVgG2JRxBx7uhxYq3dQfkdAq0ncplmJNt OtgIalpC7hkMf0wo1GbMnvdNJBCZ5MTL2RkAJP+QnFZ9dmM94yBZYf6Ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=l7l2ToDgnvybdMl4obXc3cfMQHrVz6bhWaTvDSMxSUA=; b=NJZFzXVy lmpJBSH1b3ou1HW2vjXZ+6AgQTV2nOf85QihyEAYsWbg5gUlTC+P1jWVPScjp1tt aTwYiXBo+VVplF5fsaYvFsMr80ZiG/ez/1ewf58Tp8TXiRV+FcnBZM8fcruDvvAt eOz+g8LCQTusP4IZoxTFv+MbEkSWPNpiByF7LcQc+KC6erwz1VwAwwLFVXgKB3YT cfiMLEaXaJPLlpYK9r/1eEf3fnReopNA81g/K4d/bD0+C3eQhmlTrMBep5H53jFa CFnBhj/sMyoTUlGEIeFp0Apff4GMyj6I7Fb+PbmtxgHMra6JSmN072k+YmlVci5R 8WusdL+ZP3j04g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudektddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuvhgvnhcu rfgvthgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrthhtvg hrnheptedvkeetleeuffffhfekteetffeggffgveehieelueefvddtueffveevlefhfeej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhvvg hnsehsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Sep 2021 11:55:23 -0400 (EDT) From: Sven Peter To: Heikki Krogerus Cc: Sven Peter , Greg Kroah-Hartman , =?UTF-8?q?Guido=20G=C3=BCnther?= , "Bryan O'Donoghue" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Hector Martin , Mohamed Mediouni , Stan Skowronek , Mark Kettenis , Alexander Graf , Alyssa Rosenzweig Subject: [PATCH v3 3/6] usb: typec: tipd: Add short-circuit for no irqs Date: Tue, 28 Sep 2021 17:54:59 +0200 Message-Id: <20210928155502.71372-4-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20210928155502.71372-1-sven@svenpeter.dev> References: <20210928155502.71372-1-sven@svenpeter.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If no interrupts are set in IntEventX directly skip to the end of the interrupt handler and return IRQ_NONE instead of IRQ_HANDLED. This possibly allows to detect spurious interrupts if the i2c bus is fast enough. Reviewed-by: Heikki Krogerus Signed-off-by: Sven Peter --- no changes since v2 changes since v1: - added Heikki's r-b - s/event/(event1 | event2)/ drivers/usb/typec/tipd/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 172715c6c238..e785e4aa2d4b 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -479,6 +479,9 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data) } trace_tps6598x_irq(event1, event2); + if (!(event1 | event2)) + goto err_unlock; + if (!tps6598x_read_status(tps, &status)) goto err_clear_ints; @@ -501,7 +504,9 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data) err_unlock: mutex_unlock(&tps->lock); - return IRQ_HANDLED; + if (event1 | event2) + return IRQ_HANDLED; + return IRQ_NONE; } static int tps6598x_check_mode(struct tps6598x *tps) -- 2.25.1