summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2010-09-06 23:19:10 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2010-09-16 23:21:17 -0700
commit22e87c5d5a1a35f1afb5a3a68f537f46716afacf (patch)
tree6bb70741814c326794fb5515d960261dfcc1fc1e
parent42775c2b0e8d044aa63114b9a253c6619a958f0a (diff)
[arm/tegra] serial: Fixing Tx to work in case of out of dma.
When system runs out of dma and uart driver tries to allocate dma, the dma allocation fails. In such case, the uart communication should work with interrupt based -non dma mode. bug 730003 (cherry picked from commit 4a9d5633474c806799ccc6d167f3d624c92d560c) (cherry picked from commit 2000a076103c559446d11ad49debc4e0f2952e8a) Change-Id: I96c2a3f79fd9044e3b54771b60cad7dcb12f517b Reviewed-on: http://git-master/r/6599 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rwxr-xr-xdrivers/serial/tegra_hsuart.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c
index 3cffbf0a1dfe..b965a00e6954 100755
--- a/drivers/serial/tegra_hsuart.c
+++ b/drivers/serial/tegra_hsuart.c
@@ -240,7 +240,7 @@ static void tegra_start_next_tx(struct tegra_uart_port *t)
if (count == 0)
goto out;
- if (TX_FORCE_PIO || count < TEGRA_UART_MIN_DMA)
+ if (TX_FORCE_PIO || count < TEGRA_UART_MIN_DMA || !t->use_tx_dma)
tegra_start_pio_tx(t, count);
else if (BYTES_TO_ALIGN(tail) > 0)
tegra_start_pio_tx(t, BYTES_TO_ALIGN(tail));
@@ -896,6 +896,8 @@ static int tegra_startup(struct uart_port *u)
t->uport.state->xmit.buf,
UART_XMIT_SIZE,
DMA_TO_DEVICE);
+ } else {
+ dev_info(u->dev, "Dma allocation failed for Tx\n");
}
}
t->tx_in_progress = 0;
@@ -904,6 +906,9 @@ static int tegra_startup(struct uart_port *u)
if (!RX_FORCE_PIO) {
if (!tegra_uart_init_rx_dma(t))
t->use_rx_dma = true;
+ else
+ dev_info(u->dev, "Dma allocation failed for Rx\n");
+
}
ret = tegra_uart_hw_init(t);