aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/imx.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2021-03-22 12:10:36 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-23 10:32:44 +0100
commit9baedb7baeda68494bc96005612de0ca8d360a5d (patch)
treefe6e602d657f07a104df5358d7308da0e09d86e5 /drivers/tty/serial/imx.c
parentserial: pch_uart: fix build error with !CONFIG_DEBUG_FS (diff)
downloadlinux-dev-9baedb7baeda68494bc96005612de0ca8d360a5d.tar.xz
linux-dev-9baedb7baeda68494bc96005612de0ca8d360a5d.zip
serial: imx: drop workaround for forced irq threading
Force-threaded interrupt handlers used to run with interrupts enabled, something which could lead to deadlocks in case a threaded handler shared a lock with code running in hard interrupt context (e.g. timer callbacks) and did not explicitly disable interrupts. This was specifically the case for serial drivers that take the port lock in their console write path as printk can be called from hard interrupt context also with forced threading ("threadirqs"). Since commit 81e2073c175b ("genirq: Disable interrupts for force threaded handlers") interrupt handlers always run with interrupts disabled on non-RT so that drivers no longer need to do handle this. Drop the now obsolete workaround added by commit 33f16855dcb9 ("tty: serial: imx: fix potential deadlock"). Cc: Sam Nobs <samuel.nobs@taitradio.com> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20210322111036.31966-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/imx.c')
-rw-r--r--drivers/tty/serial/imx.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 3f69356937ef..7d5a8dfa3e91 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -918,14 +918,8 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id)
struct imx_port *sport = dev_id;
unsigned int usr1, usr2, ucr1, ucr2, ucr3, ucr4;
irqreturn_t ret = IRQ_NONE;
- unsigned long flags = 0;
- /*
- * IRQs might not be disabled upon entering this interrupt handler,
- * e.g. when interrupt handlers are forced to be threaded. To support
- * this scenario as well, disable IRQs when acquiring the spinlock.
- */
- spin_lock_irqsave(&sport->port.lock, flags);
+ spin_lock(&sport->port.lock);
usr1 = imx_uart_readl(sport, USR1);
usr2 = imx_uart_readl(sport, USR2);
@@ -995,7 +989,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id)
ret = IRQ_HANDLED;
}
- spin_unlock_irqrestore(&sport->port.lock, flags);
+ spin_unlock(&sport->port.lock);
return ret;
}