tty: serial: OMAP: block sleep on TX sz_beta4
authorGrazvydas Ignotas <notasas@gmail.com>
Fri, 27 Apr 2012 15:28:09 +0000 (18:28 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 27 Apr 2012 23:14:11 +0000 (02:14 +0300)
Hacky version of Paul Walmsley's fix for newer kernels.

arch/arm/mach-omap2/serial.c
arch/arm/plat-omap/include/plat/omap-serial.h
drivers/tty/serial/omap-serial.c

index c61ba57..3b6756e 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/serial_8250.h>
 #include <linux/pm_runtime.h>
 #include <linux/console.h>
+#include <linux/module.h>
 
 #ifdef CONFIG_SERIAL_OMAP
 #include <plat/omap-serial.h>
@@ -375,6 +376,19 @@ static void omap_uart_allow_sleep(struct omap_uart_state *uart)
        del_timer(&uart->timer);
 }
 
+void omap_uart_block_sleep_id(int num)
+{
+       struct omap_uart_state *uart;
+
+       list_for_each_entry(uart, &uart_list, node) {
+               if (num == uart->num && uart->can_sleep) {
+                       omap_uart_block_sleep(uart);
+                       return;
+               }
+       }
+}
+EXPORT_SYMBOL(omap_uart_block_sleep_id);
+
 static void omap_uart_idle_timer(unsigned long data)
 {
        struct omap_uart_state *uart = (struct omap_uart_state *)data;
index bdd0ae7..07badbd 100644 (file)
@@ -116,4 +116,7 @@ struct uart_omap_port {
        unsigned long           port_activity;
 };
 
+/* HACK */
+void omap_uart_block_sleep_id(int num);
+
 #endif /* __OMAP_SERIAL_H__ */
index 4a2e12f..e448a36 100644 (file)
@@ -269,6 +269,7 @@ static void serial_omap_start_tx(struct uart_port *port)
        int ret = 0;
 
        if (!up->use_dma) {
+               omap_uart_block_sleep_id(up->pdev->id);
                serial_omap_enable_ier_thri(up);
                return;
        }