Skip to content

Commit

Permalink
msm_serial_hs: Fix spinlock recursion in handling CTS
Browse files Browse the repository at this point in the history
msm_hs_handle_delta_cts tries to acquire port->lock already acquired
by the callee function msm_hs_isr. Change function name to follow
"_locked" convention.

Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mayank Rana authored and Greg Kroah-Hartman committed Dec 10, 2011
1 parent 8431de8 commit ee815f3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/tty/serial/msm_serial_hs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,20 +1087,17 @@ static void msm_hs_config_port(struct uart_port *uport, int cfg_flags)
}

/* Handle CTS changes (Called from interrupt handler) */
static void msm_hs_handle_delta_cts(struct uart_port *uport)
static void msm_hs_handle_delta_cts_locked(struct uart_port *uport)
{
unsigned long flags;
struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);

spin_lock_irqsave(&uport->lock, flags);
clk_enable(msm_uport->clk);

/* clear interrupt */
msm_hs_write(uport, UARTDM_CR_ADDR, RESET_CTS);
uport->icount.cts++;

clk_disable(msm_uport->clk);
spin_unlock_irqrestore(&uport->lock, flags);

/* clear the IOCTL TIOCMIWAIT if called */
wake_up_interruptible(&uport->state->port.delta_msr_wait);
Expand Down Expand Up @@ -1248,7 +1245,7 @@ static irqreturn_t msm_hs_isr(int irq, void *dev)

/* Change in CTS interrupt */
if (isr_status & UARTDM_ISR_DELTA_CTS_BMSK)
msm_hs_handle_delta_cts(uport);
msm_hs_handle_delta_cts_locked(uport);

spin_unlock_irqrestore(&uport->lock, flags);

Expand Down

0 comments on commit ee815f3

Please sign in to comment.