Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp695308pxb; Sat, 18 Sep 2021 15:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyElH19xInG0EI/ZWPnkXJHNgvicMMyQhykSZHDTMVdAEUTcwulxZa+XFxO5ATD25QOyAI X-Received: by 2002:aa7:c5d9:: with SMTP id h25mr20222825eds.159.1632003809832; Sat, 18 Sep 2021 15:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632003809; cv=none; d=google.com; s=arc-20160816; b=Za4TNiff7RcjTGYd6lIlwQcuBjiJaJ2DvTzVZQNNRusThqSMGQOjzGmu0cQ96U/y2U HfPO5R9C9fyp3G3CyrIe8Se/n4AvdWDOL8hBRfTKXTkIFFRuvHos2X7k6VHXmVLVV5uQ +AK8du+hvdw50Kb0eXDIzWZJQw2REOtf7hGfbxew8rHDB4l8BDXR1vWdoA1I4SVw2Unj ztBU8clrh2/GjuBYwGzAIyZLP1QPUW+oiVaa3bYQeTEbT90yr03TAGCG1xmOYUP6kqdu cAl/6jXWMiOI3YfqH1IdpRge0eBWKE2Rd5gpIbrBq3MjOH20zPNum4os5zlPcYroaLYn Bxcg== 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=43QUIQl/3S9/JFKbD85BT0gzw5E/ho94fIt2sDWG2Ig=; b=DyMd5UDWXLbiWzXJ2AAz7od/GcEBSVwmirKcw6WQL8MeXoyj1gj8ARwoqxv0YnP8Tf BK5ISufI6ZpWQuaMNizskSTW4bVNtpmM/RkxI9odqOD04y4e3UKN22uBymLLAfImGcvM e2FkXcPiVwDA3iKPhoSNh8qbRRvul4xGxerg/wJaL1enpxWXxhyspgaFhteMQInEPqA1 oeYqKhuOr7LuzIM2098cLtBBdwP4TYon6poGTV6Dd1OUEvSNuhv3rFfb62bjdLJhaitF t3cDdBSp2liVJFimT3fYchjckyykJyCWLOa9lwqrDTv13R+anHzekFOTHiKgBLN8BX7P z0uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=FSfomUJG; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="Tw1kVD/m"; 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 s6si11551427edh.408.2021.09.18.15.23.04; Sat, 18 Sep 2021 15:23:29 -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=FSfomUJG; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="Tw1kVD/m"; 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 S240392AbhIRMMC (ORCPT + 99 others); Sat, 18 Sep 2021 08:12:02 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:51017 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235075AbhIRMLY (ORCPT ); Sat, 18 Sep 2021 08:11:24 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 88CD5580A89; Sat, 18 Sep 2021 08:10:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 18 Sep 2021 08:10:00 -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=43QUIQl/3S9/J FKbD85BT0gzw5E/ho94fIt2sDWG2Ig=; b=FSfomUJGxWDbhKXQmFClCILkUn/Wu bpxyEUuk6JwhLWYQALigYVPtyF2pjI3i8GgZwkxL9K4+TAFfJ0AyJ0mk+R5mDTek KCw+P9iAGPrusWb3Xfen5jcTG96EZ0Wk7WBEv2o49fHCVUk6QLpzhFKVGRTuPvLx qP1NBeuYmMJMwnxC4uGxLJxqknSwzJafPk5UTD5QwcNVX4S9L6j5+h5XZqnmhV5X 4eaM+yuZ6PRkQQofjWg1kK8BMGvUgSrn4gp9MGlnzjZr0hA66LA4JGSBqiTDgh20 pQyheZTJeAkAUu+X6hJH33z0kOcbX2NTwMddwgTPs0cpWdoLaTQ5ob86w== 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=43QUIQl/3S9/JFKbD85BT0gzw5E/ho94fIt2sDWG2Ig=; b=Tw1kVD/m LjOd5k+PE7Oi08ub93wDH5TRkY8BROaPk35/3bC90up82oGAGwQTZqMiFR9NCLwh o4bqQtweRODXnVS5GvZPEBhAwNNamY50cbHR2pj+BjWAdWgd4o6jIIjEaBVyq5HA YwqM7dDGGtcHKkt85zMlC69ktiDlTPormBkO99mlYDVkc+Swv6DsYoPmaU8nzFdM fVkSrxRn1jlYu3VIqmZF4FtttPkxea6cOZFFAmGLOhHX72TvC78gfCPdiph35jG4 uDFOH6dDmhNC5aR1kwfuMeOBhTpMuC+7YNL29G2YmtXXSMrzSljQI21QGTHtOkJB F4wnwl9z3KOjgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehkedggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuvhgvnhcu rfgvthgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrthhtvg hrnheptedvkeetleeuffffhfekteetffeggffgveehieelueefvddtueffveevlefhfeej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhvvg hnsehsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 18 Sep 2021 08:09:58 -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: [RFT PATCH 4/9] usb: typec: tipd: Add short-circuit for no irqs Date: Sat, 18 Sep 2021 14:09:29 +0200 Message-Id: <20210918120934.28252-5-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20210918120934.28252-1-sven@svenpeter.dev> References: <20210918120934.28252-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. Signed-off-by: Sven Peter --- drivers/usb/typec/tipd/core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index c2c399722c37..4a6d66250fef 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -434,6 +434,8 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data) trace_tps6598x_irq(event1, event2); event = event1 | event2; + if (!event) + goto err_unlock; ret = tps6598x_read32(tps, TPS_REG_STATUS, &status); if (ret) { @@ -481,7 +483,9 @@ static irqreturn_t tps6598x_interrupt(int irq, void *data) err_unlock: mutex_unlock(&tps->lock); - return IRQ_HANDLED; + if (event) + return IRQ_HANDLED; + return IRQ_NONE; } static int tps6598x_check_mode(struct tps6598x *tps) -- 2.25.1