aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2010-10-20 19:00:48 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:20:11 -0400
commitcd3ecad19aea8debae9a48b53de2ec7a571f24e9 (patch)
treefbdb69e372b60cd01daca0c9ea3c8b5ebebb4d00
parent0dd25df1a4e63c078f357aaffb09789c9438378f (diff)
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 <dsd@laptop.org> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/serial/8250.c5
1 files changed, 3 insertions, 2 deletions
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 @@
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/tty.h> 33#include <linux/tty.h>
34#include <linux/ratelimit.h>
34#include <linux/tty_flip.h> 35#include <linux/tty_flip.h>
35#include <linux/serial_reg.h> 36#include <linux/serial_reg.h>
36#include <linux/serial_core.h> 37#include <linux/serial_core.h>
@@ -1600,8 +1601,8 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
1600 1601
1601 if (l == i->head && pass_counter++ > PASS_LIMIT) { 1602 if (l == i->head && pass_counter++ > PASS_LIMIT) {
1602 /* If we hit this, we're dead. */ 1603 /* If we hit this, we're dead. */
1603 printk(KERN_ERR "serial8250: too much work for " 1604 printk_ratelimited(KERN_ERR
1604 "irq%d\n", irq); 1605 "serial8250: too much work for irq%d\n", irq);
1605 break; 1606 break;
1606 } 1607 }
1607 } while (l != end); 1608 } while (l != end);