[RFC PATCH] OMAP: Serial: Keep uart in no idle mode when DMA ongoing

From: Vikram Pandita
Date: Fri Aug 21 2009 - 12:15:58 EST


Keep UART in NoIdle mode when DMA is going on.

Only once UART transfers are complete, switch to smart idle and
allow OsIdle to kick in

Signed-off-by: Vikram Pandita <vikram.pandita@xxxxxx>
---
arch/arm/mach-omap2/serial.c | 12 ++++++++++++
drivers/serial/omap-serial.c | 2 +-
2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index ff9beb7..a6ee6ab 100755
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -359,9 +359,21 @@ static void omap_uart_allow_sleep(struct omap_uart_state *uart)
del_timer(&uart->timer);
}

+extern int are_driveromap_uarts_active(int *);
+
static void omap_uart_idle_timer(unsigned long data)
{
struct omap_uart_state *uart = (struct omap_uart_state *)data;
+ int dummy;
+
+ if (are_driveromap_uarts_active(&dummy)){
+ /* Keep UART on NoIdle when DMA channel is enabled in omap
+ * serial: do not allow UART to goto Smart-idle till its done
+ * dma'ing
+ */
+ omap_uart_block_sleep(uart);
+ return;
+ }

omap_uart_allow_sleep(uart);
}
diff --git a/drivers/serial/omap-serial.c b/drivers/serial/omap-serial.c
index 938f29f..f105e24 100644
--- a/drivers/serial/omap-serial.c
+++ b/drivers/serial/omap-serial.c
@@ -1641,6 +1641,7 @@ int omap24xx_uart_cts_wakeup(int uart_no, int state)
return 0;
}
EXPORT_SYMBOL(omap24xx_uart_cts_wakeup);
+#endif
/**
* are_driver8250_uarts_active() - Check if any ports managed by this
* driver are currently busy. This should be called with interrupts
@@ -1709,7 +1710,6 @@ int are_driveromap_uarts_active(int *driver8250_managed)
}
EXPORT_SYMBOL(are_driveromap_uarts_active);

-#endif

static void serial_omap_display_reg(struct uart_port *port)
{
--
1.6.3.3.334.g916e1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/