diff options
author | Anantha Idapalapati <aidapalapati@nvidia.com> | 2010-02-09 18:56:15 +0530 |
---|---|---|
committer | Anantha Idapalapati <aidapalapati@nvidia.com> | 2010-02-10 12:29:10 +0530 |
commit | beaceeddee0cee9cffac428c8810fef0feb03bdf (patch) | |
tree | c444efd42a32792ab20f2833cc0a52224fdcedc2 /drivers | |
parent | 74e09ca19e0b34c8172bb67ae03fcd14cdc5f209 (diff) |
serial: Fix lock-up caused by the recursive calls to UART spin-lock
Replacing the spin_lock(), spin_unlock() functions used in ISR with
spin_lock_irqsave(), spin_unlock_irqrequest() functions.
Change-Id: Ib7639e3dc790c2b8471098b8a435d8800adae72c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/tegra_hsuart.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c index e409b4ef8438..fceaf918cc0f 100644 --- a/drivers/serial/tegra_hsuart.c +++ b/drivers/serial/tegra_hsuart.c @@ -443,14 +443,15 @@ static irqreturn_t tegra_uart_isr(int irq, void *data) struct tegra_uart_port *t; unsigned char iir_fcr; unsigned char ier; + unsigned long flags; - spin_lock(&u->lock); + spin_lock_irqsave(&u->lock, flags); t = container_of(u, struct tegra_uart_port, uport); /* FIXME why do we need to loop here? */ while (1) { iir_fcr = readb(t->regs + UART_IIR_FCR_0); if (iir_fcr & NV_DRF_DEF(UART, IIR_FCR, IS_STA, NO_INTR_PEND)) { - spin_unlock(&u->lock); + spin_unlock_irqrestore(&u->lock, flags); return IRQ_HANDLED; } @@ -481,9 +482,9 @@ static irqreturn_t tegra_uart_isr(int irq, void *data) } else { do_handle_rx_pio(u); - spin_unlock(&u->lock); + spin_unlock_irqrestore(&u->lock, flags); tty_flip_buffer_push(u->info->port.tty); - spin_lock(&u->lock); + spin_lock_irqsave(&u->lock, flags); } break; case 3: /* Receive error */ |