From: Greg Kroah-Hartman Date: Mon, 7 Jul 2014 22:57:58 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.4.98~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=640c177be333947b7587290d4cf6d570b317aa5c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: alsa-usb-audio-prevent-printk-ratelimiting-from-spamming-kernel-log-while-debug-not-defined.patch alsa-usb-audio-suppress-repetitive-debug-messages-from-retire_playback_urb.patch arch-unicore32-mm-alignment.c-include-asm-pgtable.h-to-avoid-compiling-error.patch drivers-video-fbdev-fb-puv3.c-add-header-files-for-function-unifb_mmap.patch serial-8250_dw-fix-lcr-workaround-regression.patch serial-8250_dw-improve-unwritable-lcr-workaround.patch --- diff --git a/queue-3.10/alsa-usb-audio-prevent-printk-ratelimiting-from-spamming-kernel-log-while-debug-not-defined.patch b/queue-3.10/alsa-usb-audio-prevent-printk-ratelimiting-from-spamming-kernel-log-while-debug-not-defined.patch new file mode 100644 index 00000000000..bd03d65b276 --- /dev/null +++ b/queue-3.10/alsa-usb-audio-prevent-printk-ratelimiting-from-spamming-kernel-log-while-debug-not-defined.patch @@ -0,0 +1,49 @@ +From b7a7723513dc89f83d6df13206df55d4dc26e825 Mon Sep 17 00:00:00 2001 +From: Sander Eikelenboom +Date: Fri, 2 May 2014 15:09:27 +0200 +Subject: ALSA: usb-audio: Prevent printk ratelimiting from spamming kernel log while DEBUG not defined + +From: Sander Eikelenboom + +commit b7a7723513dc89f83d6df13206df55d4dc26e825 upstream. + +This (widely used) construction: + +if(printk_ratelimit()) + dev_dbg() + +Causes the ratelimiting to spam the kernel log with the "callbacks suppressed" +message below, even while the dev_dbg it is supposed to rate limit wouldn't +print anything because DEBUG is not defined for this device. + +[ 533.803964] retire_playback_urb: 852 callbacks suppressed +[ 538.807930] retire_playback_urb: 852 callbacks suppressed +[ 543.811897] retire_playback_urb: 852 callbacks suppressed +[ 548.815745] retire_playback_urb: 852 callbacks suppressed +[ 553.819826] retire_playback_urb: 852 callbacks suppressed + +So use dev_dbg_ratelimited() instead of this construction. + +Signed-off-by: Sander Eikelenboom +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/pcm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -1419,9 +1419,9 @@ static void retire_playback_urb(struct s + * The error should be lower than 2ms since the estimate relies + * on two reads of a counter updated every ms. + */ +- if (printk_ratelimit() && +- abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) +- snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n", ++ if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) ++ dev_dbg_ratelimited(&subs->dev->dev, ++ "delay: estimated %d, actual %d\n", + est_delay, subs->last_delay); + + if (!subs->running) { diff --git a/queue-3.10/alsa-usb-audio-suppress-repetitive-debug-messages-from-retire_playback_urb.patch b/queue-3.10/alsa-usb-audio-suppress-repetitive-debug-messages-from-retire_playback_urb.patch new file mode 100644 index 00000000000..a6edaf1a5d4 --- /dev/null +++ b/queue-3.10/alsa-usb-audio-suppress-repetitive-debug-messages-from-retire_playback_urb.patch @@ -0,0 +1,44 @@ +From a5065eb6da55b226661456e6a7435f605df98111 Mon Sep 17 00:00:00 2001 +From: Tim Gardner +Date: Wed, 9 Apr 2014 11:30:44 -0600 +Subject: ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb() + +From: Tim Gardner + +commit a5065eb6da55b226661456e6a7435f605df98111 upstream. + +BugLink: http://bugs.launchpad.net/bugs/1305133 + +Malfunctioning or slow devices can cause a flood of dmesg SPAM. + +I've ignored checkpatch.pl complaints about the use of printk_ratelimit() in favour +of prior art in sound/usb/pcm.c. + +WARNING: Prefer printk_ratelimited or pr__ratelimited to printk_ratelimit ++ if (printk_ratelimit() && + +Cc: Jaroslav Kysela +Cc: Takashi Iwai +Cc: Eldad Zack +Cc: Daniel Mack +Cc: Clemens Ladisch +Signed-off-by: Tim Gardner +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/pcm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -1419,7 +1419,8 @@ static void retire_playback_urb(struct s + * The error should be lower than 2ms since the estimate relies + * on two reads of a counter updated every ms. + */ +- if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) ++ if (printk_ratelimit() && ++ abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) + snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n", + est_delay, subs->last_delay); + diff --git a/queue-3.10/arch-unicore32-mm-alignment.c-include-asm-pgtable.h-to-avoid-compiling-error.patch b/queue-3.10/arch-unicore32-mm-alignment.c-include-asm-pgtable.h-to-avoid-compiling-error.patch new file mode 100644 index 00000000000..cc43ac6ab3e --- /dev/null +++ b/queue-3.10/arch-unicore32-mm-alignment.c-include-asm-pgtable.h-to-avoid-compiling-error.patch @@ -0,0 +1,43 @@ +From 1ff38c56cbd095c4c0dfa581a859ba3557830f78 Mon Sep 17 00:00:00 2001 +From: Chen Gang +Date: Mon, 24 Mar 2014 20:17:44 +0800 +Subject: arch/unicore32/mm/alignment.c: include "asm/pgtable.h" to avoid compiling error + +From: Chen Gang + +commit 1ff38c56cbd095c4c0dfa581a859ba3557830f78 upstream. + +Need include "asm/pgtable.h" to include "asm-generic/pgtable-nopmd.h", +so can let 'pmd_t' defined. The related error with allmodconfig: + + CC arch/unicore32/mm/alignment.o + In file included from arch/unicore32/mm/alignment.c:24: + arch/unicore32/include/asm/tlbflush.h:135: error: expected .). before .*. token + arch/unicore32/include/asm/tlbflush.h:154: error: expected .). before .*. token + In file included from arch/unicore32/mm/alignment.c:27: + arch/unicore32/mm/mm.h:15: error: expected .=., .,., .;., .sm. or ._attribute__. before .*. token + arch/unicore32/mm/mm.h:20: error: expected .=., .,., .;., .sm. or ._attribute__. before .*. token + arch/unicore32/mm/mm.h:25: error: expected .=., .,., .;., .sm. or ._attribute__. before .*. token + make[1]: *** [arch/unicore32/mm/alignment.o] Error 1 + make: *** [arch/unicore32/mm] Error 2 + +Signed-off-by: Chen Gang +Acked-by: Xuetao Guan +Signed-off-by: Xuetao Guan +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + arch/unicore32/mm/alignment.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/unicore32/mm/alignment.c ++++ b/arch/unicore32/mm/alignment.c +@@ -21,6 +21,7 @@ + #include + #include + ++#include + #include + #include + diff --git a/queue-3.10/drivers-video-fbdev-fb-puv3.c-add-header-files-for-function-unifb_mmap.patch b/queue-3.10/drivers-video-fbdev-fb-puv3.c-add-header-files-for-function-unifb_mmap.patch new file mode 100644 index 00000000000..b66ebafb924 --- /dev/null +++ b/queue-3.10/drivers-video-fbdev-fb-puv3.c-add-header-files-for-function-unifb_mmap.patch @@ -0,0 +1,50 @@ +From fbc6c4a13bbfb420eedfdb26a0a859f9c07e8a7b Mon Sep 17 00:00:00 2001 +From: Zhichuang SUN +Date: Wed, 21 May 2014 14:13:30 +0800 +Subject: drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap + +From: Zhichuang SUN + +commit fbc6c4a13bbfb420eedfdb26a0a859f9c07e8a7b upstream. + +Function unifb_mmap calls functions which are defined in linux/mm.h +and asm/pgtable.h + +The related error (for unicore32 with unicore32_defconfig): + CC drivers/video/fbdev/fb-puv3.o + drivers/video/fbdev/fb-puv3.c: In function 'unifb_mmap': + drivers/video/fbdev/fb-puv3.c:646: error: implicit declaration of + function 'vm_iomap_memory' + drivers/video/fbdev/fb-puv3.c:646: error: implicit declaration of + function 'pgprot_noncached' + +Signed-off-by: Zhichuang Sun +Cc: Jean-Christophe Plagniol-Villard +Cc: Tomi Valkeinen +Cc: Jingoo Han +Cc: Daniel Vetter +Cc: Joe Perches +Cc: Laurent Pinchart +Cc: linux-fbdev@vger.kernel.org +Acked-by: Xuetao Guan +Signed-off-by: Tomi Valkeinen +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/video/fb-puv3.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/video/fb-puv3.c ++++ b/drivers/video/fb-puv3.c +@@ -18,8 +18,10 @@ + #include + #include + #include ++#include + + #include ++#include + #include + + /* Platform_data reserved for unifb registers. */ diff --git a/queue-3.10/md-make-sure-get_array_info-ioctl-reports-correct-clean-status.patch b/queue-3.10/md-make-sure-get_array_info-ioctl-reports-correct-clean-status.patch deleted file mode 100644 index 1ee5c022040..00000000000 --- a/queue-3.10/md-make-sure-get_array_info-ioctl-reports-correct-clean-status.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 9bd359203210efeb5d8f0d81c155079f34b47449 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Wed, 2 Jul 2014 11:35:06 +1000 -Subject: md: make sure GET_ARRAY_INFO ioctl reports correct "clean" status - -From: NeilBrown - -commit 9bd359203210efeb5d8f0d81c155079f34b47449 upstream. - -If an array has a bitmap, the when we set the "has bitmap" flag we -incorrectly clear the "is clean" flag. - -"is clean" isn't really important when a bitmap is present, but it is -best to get it right anyway. - -Reported-by: George Duffield -Link: http://lkml.kernel.org/CAG__1a4MRV6gJL38XLAurtoSiD3rLBTmWpcS5HYvPpSfPR88UQ@mail.gmail.com -Fixes: 36fa30636fb84b209210299684e1be66d9e58217 (v2.6.14) -Signed-off-by: NeilBrown -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/md/md.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/md/md.c -+++ b/drivers/md/md.c -@@ -5606,7 +5606,7 @@ static int get_array_info(struct mddev * - if (mddev->in_sync) - info.state = (1<bitmap && mddev->bitmap_info.offset) -- info.state = (1< +Date: Tue, 10 Dec 2013 22:28:04 +0000 +Subject: serial: 8250_dw: Fix LCR workaround regression + +From: James Hogan + +commit 6979f8d28049879e6147767d93ba6732c8bd94f4 upstream. + +Commit c49436b657d0 (serial: 8250_dw: Improve unwritable LCR workaround) +caused a regression. It added a check that the LCR was written properly +to detect and workaround the busy quirk, but the behaviour of bit 5 +(UART_LCR_SPAR) differs between IP versions 3.00a and 3.14c per the +docs. On older versions this caused the check to fail and it would +repeatedly force idle and rewrite the LCR register, causing delays and +preventing any input from serial being received. + +This is fixed by masking out UART_LCR_SPAR before making the comparison. + +Signed-off-by: James Hogan +Cc: Greg Kroah-Hartman +Cc: Jiri Slaby +Cc: Tim Kryger +Cc: Ezequiel Garcia +Cc: Matt Porter +Cc: Markus Mayer +Tested-by: Tim Kryger +Tested-by: Ezequiel Garcia +Tested-by: Heikki Krogerus +Cc: Wang Nan +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/8250/8250_dw.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/8250/8250_dw.c ++++ b/drivers/tty/serial/8250/8250_dw.c +@@ -92,7 +92,8 @@ static void dw8250_serial_out(struct uar + if (offset == UART_LCR) { + int tries = 1000; + while (tries--) { +- if (value == p->serial_in(p, UART_LCR)) ++ unsigned int lcr = p->serial_in(p, UART_LCR); ++ if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR)) + return; + dw8250_force_idle(p); + writeb(value, p->membase + (UART_LCR << p->regshift)); +@@ -121,7 +122,8 @@ static void dw8250_serial_out32(struct u + if (offset == UART_LCR) { + int tries = 1000; + while (tries--) { +- if (value == p->serial_in(p, UART_LCR)) ++ unsigned int lcr = p->serial_in(p, UART_LCR); ++ if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR)) + return; + dw8250_force_idle(p); + writel(value, p->membase + (UART_LCR << p->regshift)); diff --git a/queue-3.10/serial-8250_dw-improve-unwritable-lcr-workaround.patch b/queue-3.10/serial-8250_dw-improve-unwritable-lcr-workaround.patch new file mode 100644 index 00000000000..84fe12af901 --- /dev/null +++ b/queue-3.10/serial-8250_dw-improve-unwritable-lcr-workaround.patch @@ -0,0 +1,163 @@ +From c49436b657d0a56a6ad90d14a7c3041add7cf64d Mon Sep 17 00:00:00 2001 +From: Tim Kryger +Date: Tue, 1 Oct 2013 10:18:08 -0700 +Subject: serial: 8250_dw: Improve unwritable LCR workaround + +From: Tim Kryger + +commit c49436b657d0a56a6ad90d14a7c3041add7cf64d upstream. + +When configured with UART_16550_COMPATIBLE=NO or in versions prior to +the introduction of this option, the Designware UART will ignore writes +to the LCR if the UART is busy. The current workaround saves a copy of +the last written LCR and re-writes it in the ISR for a special interrupt +that is raised when a write was ignored. + +Unfortunately, interrupts are typically disabled prior to performing a +sequence of register writes that include the LCR so the point at which +the retry occurs is too late. An example is serial8250_do_set_termios() +where an ignored LCR write results in the baud divisor not being set and +instead a garbage character is sent out the transmitter. + +Furthermore, since serial_port_out() offers no way to indicate failure, +a serious effort must be made to ensure that the LCR is actually updated +before returning back to the caller. This is difficult, however, as a +UART that was busy during the first attempt is likely to still be busy +when a subsequent attempt is made unless some extra action is taken. + +This updated workaround reads back the LCR after each write to confirm +that the new value was accepted by the hardware. Should the hardware +ignore a write, the TX/RX FIFOs are cleared and the receive buffer read +before attempting to rewrite the LCR out of the hope that doing so will +force the UART into an idle state. While this may seem unnecessarily +aggressive, writes to the LCR are used to change the baud rate, parity, +stop bit, or data length so the data that may be lost is likely not +important. Admittedly, this is far from ideal but it seems to be the +best that can be done given the hardware limitations. + +Lastly, the revised workaround doesn't touch the LCR in the ISR, so it +avoids the possibility of a "serial8250: too much work for irq" lock up. +This problem is rare in real situations but can be reproduced easily by +wiring up two UARTs and running the following commands. + + # stty -F /dev/ttyS1 echo + # stty -F /dev/ttyS2 echo + # cat /dev/ttyS1 & + [1] 375 + # echo asdf > /dev/ttyS1 + asdf + + [ 27.700000] serial8250: too much work for irq96 + [ 27.700000] serial8250: too much work for irq96 + [ 27.710000] serial8250: too much work for irq96 + [ 27.710000] serial8250: too much work for irq96 + [ 27.720000] serial8250: too much work for irq96 + [ 27.720000] serial8250: too much work for irq96 + [ 27.730000] serial8250: too much work for irq96 + [ 27.730000] serial8250: too much work for irq96 + [ 27.740000] serial8250: too much work for irq96 + +Signed-off-by: Tim Kryger +Reviewed-by: Matt Porter +Reviewed-by: Markus Mayer +Reviewed-by: Heikki Krogerus +[wangnan: backport to 3.10.43: + - adjust context + - remove unneeded local var] +Signed-off-by: Wang Nan +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/8250/8250_dw.c | 42 ++++++++++++++++++++++++++++---------- + 1 file changed, 32 insertions(+), 10 deletions(-) + +--- a/drivers/tty/serial/8250/8250_dw.c ++++ b/drivers/tty/serial/8250/8250_dw.c +@@ -54,7 +54,6 @@ + + + struct dw8250_data { +- int last_lcr; + int last_mcr; + int line; + struct clk *clk; +@@ -73,17 +72,33 @@ static inline int dw8250_modify_msr(stru + return value; + } + ++static void dw8250_force_idle(struct uart_port *p) ++{ ++ serial8250_clear_and_reinit_fifos(container_of ++ (p, struct uart_8250_port, port)); ++ (void)p->serial_in(p, UART_RX); ++} ++ + static void dw8250_serial_out(struct uart_port *p, int offset, int value) + { + struct dw8250_data *d = p->private_data; + +- if (offset == UART_LCR) +- d->last_lcr = value; +- + if (offset == UART_MCR) + d->last_mcr = value; + + writeb(value, p->membase + (offset << p->regshift)); ++ ++ /* Make sure LCR write wasn't ignored */ ++ if (offset == UART_LCR) { ++ int tries = 1000; ++ while (tries--) { ++ if (value == p->serial_in(p, UART_LCR)) ++ return; ++ dw8250_force_idle(p); ++ writeb(value, p->membase + (UART_LCR << p->regshift)); ++ } ++ dev_err(p->dev, "Couldn't set LCR to %d\n", value); ++ } + } + + static unsigned int dw8250_serial_in(struct uart_port *p, int offset) +@@ -97,13 +112,22 @@ static void dw8250_serial_out32(struct u + { + struct dw8250_data *d = p->private_data; + +- if (offset == UART_LCR) +- d->last_lcr = value; +- + if (offset == UART_MCR) + d->last_mcr = value; + + writel(value, p->membase + (offset << p->regshift)); ++ ++ /* Make sure LCR write wasn't ignored */ ++ if (offset == UART_LCR) { ++ int tries = 1000; ++ while (tries--) { ++ if (value == p->serial_in(p, UART_LCR)) ++ return; ++ dw8250_force_idle(p); ++ writel(value, p->membase + (UART_LCR << p->regshift)); ++ } ++ dev_err(p->dev, "Couldn't set LCR to %d\n", value); ++ } + } + + static unsigned int dw8250_serial_in32(struct uart_port *p, int offset) +@@ -115,15 +139,13 @@ static unsigned int dw8250_serial_in32(s + + static int dw8250_handle_irq(struct uart_port *p) + { +- struct dw8250_data *d = p->private_data; + unsigned int iir = p->serial_in(p, UART_IIR); + + if (serial8250_handle_irq(p, iir)) { + return 1; + } else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) { +- /* Clear the USR and write the LCR again. */ ++ /* Clear the USR */ + (void)p->serial_in(p, DW_UART_USR); +- p->serial_out(p, UART_LCR, d->last_lcr); + + return 1; + } diff --git a/queue-3.10/series b/queue-3.10/series index c706c2908c2..c98b539f4c5 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -41,7 +41,12 @@ nfsd-fix-rare-symlink-decoding-bug.patch tools-ffs-test-fix-header-values-endianess.patch tracing-remove-ftrace_stop-start-from-reading-the-trace-file.patch md-flush-writes-before-starting-a-recovery.patch -md-make-sure-get_array_info-ioctl-reports-correct-clean-status.patch irqchip-spear_shirq-fix-interrupt-offset.patch mmc-rtsx-add-r1-no-crc-mmc-command-type-handle.patch serial-8250_dw-report-cts-asserted-for-auto-flow.patch +serial-8250_dw-improve-unwritable-lcr-workaround.patch +serial-8250_dw-fix-lcr-workaround-regression.patch +alsa-usb-audio-suppress-repetitive-debug-messages-from-retire_playback_urb.patch +alsa-usb-audio-prevent-printk-ratelimiting-from-spamming-kernel-log-while-debug-not-defined.patch +arch-unicore32-mm-alignment.c-include-asm-pgtable.h-to-avoid-compiling-error.patch +drivers-video-fbdev-fb-puv3.c-add-header-files-for-function-unifb_mmap.patch