diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-03-15 10:08:39 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-03-15 10:08:39 -0700 |
commit | 289ecf7b1c513ae2b94623dc64ac6e54af716175 (patch) | |
tree | ecd2ceffefa5acd366385bc19f55a9318dfd3864 /drivers/tty | |
parent | 4a534fe4943ce82f7099cbcd0723f3ecbe56ca55 (diff) | |
parent | 638b50f3bbb0c6b15b7bc0c5ff788560f2c44ed3 (diff) |
Merge "msm_serial_hs: Remove code dependency on flag tty_flush_receive"
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/msm_serial_hs.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c index a0efd6206bdb..137ce93e6303 100644 --- a/drivers/tty/serial/msm_serial_hs.c +++ b/drivers/tty/serial/msm_serial_hs.c @@ -253,7 +253,6 @@ struct msm_hs_port { struct workqueue_struct *hsuart_wq; /* hsuart workqueue */ struct mutex clk_mutex; /* mutex to guard against clock off/clock on */ struct work_struct disconnect_rx_endpoint; /* disconnect rx_endpoint */ - bool tty_flush_receive; enum uart_core_type uart_type; unsigned long bam_handle; resource_size_t bam_mem; @@ -1854,12 +1853,13 @@ static void msm_serial_hs_tx_tlet(unsigned long tlet_ptr) * Do the work buffer related work in BAM * mode that is equivalent to legacy mode */ + spin_lock_irqsave(&(msm_uport->uport.lock), flags); - if (!msm_uport->tty_flush_receive) + if (!uart_circ_empty(tx_buf)) tx_buf->tail = (tx_buf->tail + tx->tx_count) & ~UART_XMIT_SIZE; else - msm_uport->tty_flush_receive = false; + MSM_HS_DBG("%s:circ buffer is empty\n", __func__); tx->dma_in_flight = 0; @@ -1876,7 +1876,6 @@ static void msm_serial_hs_tx_tlet(unsigned long tlet_ptr) if (uart_circ_chars_pending(tx_buf) < WAKEUP_CHARS) uart_write_wakeup(uport); - spin_lock_irqsave(&(msm_uport->uport.lock), flags); if (msm_uport->tx.flush == FLUSH_STOP) { msm_uport->tx.flush = FLUSH_SHUTDOWN; wake_up(&msm_uport->tx.wait); @@ -2052,14 +2051,6 @@ static void msm_hs_enable_ms_locked(struct uart_port *uport) } -static void msm_hs_flush_buffer(struct uart_port *uport) -{ - struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport); - - if (msm_uport->tx.dma_in_flight) - msm_uport->tty_flush_receive = true; -} - /* * Standard API, Break Signal * @@ -2303,11 +2294,9 @@ static irqreturn_t msm_hs_isr(int irq, void *dev) /* Do not update tx_buf.tail if uart_flush_buffer already * called in serial core */ - if (!msm_uport->tty_flush_receive) + if (!uart_circ_empty(tx_buf)) tx_buf->tail = (tx_buf->tail + tx->tx_count) & ~UART_XMIT_SIZE; - else - msm_uport->tty_flush_receive = false; tx->dma_in_flight = 0; @@ -2732,8 +2721,6 @@ static int msm_hs_startup(struct uart_port *uport) tx->tx_ready_int_en = 0; tx->dma_in_flight = 0; rx->rx_cmd_exec = false; - msm_uport->tty_flush_receive = false; - MSM_HS_DBG("%s: Setting tty_flush_receive to false\n", __func__); if (!is_blsp_uart(msm_uport)) { tx->xfer.complete_func = msm_hs_dmov_tx_callback; @@ -3798,7 +3785,7 @@ static struct uart_ops msm_hs_ops = { .config_port = msm_hs_config_port, .release_port = msm_hs_release_port, .request_port = msm_hs_request_port, - .flush_buffer = msm_hs_flush_buffer, + .flush_buffer = NULL, .ioctl = msm_hs_ioctl, }; |