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-next>] [day] [month] [year] [list]
Message-ID: <80k4k45csy.fsf@merkur.tec.linutronix.de>
Date:	Tue, 23 Nov 2010 15:34:21 +0100
From:	John Ogness <john.ogness@...utronix.de>
To:	Wolfgang Grandegger <wg@...ndegger.com>
Cc:	kernel@...gutronix.de
Subject: [PATCH] flexcan: fix NAPI for bus errors

If bus error reporting is disabled and bus errors occur, the flexcan
driver will hog the system because it continually re-enables the IRQs
(work_done = 0). This patch changes the driver to only re-enable the
IRQs if some work was actually done. This allows the features of NAPI to
be used for bus errors as well (when bus error reporting is disabled).

This patch is against Linux next-20101123.

Signed-off-by: John Ogness <john.ogness@...utronix.de>
---
 drivers/net/can/flexcan.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- next-20101123-a/drivers/net/can/flexcan.c
+++ next-20101123-b/drivers/net/can/flexcan.c
@@ -535,9 +535,12 @@ static int flexcan_poll(struct napi_stru
 
 	if (work_done < quota) {
 		napi_complete(napi);
-		/* enable IRQs */
-		writel(FLEXCAN_IFLAG_DEFAULT, &regs->imask1);
-		writel(priv->reg_ctrl_default, &regs->ctrl);
+
+		if (work_done > 0) {
+			/* enable IRQs */
+			writel(FLEXCAN_IFLAG_DEFAULT, &regs->imask1);
+			writel(priv->reg_ctrl_default, &regs->ctrl);
+		}
 	}
 
 	return work_done;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ