Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2726653pxb; Tue, 21 Sep 2021 06:26:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC+PHrwGZLR6j4nKhF86polVzNP/ejI0axNZen86yFEQozPpjvcVieLIkHFrvlRWqbA1AU X-Received: by 2002:a5d:9047:: with SMTP id v7mr20012806ioq.214.1632230786346; Tue, 21 Sep 2021 06:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632230786; cv=none; d=google.com; s=arc-20160816; b=Zxk9vf/3rYwg3V3M7Fh0OTYbz9VyJJIMNhP1iM64VxXXL/SeOXHDqmYZho2zYOjfn2 2lneEoHoXkz4pJmLWuTOhtACPFh5sgvXSg2Eu7lGKsq8vnGSAAQLvAl99JfsrSOQBR9G M+jqNFLIvQ8/+g6rVRdwmuoT7vQYpMA51aPMSxo66pKwZDc1npKlQcVXAOioZnkYRqjQ 1Wef6jKriM1mz91T1f82/C0WLUIC1N+sCZ0apsx4v7OTlDQDAUtAZpkx4SBiFBcHhyqy nciGMvGldHvfqABbZtCFNM963xc3p25UR+l5kQrJZHA0d7SGayFYL8tsG24DsrpV3Tn0 Ch9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+S1ebEdUJh6E2SWW5xfak98u3i6kZ7dI86fy4k8IuAs=; b=jwUOIsgrIWB/0wLufSyr8nso6ObZ8myTBa0df7UhXsKs0plrQQ/wri5AR1Q4gdArn1 yHQP/890GoPzKy+VC2/+CKATCxgpyzjcbhHD5/F55xdR17iYIQFDOvHAOd7g1BUUBb5s hic83XyFJRiAWoeDzGq7MhqeHqz11m8uXyVCNyj2Y5YfGtyFp+YpKVMQOiDTivyfD82P 331G/BWQFpivEKgqjbRycTFu4K3EtRFya70A686ZyA6zlr7xVtLDwov7stYetMw8RSRj nZUxBbHZH/BQCwHTLmkRb8F8Z7LgNHjyHhVdkalZ1nFTYS+grpNedc5A3JpZd6o+rB/v YIQw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si7163230ils.122.2021.09.21.06.26.13; Tue, 21 Sep 2021 06:26:26 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233037AbhIUNYf (ORCPT + 99 others); Tue, 21 Sep 2021 09:24:35 -0400 Received: from mga11.intel.com ([192.55.52.93]:43128 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231658AbhIUNYe (ORCPT ); Tue, 21 Sep 2021 09:24:34 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10113"; a="220158710" X-IronPort-AV: E=Sophos;i="5.85,311,1624345200"; d="scan'208";a="220158710" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2021 06:23:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,311,1624345200"; d="scan'208";a="613003776" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 21 Sep 2021 06:23:01 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 21 Sep 2021 16:23:00 +0300 Date: Tue, 21 Sep 2021 16:23:00 +0300 From: Heikki Krogerus To: Sven Peter Cc: Greg Kroah-Hartman , Guido =?iso-8859-1?Q?G=FCnther?= , 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: Re: [RFT PATCH 4/9] usb: typec: tipd: Add short-circuit for no irqs Message-ID: References: <20210918120934.28252-1-sven@svenpeter.dev> <20210918120934.28252-5-sven@svenpeter.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210918120934.28252-5-sven@svenpeter.dev> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 18, 2021 at 02:09:29PM +0200, Sven Peter wrote: > 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 Reviewed-by: Heikki Krogerus > --- > 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 thanks, -- heikki