aboutsummaryrefslogtreecommitdiffstats
path: root/tty
diff options
Diffstat (limited to 'tty')
-rw-r--r--tty/serial8250-ratelimit-too-much-work-error.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/tty/serial8250-ratelimit-too-much-work-error.patch b/tty/serial8250-ratelimit-too-much-work-error.patch
new file mode 100644
index 00000000000000..d9be8a8a92cb03
--- /dev/null
+++ b/tty/serial8250-ratelimit-too-much-work-error.patch
@@ -0,0 +1,50 @@
+From akpm@linux-foundation.org Thu Oct 21 11:39:41 2010
+Message-Id: <201010202300.o9KN0mrG009735@imap1.linux-foundation.org>
+Subject: serial8250: ratelimit "too much work" error
+To: greg@kroah.com
+Cc: akpm@linux-foundation.org, dsd@laptop.org, alan@linux.intel.com
+From: Daniel Drake <dsd@laptop.org>
+Date: Wed, 20 Oct 2010 16:00:48 -0700
+
+From: Daniel Drake <dsd@laptop.org>
+
+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>
+
+---
+ drivers/serial/8250.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/serial/8250.c
++++ b/drivers/serial/8250.c
+@@ -31,6 +31,7 @@
+ #include <linux/delay.h>
+ #include <linux/platform_device.h>
+ #include <linux/tty.h>
++#include <linux/ratelimit.h>
+ #include <linux/tty_flip.h>
+ #include <linux/serial_reg.h>
+ #include <linux/serial_core.h>
+@@ -1600,8 +1601,8 @@ static irqreturn_t serial8250_interrupt(
+
+ 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);