Commit ee815f3a76a0d874bd29635366af572fb6ebe535

Authored by Mayank Rana
Committed by Greg Kroah-Hartman
1 parent 8431de80da

msm_serial_hs: Fix spinlock recursion in handling CTS

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>

Showing 1 changed file with 2 additions and 5 deletions Side-by-side Diff

drivers/tty/serial/msm_serial_hs.c
... ... @@ -1087,12 +1087,10 @@
1087 1087 }
1088 1088  
1089 1089 /* Handle CTS changes (Called from interrupt handler) */
1090   -static void msm_hs_handle_delta_cts(struct uart_port *uport)
  1090 +static void msm_hs_handle_delta_cts_locked(struct uart_port *uport)
1091 1091 {
1092   - unsigned long flags;
1093 1092 struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
1094 1093  
1095   - spin_lock_irqsave(&uport->lock, flags);
1096 1094 clk_enable(msm_uport->clk);
1097 1095  
1098 1096 /* clear interrupt */
... ... @@ -1100,7 +1098,6 @@
1100 1098 uport->icount.cts++;
1101 1099  
1102 1100 clk_disable(msm_uport->clk);
1103   - spin_unlock_irqrestore(&uport->lock, flags);
1104 1101  
1105 1102 /* clear the IOCTL TIOCMIWAIT if called */
1106 1103 wake_up_interruptible(&uport->state->port.delta_msr_wait);
... ... @@ -1248,7 +1245,7 @@
1248 1245  
1249 1246 /* Change in CTS interrupt */
1250 1247 if (isr_status & UARTDM_ISR_DELTA_CTS_BMSK)
1251   - msm_hs_handle_delta_cts(uport);
  1248 + msm_hs_handle_delta_cts_locked(uport);
1252 1249  
1253 1250 spin_unlock_irqrestore(&uport->lock, flags);
1254 1251