Skip to content

Commit 6f3c3ca

Browse files
jhovoldgregkh
authored andcommitted
serial: qcom-geni: disable interrupts during console writes
Disable the GENI interrupts during console writes to reduce the risk of having interrupt handlers spinning on the port lock on other cores for extended periods of time. This can, for example, reduce the total amount of time spent in the interrupt handler during boot of the x1e80100 CRD by up to a factor nine (e.g. from 274 ms to 30 ms) while the worst case processing time drops from 19 ms to 8 ms. Fixes: c4f5287 ("tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP") Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cc4a0e5 commit 6f3c3ca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s,
477477
{
478478
struct uart_port *uport;
479479
struct qcom_geni_serial_port *port;
480+
u32 m_irq_en, s_irq_en;
480481
bool locked = true;
481482
unsigned long flags;
482483

@@ -492,6 +493,11 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s,
492493
else
493494
uart_port_lock_irqsave(uport, &flags);
494495

496+
m_irq_en = readl(uport->membase + SE_GENI_M_IRQ_EN);
497+
s_irq_en = readl(uport->membase + SE_GENI_S_IRQ_EN);
498+
writel(0, uport->membase + SE_GENI_M_IRQ_EN);
499+
writel(0, uport->membase + SE_GENI_S_IRQ_EN);
500+
495501
if (qcom_geni_serial_main_active(uport)) {
496502
/* Wait for completion or drain FIFO */
497503
if (!locked || port->tx_remaining == 0)
@@ -504,6 +510,9 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s,
504510

505511
__qcom_geni_serial_console_write(uport, s, count);
506512

513+
writel(m_irq_en, uport->membase + SE_GENI_M_IRQ_EN);
514+
writel(s_irq_en, uport->membase + SE_GENI_S_IRQ_EN);
515+
507516
if (locked)
508517
uart_port_unlock_irqrestore(uport, flags);
509518
}

0 commit comments

Comments
 (0)