From: Greg Kroah-Hartman Date: Wed, 28 Jan 2015 00:23:49 +0000 (-0800) Subject: 3.14-stable patches X-Git-Tag: v3.10.67~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=746ed2fa22609b17c4d387ab7e90289ae7f2b3c0;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: mmc-sdhci-don-t-signal-the-sdio-irq-if-it-s-not-setup.patch tty-fix-pty-master-poll-after-slave-closes-v2.patch --- diff --git a/queue-3.14/mmc-sdhci-don-t-signal-the-sdio-irq-if-it-s-not-setup.patch b/queue-3.14/mmc-sdhci-don-t-signal-the-sdio-irq-if-it-s-not-setup.patch new file mode 100644 index 00000000000..8a6b0ae089b --- /dev/null +++ b/queue-3.14/mmc-sdhci-don-t-signal-the-sdio-irq-if-it-s-not-setup.patch @@ -0,0 +1,66 @@ +From sjoerd.simons@collabora.co.uk Tue Jan 27 16:19:58 2015 +From: Sjoerd Simons +Date: Mon, 19 Jan 2015 23:07:09 +0100 +Subject: mmc: sdhci: Don't signal the sdio irq if it's not setup +To: stable@vger.kernel.org, Chris Ball +Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King , Tyler Baker +Message-ID: <1421705229-20260-1-git-send-email-sjoerd.simons@collabora.co.uk> + +From: Sjoerd Simons + +[Not needed in newer kernels due to refactoring fixing this issue.] + +With 3.14.29 (and older kernels) some of my I.mx6 Sabrelite boards were +crashing with the following oops: + + sdhci: Secure Digital Host Controller Interface driver + sdhci: Copyright(c) Pierre Ossman + sdhci-pltfm: SDHCI platform and OF driver helper + sdhci-esdhc-imx 2198000.usdhc: could not get ultra high speed state, work on normal mode + mmc0: no vqmmc regulator found + mmc0: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA + Unable to handle kernel NULL pointer dereference at virtual address 00000000 + pgd = c0004000 + [00000000] *pgd=00000000 + Internal error: Oops: 5 [#1] SMP ARM + Modules linked in: + CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.29 #1 + task: c08a7120 ti: c089c000 task.ti: c089c000 + PC is at wake_up_process+0x8/0x40 + LR is at sdhci_irq+0x748/0x9c4 + +Full boot log can be found at: + http://storage.kernelci.org/stable/v3.14.29/arm-multi_v7_defconfig/lab-collabora/boot-imx6q-sabrelite.html + +This happens if the sdhci interrupt status contains SDHCI_INT_CARD_INT, +while the sdio irq was never setup. This patch fixes that in a minimal +way by checking if the sdio irq was setup. + +In more recent kernels this bug went away due to refactoring done by +Russel King. So an alternative (potentially better?) fix for this patch +is to cherrypick the following patches from a recent kernel: + +18258f7239a6 - genirq: Provide synchronize_hardirq() +bf3b5ec66bd0 - mmc: sdio_irq: rework sdio irq handling +41005003bcaf - mmc: sdhci: clean up interrupt handling +781e989cf593 - mmc: sdhci: convert to new SDIO IRQ handling + +Signed-off-by: Sjoerd Simons +Cc: Russell King +Cc: Tyler Baker +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/sdhci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c +@@ -2537,7 +2537,7 @@ out: + /* + * We have to delay this as it calls back into the driver. + */ +- if (cardint) ++ if (cardint && host->mmc->sdio_irqs) + mmc_signal_sdio_irq(host->mmc); + + return result; diff --git a/queue-3.14/series b/queue-3.14/series index 7d86f7952ea..68a2783c25b 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -40,3 +40,5 @@ crypto-add-missing-crypto-module-aliases.patch arc-delete-stale-barrier.h.patch arc-fix-build-breakage-for-config_arc_dw2_unwind.patch input-evdev-fix-eviocg-type-ioctl.patch +tty-fix-pty-master-poll-after-slave-closes-v2.patch +mmc-sdhci-don-t-signal-the-sdio-irq-if-it-s-not-setup.patch diff --git a/queue-3.14/tty-fix-pty-master-poll-after-slave-closes-v2.patch b/queue-3.14/tty-fix-pty-master-poll-after-slave-closes-v2.patch new file mode 100644 index 00000000000..53ded6a196a --- /dev/null +++ b/queue-3.14/tty-fix-pty-master-poll-after-slave-closes-v2.patch @@ -0,0 +1,69 @@ +From c4dc304677e8d566572c4738d95c48be150c6606 Mon Sep 17 00:00:00 2001 +From: Francesco Ruggeri +Date: Fri, 10 Oct 2014 13:09:53 -0700 +Subject: tty: Fix pty master poll() after slave closes v2 + +From: Francesco Ruggeri + +commit c4dc304677e8d566572c4738d95c48be150c6606 upstream. + +Commit f95499c3030f ("n_tty: Don't wait for buffer work in read() loop") +introduces a race window where a pty master can be signalled that the pty +slave was closed before all the data that the slave wrote is delivered. +Commit f8747d4a466a ("tty: Fix pty master read() after slave closes") fixed the +problem in case of n_tty_read, but the problem still exists for n_tty_poll. +This can be seen by running 'for ((i=0; i<100;i++));do ./test.py ;done' +where test.py is: + +import os, select, pty + +(pid, pty_fd) = pty.fork() + +if pid == 0: + os.write(1, 'This string should be received by parent') +else: + poller = select.epoll() + poller.register( pty_fd, select.EPOLLIN ) + ready = poller.poll( 1 * 1000 ) + for fd, events in ready: + if not events & select.EPOLLIN: + print 'missed POLLIN event' + else: + print os.read(fd, 100) + poller.close() + +The string from the slave is missed several times. +This patch takes the same approach as the fix for read and special cases +this condition for poll. +Tested on 3.16. + +Signed-off-by: Francesco Ruggeri +Cc: Peter Hurley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/n_tty.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/tty/n_tty.c ++++ b/drivers/tty/n_tty.c +@@ -2417,12 +2417,17 @@ static unsigned int n_tty_poll(struct tt + + poll_wait(file, &tty->read_wait, wait); + poll_wait(file, &tty->write_wait, wait); ++ if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) ++ mask |= POLLHUP; + if (input_available_p(tty, 1)) + mask |= POLLIN | POLLRDNORM; ++ else if (mask & POLLHUP) { ++ tty_flush_to_ldisc(tty); ++ if (input_available_p(tty, 1)) ++ mask |= POLLIN | POLLRDNORM; ++ } + if (tty->packet && tty->link->ctrl_status) + mask |= POLLPRI | POLLIN | POLLRDNORM; +- if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) +- mask |= POLLHUP; + if (tty_hung_up_p(file)) + mask |= POLLHUP; + if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) {