Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:33 +0100
commit64a8c99980431c72c42795e7bbb7055369763d47 (patch)
treec722cd055e2f78581381818d18fc25cb7c1ebad3
parent8fee063b3e0d0446f3d856b3fd1484500fef8a65 (diff)
serial: sh-sci: Do not free irqs that have already been freed
-rw-r--r--patches.kernel.org/4.20.8-341-serial-sh-sci-Do-not-free-irqs-that-have-alrea.patch52
-rw-r--r--series.conf1
2 files changed, 53 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-341-serial-sh-sci-Do-not-free-irqs-that-have-alrea.patch b/patches.kernel.org/4.20.8-341-serial-sh-sci-Do-not-free-irqs-that-have-alrea.patch
new file mode 100644
index 0000000000..5f5211783c
--- /dev/null
+++ b/patches.kernel.org/4.20.8-341-serial-sh-sci-Do-not-free-irqs-that-have-alrea.patch
@@ -0,0 +1,52 @@
+From: Chris Brandt <chris.brandt@renesas.com>
+Date: Mon, 28 Jan 2019 13:25:56 -0500
+Subject: [PATCH] serial: sh-sci: Do not free irqs that have already been freed
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: 4d95987a32db53f3beca76f8c4c8309ef6a5f192
+
+commit 4d95987a32db53f3beca76f8c4c8309ef6a5f192 upstream.
+
+Since IRQs might be muxed on some parts, we need to pay attention when we
+are freeing them.
+Otherwise we get the ugly WARNING "Trying to free already-free IRQ 20".
+
+Fixes: 628c534ae735 ("serial: sh-sci: Improve support for separate TEI and DRI interrupts")
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/tty/serial/sh-sci.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
+index 21fd3f6ad28e..014944a41613 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -1921,7 +1921,7 @@ static int sci_request_irq(struct sci_port *port)
+
+ static void sci_free_irq(struct sci_port *port)
+ {
+- int i;
++ int i, j;
+
+ /*
+ * Intentionally in reverse order so we iterate over the muxed
+@@ -1937,6 +1937,13 @@ static void sci_free_irq(struct sci_port *port)
+ if (unlikely(irq < 0))
+ continue;
+
++ /* Check if already freed (irq was muxed) */
++ for (j = 0; j < i; j++)
++ if (port->irqs[j] == irq)
++ j = i + 1;
++ if (j > i)
++ continue;
++
+ free_irq(port->irqs[i], port);
+ kfree(port->irqstr[i]);
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 02327c6823..395738c716 100644
--- a/series.conf
+++ b/series.conf
@@ -1077,6 +1077,7 @@
patches.kernel.org/4.20.8-338-perf-tests-evsel-tp-sched-Fix-bitwise-operator.patch
patches.kernel.org/4.20.8-339-serial-fix-race-between-flush_to_ldisc-and-tty.patch
patches.kernel.org/4.20.8-340-serial-8250_pci-Make-PCI-class-test-non-fatal.patch
+ patches.kernel.org/4.20.8-341-serial-sh-sci-Do-not-free-irqs-that-have-alrea.patch
########################################################
# Build fixes that apply to the vanilla kernel too.