serial: tegra_hsuart: Call rx_done callback with lock held.
authorJaikumar Ganesh <jaikumar@google.com>
Tue, 14 Dec 2010 22:56:59 +0000 (14:56 -0800)
committerJaikumar Ganesh <jaikumar@google.com>
Wed, 15 Dec 2010 19:51:38 +0000 (11:51 -0800)
Similar to the exit_lpm callback which is called with the lock
held, call the rx_done callback with lock held.

Change-Id: I307d5191669ef6816d8406bb421b2c10c902f6a8
Signed-off-by: Jaikumar Ganesh <jaikumar@google.com>
drivers/serial/tegra_hsuart.c

index b0d1b8de8712ebaa37037014a313c8495de9c5b0..54d9fa6e0bf583d5b54393aaf3512ba15a212829 100644 (file)
@@ -312,9 +312,9 @@ static void tegra_rx_dma_complete_callback(struct tegra_dma_req *req)
        spin_unlock(&u->lock);
        tty_flip_buffer_push(u->state->port.tty);
 
+       spin_lock(&u->lock);
        if (t->rx_done_cb)
                t->rx_done_cb(u);
-       spin_lock(&u->lock);
 }
 
 /* Lock already taken */
@@ -532,9 +532,9 @@ static irqreturn_t tegra_uart_isr(int irq, void *data)
 
                                spin_unlock_irqrestore(&u->lock, flags);
                                tty_flip_buffer_push(u->state->port.tty);
+                               spin_lock_irqsave(&u->lock, flags);
                                if (t->rx_done_cb)
                                        t->rx_done_cb(u);
-                               spin_lock_irqsave(&u->lock, flags);
                        }
                        break;
                case 3: /* Receive error */