netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] flexcan: fix NAPI for bus errors
@ 2010-11-23 14:34 John Ogness
       [not found] ` <80k4k45csy.fsf-l77OnrVvfFAyMciVaGeJ0d53zsg1cpMQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: John Ogness @ 2010-11-23 14:34 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: socketcan-core, netdev, kernel

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@linutronix.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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-23 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23 14:34 [PATCH] flexcan: fix NAPI for bus errors John Ogness
     [not found] ` <80k4k45csy.fsf-l77OnrVvfFAyMciVaGeJ0d53zsg1cpMQ@public.gmane.org>
2010-11-23 15:39   ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).