lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 18 Sep 2021 14:09:29 +0200
From:   Sven Peter <sven@...npeter.dev>
To:     Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc:     Sven Peter <sven@...npeter.dev>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Guido Günther <agx@...xcpu.org>,
        "Bryan O'Donoghue" <bryan.odonoghue@...aro.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Hector Martin <marcan@...can.st>,
        Mohamed Mediouni <mohamed.mediouni@...amail.com>,
        Stan Skowronek <stan@...ellium.com>,
        Mark Kettenis <mark.kettenis@...all.nl>,
        Alexander Graf <graf@...zon.com>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>
Subject: [RFT PATCH 4/9] usb: typec: tipd: Add short-circuit for no irqs

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 <sven@...npeter.dev>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ