From: Daniel Drake Date: Wed, 20 Oct 2010 23:00:48 +0000 (-0700) Subject: serial8250: ratelimit "too much work" error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cd3ecad19aea8debae9a48b53de2ec7a571f24e9;p=linux-beck.git serial8250: ratelimit "too much work" error Running a serial console, if too many kernel messages are generated within a short time causing a lot of serial I/O, the 8250 driver will generate another kernel message reporting this, which just adds to the I/O. It has a cascading effect and quickly results the system being brought to its knees by a flood of "too much work" messages. Ratelimit the error message to avoid this. [akpm@linux-foundation.org: use the superior printk_ratelimited()] [akpm@linux-foundation.org: printk_ratelimited() needs ratelimit.h] Signed-off-by: Daniel Drake Acked-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 37f19a678c97..167c4a6ccbc3 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1600,8 +1601,8 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id) if (l == i->head && pass_counter++ > PASS_LIMIT) { /* If we hit this, we're dead. */ - printk(KERN_ERR "serial8250: too much work for " - "irq%d\n", irq); + printk_ratelimited(KERN_ERR + "serial8250: too much work for irq%d\n", irq); break; } } while (l != end);