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]
Message-Id: <1347454546-23236-12-git-send-email-siglesias@igalia.com>
Date:	Wed, 12 Sep 2012 14:55:34 +0200
From:	Samuel Iglesias Gonsalvez <siglesias@...lia.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	industrypack-devel@...ts.sourceforge.net,
	Jens Taprogge <jens.taprogge@...rogge.org>,
	Samuel Iglesias Gonsalvez <siglesias@...lia.com>
Subject: [PATCH 12/24] Staging: ipack/bridges/tpci200: Clean up interrupt handling.

From: Jens Taprogge <jens.taprogge@...rogge.org>

Previously the return value from tpci200_interrupt was not quite correct
if a slot had caused an interrupt but no handler was instellalled:
IRQ_NONE was returned.  However in this case we react to the interrupt
by disabling the IPack device interrupt.

Basically there are two cases the code now distinguishes:
 - The tpci200 has raised an interrupt.  We handle it and return
   IRQ_HANDLED.
 - Our device did not raise an interrupt. We return IRQ_NONE.

Signed-off-by: Jens Taprogge <jens.taprogge@...rogge.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@...lia.com>
---
 drivers/staging/ipack/bridges/tpci200.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c
index b1ddbe3..0cbaf3a 100644
--- a/drivers/staging/ipack/bridges/tpci200.c
+++ b/drivers/staging/ipack/bridges/tpci200.c
@@ -116,7 +116,6 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
 	struct tpci200_board *tpci200 = (struct tpci200_board *) dev_id;
 	int i;
 	unsigned short status_reg;
-	irqreturn_t ret = IRQ_NONE;
 	struct slot_irq *slot_irq;
 
 	/* Read status register */
@@ -130,7 +129,7 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
 				continue;
 			slot_irq = rcu_dereference(tpci200->slots[i].irq);
 			if (slot_irq) {
-				ret = tpci200_slot_irq(slot_irq);
+				tpci200_slot_irq(slot_irq);
 			} else {
 				dev_info(&tpci200->info->pdev->dev,
 					 "No registered ISR for slot [%d:%d]!. IRQ will be disabled.\n",
@@ -141,9 +140,11 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
 			}
 		}
 		rcu_read_unlock();
-	}
 
-	return ret;
+		return IRQ_HANDLED;
+	} else {
+		return IRQ_NONE;
+	}
 }
 
 static int tpci200_register(struct tpci200_board *tpci200)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ