Skip to contentSkip to conversation

omap fixes for 2.6.33-rc6

PATCH New Tony Lindgren 3 participants 16 messages Feb 3, 2010

Subsystems (6)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

cover omap fixes for 2.6.33-rc6

Hi all,

Here are some omap fixes for review.

Regards,

Tony

---

Kevin Hilman (2):
OMAP2/3: IRQ: ensure valid base address
OMAP2/3: GPMC: ensure valid clock pointer

Marek Skuczynski (1):
omap: Fix access to already released memory in clk_debugfs_register_one()

Sriram (1):
ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP

Tony Lindgren (4):
omap: Remove old unused defines for OMAP_32KSYNCT_BASE
omap: Fix 3630 mux errors
omap: Fix arch/arm/mach-omap2/mux.c: Off by one error
omap: Disable serial port autoidle by default

Uwe Kleine-König (1):
omap: define _toggle_gpio_edge_triggering only for OMAP1

 arch/arm/Kconfig                 |    1 +
 arch/arm/mach-omap2/gpmc.c       |    5 +++-
 arch/arm/mach-omap2/irq.c        |    4 ++-
 arch/arm/mach-omap2/mux.c        |   10 +++++++-
 arch/arm/mach-omap2/mux34xx.c    |   47 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/serial.c     |    8 ++++++
 arch/arm/plat-omap/clock.c       |    4 ++-
 arch/arm/plat-omap/gpio.c        |    4 ++-
 arch/arm/plat-omap/omap_device.c |   10 --------
 9 files changed, 75 insertions(+), 18 deletions(-)
Signature · 5 lines
Signature
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author maintainer
#1 lore raw

PATCH 1/9 omap: define _toggle_gpio_edge_triggering only for OMAP1

From: Uwe Kleine-König <[email protected]>

The only usage of _toggle_gpio_edge_triggering is in an CONFIG_ARCH_OMAP1 is defined, too.

This fixes a compiler warning:

arch/arm/plat-omap/gpio.c:758: warning: '_toggle_gpio_edge_triggering' defined but not used

when compiling for ARCH_OMAP2, ARCH_OMAP3 or ARCH_OMAP4.

---
 arch/arm/plat-omap/gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-omap/gpio.c +2 -2
index d17620c..d2422c7 100644
@@ -750,6 +750,7 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
 }
 #endif
 
+#ifdef CONFIG_ARCH_OMAP1
 /*
  * This only applies to chips that can't do both rising and falling edge
  * detection at once.  For all other chips, this function is a noop.
@@ -760,11 +761,9 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio)
 	u32 l = 0;
 
 	switch (bank->method) {
-#ifdef CONFIG_ARCH_OMAP1
 	case METHOD_MPUIO:
 		reg += OMAP_MPUIO_GPIO_INT_EDGE;
 		break;
-#endif
 #ifdef CONFIG_ARCH_OMAP15XX
 	case METHOD_GPIO_1510:
 		reg += OMAP1510_GPIO_INT_CONTROL;
@@ -787,6 +786,7 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio)
 
 	__raw_writel(l, reg);
 }
+#endif
 
 static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 {

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH 1/9 omap: define _toggle_gpio_edge_triggering only for OMAP1

Hi Tony,

Quoted 4 lines · Tony Lindgren

From: Uwe Kleine-K?nig <[email protected]>

The only usage of _toggle_gpio_edge_triggering is in an CONFIG_ARCH_OMAP1 is defined, too.

This sentence is broken, isn't it? I guess git commit played tricks on me here and removed a line, something like:

	#ifdef CONFIG_ARCH_OMAP1 block, so only provide it if

Can you add it back? I'd recommend doing the line break before the "an" in the first line instead of behind it.

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
author maintainer
#3 lore raw

PATCH 1/9 omap: define _toggle_gpio_edge_triggering only for OMAP1

Quoted 7 lines · Uwe Kleine-König

Hi Tony,

Quoted 4 lines · Tony Lindgren

From: Uwe Kleine-König <[email protected]>

The only usage of _toggle_gpio_edge_triggering is in an CONFIG_ARCH_OMAP1 is defined, too.

Quoted 7 lines

This sentence is broken, isn't it? I guess git commit played tricks on me here and removed a line, something like:

	#ifdef CONFIG_ARCH_OMAP1 block, so only provide it if

Can you add it back? I'd recommend doing the line break before the "an" in the first line instead of behind it.

Sure, updated patch below. The description makes more sense now :)

BTW, looks like with "git show --pretty=email" the From: field gets messed up in the patch below. Author name shows OK in git though.

I wonder if that's a git bug for --pretty=email? Using version 1.6.6.1 it seems.

Tony

Quoted 1 line

From 9198bcd39f558dd56823f1c9983e2252fc99a501 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]>
Date: Fri, 29 Jan 2010 14:20:05 -0800
Subject: [PATCH] omap: define _toggle_gpio_edge_triggering only for OMAP1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The only usage of _toggle_gpio_edge_triggering is in an #ifdef CONFIG_ARCH_OMAP1 block, so only provide it if CONFIG_ARCH_OMAP1 is defined, too.

This fixes a compiler warning:

arch/arm/plat-omap/gpio.c:758: warning: '_toggle_gpio_edge_triggering' defined but not used

when compiling for ARCH_OMAP2, ARCH_OMAP3 or ARCH_OMAP4.

arch/arm/plat-omap/gpio.c +2 -2
index d17620c..d2422c7 100644
@@ -750,6 +750,7 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
 }
 #endif
 
+#ifdef CONFIG_ARCH_OMAP1
 /*
  * This only applies to chips that can't do both rising and falling edge
  * detection at once.  For all other chips, this function is a noop.
@@ -760,11 +761,9 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio)
 	u32 l = 0;
 
 	switch (bank->method) {
-#ifdef CONFIG_ARCH_OMAP1
 	case METHOD_MPUIO:
 		reg += OMAP_MPUIO_GPIO_INT_EDGE;
 		break;
-#endif
 #ifdef CONFIG_ARCH_OMAP15XX
 	case METHOD_GPIO_1510:
 		reg += OMAP1510_GPIO_INT_CONTROL;
@@ -787,6 +786,7 @@ static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio)
 
 	__raw_writel(l, reg);
 }
+#endif
 
 static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 {
#4 lore raw

PATCH 1/9 omap: define _toggle_gpio_edge_triggering only for OMAP1

Hello Tony,

Quoted 5 lines · Tony Lindgren

BTW, looks like with "git show --pretty=email" the From: field gets messed up in the patch below. Author name shows OK in git though.

I wonder if that's a git bug for --pretty=email? Using version 1.6.6.1 it seems.

That's not a bug, but a feature. This is normal rfcforgotthenumber mail header quoting. (2822?)

Quoted 5 lines

Tony

From 9198bcd39f558dd56823f1c9983e2252fc99a501 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]>

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
author maintainer
#5 lore raw

PATCH 1/9 omap: define _toggle_gpio_edge_triggering only for OMAP1

Quoted 10 lines · Uwe Kleine-K?nig

Hello Tony,

Quoted 5 lines · Tony Lindgren

BTW, looks like with "git show --pretty=email" the From: field gets messed up in the patch below. Author name shows OK in git though.

I wonder if that's a git bug for --pretty=email? Using version 1.6.6.1 it seems.

That's not a bug, but a feature. This is normal rfcforgotthenumber mail header quoting. (2822?)

Oh right, the email headers need to be ASCII still. Was not aware of how umlauts should be encoded into the name though. It seems that all my fellow Finns have erased the umlauts from their email addresses, at least in my aliases file.

Tony

Quoted 13 lines
Quoted 6 lines

Tony

From 9198bcd39f558dd56823f1c9983e2252fc99a501 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]>

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
author maintainer
#6 lore raw

PATCH 2/9 omap: Remove old unused defines for OMAP_32KSYNCT_BASE

In reply to Tony Lindgren

Remove old unused defines for OMAP_32KSYNCT_BASE

---
 arch/arm/plat-omap/omap_device.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
arch/arm/plat-omap/omap_device.c +0 -10
index 1e5648d..2ed7201 100644
@@ -89,16 +89,6 @@
 #define USE_WAKEUP_LAT			0
 #define IGNORE_WAKEUP_LAT		1
 
-/* XXX this should be moved into a separate file */
-#if defined(CONFIG_ARCH_OMAP2420)
-# define OMAP_32KSYNCT_BASE		0x48004000
-#elif defined(CONFIG_ARCH_OMAP2430)
-# define OMAP_32KSYNCT_BASE		0x49020000
-#elif defined(CONFIG_ARCH_OMAP3430)
-# define OMAP_32KSYNCT_BASE		0x48320000
-#else
-# error Unknown OMAP device
-#endif
 
 /* Private functions */
 
author maintainer
#7 lore raw

PATCH 3/9 ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP

In reply to Tony Lindgren

From: Sriram <[email protected]>

OMAP platforms(like OMAP3530) include DSP or other co-processors for media acceleration. when carving out memory for the accelerators we can end up creating a hole in the memory map of sort:
<kernel memory><hole(memory for accelerator)><kernel memory>

To handle such a memory configuration ARCH_HAS_HOLES_MEMORYMODEL has to be enabled. For further information refer discussion at:
http://www.mail-archive.com/[email protected]/msg15262.html.

---
 arch/arm/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/Kconfig +1 -0
index 4c33ca8..184a6bd 100644
@@ -702,6 +702,7 @@ config ARCH_OMAP
 	select ARCH_HAS_CPUFREQ
 	select GENERIC_TIME
 	select GENERIC_CLOCKEVENTS
+	select ARCH_HAS_HOLES_MEMORYMODEL
 	help
 	  Support for TI's OMAP platform (OMAP1 and OMAP2).
 
author maintainer
#8 lore raw

PATCH 4/9 OMAP2/3: IRQ: ensure valid base address

In reply to Tony Lindgren

From: Kevin Hilman <[email protected]>

Ensure valid base address during IRQ init. Fixes compiler warning about potential use of uninitialized variable.

---
 arch/arm/mach-omap2/irq.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/irq.c +3 -1
index 2705402..26aeef5 100644
@@ -194,7 +194,7 @@ void __init omap_init_irq(void)
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
-		unsigned long base;
+		unsigned long base = 0;
 		struct omap_irq_bank *bank = irq_banks + i;
 
 		if (cpu_is_omap24xx())
@@ -202,6 +202,8 @@ void __init omap_init_irq(void)
 		else if (cpu_is_omap34xx())
 			base = OMAP34XX_IC_BASE;
 
+		BUG_ON(!base);
+
 		/* Static mapping, never released */
 		bank->base_reg = ioremap(base, SZ_4K);
 		if (!bank->base_reg) {
author maintainer
#9 lore raw

PATCH 5/9 OMAP2/3: GPMC: ensure valid clock pointer

In reply to Tony Lindgren

From: Kevin Hilman <[email protected]>

Ensure valid clock pointer during GPMC init. Fixes compiler warning about potential use of uninitialized variable.

---
 arch/arm/mach-omap2/gpmc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/gpmc.c +4 -1
index 3f1334f..7027cdc 100644
@@ -505,7 +505,7 @@ static void __init gpmc_mem_init(void)
 void __init gpmc_init(void)
 {
 	u32 l;
-	char *ck;
+	char *ck = NULL;
 
 	if (cpu_is_omap24xx()) {
 		ck = "core_l3_ck";
@@ -521,6 +521,9 @@ void __init gpmc_init(void)
 		l = OMAP44XX_GPMC_BASE;
 	}
 
+	if (WARN_ON(!ck))
+		return;
+
 	gpmc_l3_clk = clk_get(NULL, ck);
 	if (IS_ERR(gpmc_l3_clk)) {
 		printk(KERN_ERR "Could not get GPMC clock %s\n", ck);
author maintainer
#10 lore raw

PATCH 6/9 omap: Fix 3630 mux errors

In reply to Tony Lindgren

3630 has more mux signals than 34xx. The additional pins exist in omap36xx_cbp_subset, but are not initialized as the superset is missing these offsets. This causes the following errors during the boot:

mux: Unknown entry offset 0x236
mux: Unknown entry offset 0x22e
mux: Unknown entry offset 0x1ec
mux: Unknown entry offset 0x1ee
mux: Unknown entry offset 0x1f4
mux: Unknown entry offset 0x1f6
mux: Unknown entry offset 0x1f8
mux: Unknown entry offset 0x1fa
mux: Unknown entry offset 0x1fc
mux: Unknown entry offset 0x22a
mux: Unknown entry offset 0x226
mux: Unknown entry offset 0x230
mux: Unknown entry offset 0x22c
mux: Unknown entry offset 0x228

Fix this by adding the missing offsets to omap3 superset. Note that additionally the uninitialized pins need to be skipped on 34xx.

Based on an earlier patch by Allen Pais <[email protected]>.

---
 arch/arm/mach-omap2/mux.c     |    7 ++++++
 arch/arm/mach-omap2/mux34xx.c |   47 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/mux.c +7 -0
index 3f59bd1..19001dd 100644
@@ -968,6 +968,13 @@ static void __init omap_mux_init_list(struct omap_mux *superset)
 		}
 #endif
 
+#if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS)
+		if (!superset->muxnames || !superset->muxnames[0]) {
+			superset++;
+			continue;
+		}
+#endif
+
 		entry = omap_mux_list_add(superset);
 		if (!entry) {
 			printk(KERN_ERR "mux: Could not add entry\n");
arch/arm/mach-omap2/mux34xx.c +47 -0

53 lines not on this page · raw message

author maintainer
#11 lore raw

PATCH 7/9 omap: Fix arch/arm/mach-omap2/mux.c: Off by one error

In reply to Tony Lindgren

David Binderman ran the sourceforge tool cppcheck over the source code of the new Linux kernel 2.6.33-rc6:

[./arm/mach-omap2/mux.c:492]: (error) Buffer access out-of-bounds

13 characters + 1 digit + 1 zero byte is more than 14 characters.

Also add a comment on mode0 name length in case new omaps start using longer names.

---
 arch/arm/mach-omap2/mux.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mux.c +2 -1
index 19001dd..5fedc50 100644
@@ -486,7 +486,7 @@ int __init omap_mux_init_signal(char *muxname, int val)
 static inline void omap_mux_decode(struct seq_file *s, u16 val)
 {
 	char *flags[OMAP_MUX_MAX_NR_FLAGS];
-	char mode[14];
+	char mode[sizeof("OMAP_MUX_MODE") + 1];
 	int i = -1;
 
 	sprintf(mode, "OMAP_MUX_MODE%d", val & 0x7);
@@ -553,6 +553,7 @@ static int omap_mux_dbg_board_show(struct seq_file *s, void *unused)
 		if (!m0_name)
 			continue;
 
+		/* REVISIT: Needs to be updated if mode0 names get longer */
 		for (i = 0; i < OMAP_MUX_DEFNAME_LEN; i++) {
 			if (m0_name[i] == '\0') {
 				m0_def[i] = m0_name[i];
author maintainer
#12 lore raw

PATCH 8/9 omap: Fix access to already released memory in clk_debugfs_register_one()

In reply to Tony Lindgren

From: Marek Skuczynski <[email protected]>

I have found an access to already released memory in clk_debugfs_register_one() function.

---
 arch/arm/plat-omap/clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-omap/clock.c +2 -2
index d9f8c84..4becbdd 100644
@@ -391,7 +391,7 @@ static struct dentry *clk_debugfs_root;
 static int clk_debugfs_register_one(struct clk *c)
 {
 	int err;
-	struct dentry *d, *child;
+	struct dentry *d, *child, *child_tmp;
 	struct clk *pa = c->parent;
 	char s[255];
 	char *p = s;
@@ -423,7 +423,7 @@ static int clk_debugfs_register_one(struct clk *c)
 
 err_out:
 	d = c->dent;
-	list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
+	list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
 		debugfs_remove(child);
 	debugfs_remove(c->dent);
 	return err;
author maintainer
#13 lore raw

PATCH 9/9 omap: Disable serial port autoidle by default

In reply to Tony Lindgren

Currently the omap serial clocks are autoidled after 5 seconds. However, this causes lost characters on the serial ports. As this is considered non-standard behaviour for Linux, disable the timeout.

Note that this will also cause blocking of any deeper omap sleep states.

To enable the autoidling of the serial ports, do something like this for each serial port:

# echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout
# echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout
...
---
 arch/arm/mach-omap2/serial.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/serial.c +7 -1
index 8c964be..fa852f3 100644
@@ -36,7 +36,13 @@
 #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV	0x52
 #define UART_OMAP_WER		0x17	/* Wake-up enable register */
 
-#define DEFAULT_TIMEOUT (5 * HZ)
+/*
+ * NOTE: By default the serial timeout is disabled as it causes lost characters
+ * over the serial ports. This means that the UART clocks will stay on until
+ * disabled via sysfs. This also causes that any deeper omap sleep states are
+ * blocked. 
+ */
+#define DEFAULT_TIMEOUT 0
 
 struct omap_uart_state {
 	int num;
author maintainer
#14 lore raw

PATCH 9/9 omap: Disable serial port autoidle by default

Quoted 7 lines · Tony Lindgren

Currently the omap serial clocks are autoidled after 5 seconds. However, this causes lost characters on the serial ports. As this is considered non-standard behaviour for Linux, disable the timeout.

Note that this will also cause blocking of any deeper omap sleep states.

Quoted 6 lines

To enable the autoidling of the serial ports, do something like this for each serial port:

# echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout
# echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout
...

Turns out we also need to disable the timer in init, otherwise the very first character after boot can get corrupt.

Updated version below, Kevin can you take one more look and see if your S-O-B is still valid? :)

Regards,

Tony

Quoted 1 line

From ff7ce25ec59223bf987ad209c1eb183031811c07 Mon Sep 17 00:00:00 2001

From: Tony Lindgren <[email protected]>
Date: Mon, 1 Feb 2010 12:34:31 -0800
Subject: [PATCH] omap: Disable serial port autoidle by default

Currently the omap serial clocks are autoidled after 5 seconds. However, this causes lost characters on the serial ports. As this is considered non-standard behaviour for Linux, disable the timeout.

Note that this will also cause blocking of any deeper omap sleep states.

To enable the autoidling of the serial ports, do something like this for each serial port:

# echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout
# echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout
...
arch/arm/mach-omap2/serial.c +9 -2
index 8c964be..e10a02d 100644
@@ -36,7 +36,13 @@
 #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV	0x52
 #define UART_OMAP_WER		0x17	/* Wake-up enable register */
 
-#define DEFAULT_TIMEOUT (5 * HZ)
+/*
+ * NOTE: By default the serial timeout is disabled as it causes lost characters
+ * over the serial ports. This means that the UART clocks will stay on until
+ * disabled via sysfs. This also causes that any deeper omap sleep states are
+ * blocked. 
+ */
+#define DEFAULT_TIMEOUT 0
 
 struct omap_uart_state {
 	int num;
@@ -422,7 +428,8 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
 	uart->timeout = DEFAULT_TIMEOUT;
 	setup_timer(&uart->timer, omap_uart_idle_timer,
 		    (unsigned long) uart);
-	mod_timer(&uart->timer, jiffies + uart->timeout);
+	if (uart->timeout)
+		mod_timer(&uart->timer, jiffies + uart->timeout);
 	omap_uart_smart_idle_enable(uart, 0);
 
 	if (cpu_is_omap34xx()) {
#15 lore raw

PATCH 9/9 omap: Disable serial port autoidle by default

Quoted 15 lines · Tony Lindgren
Quoted 7 lines · Tony Lindgren

Currently the omap serial clocks are autoidled after 5 seconds. However, this causes lost characters on the serial ports. As this is considered non-standard behaviour for Linux, disable the timeout.

Note that this will also cause blocking of any deeper omap sleep states.

Quoted 6 lines

To enable the autoidling of the serial ports, do something like this for each serial port:

# echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout
# echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout
...
Quoted 5 lines

Turns out we also need to disable the timer in init, otherwise the very first character after boot can get corrupt.

Updated version below, Kevin can you take one more look and see if your S-O-B is still valid? :)

Yeah, looks right. s-o-b still valid.

Kevin

Quoted 54 lines

Regards,

Tony
From ff7ce25ec59223bf987ad209c1eb183031811c07 Mon Sep 17 00:00:00 2001
From: Tony Lindgren <[email protected]>
Date: Mon, 1 Feb 2010 12:34:31 -0800
Subject: [PATCH] omap: Disable serial port autoidle by default

Currently the omap serial clocks are autoidled after 5 seconds. However, this causes lost characters on the serial ports. As this is considered non-standard behaviour for Linux, disable the timeout.

Note that this will also cause blocking of any deeper omap sleep states.

To enable the autoidling of the serial ports, do something like this for each serial port:

# echo 5 > /sys/devices/platform/serial8250.0/sleep_timeout
# echo 5 > /sys/devices/platform/serial8250.1/sleep_timeout
...
arch/arm/mach-omap2/serial.c +9 -2
index 8c964be..e10a02d 100644
@@ -36,7 +36,13 @@
 #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV	0x52
 #define UART_OMAP_WER		0x17	/* Wake-up enable register */
 
-#define DEFAULT_TIMEOUT (5 * HZ)
+/*
+ * NOTE: By default the serial timeout is disabled as it causes lost characters
+ * over the serial ports. This means that the UART clocks will stay on until
+ * disabled via sysfs. This also causes that any deeper omap sleep states are
+ * blocked. 
+ */
+#define DEFAULT_TIMEOUT 0
 
 struct omap_uart_state {
 	int num;
@@ -422,7 +428,8 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
 	uart->timeout = DEFAULT_TIMEOUT;
 	setup_timer(&uart->timer, omap_uart_idle_timer,
 		    (unsigned long) uart);
-	mod_timer(&uart->timer, jiffies + uart->timeout);
+	if (uart->timeout)
+		mod_timer(&uart->timer, jiffies + uart->timeout);
 	omap_uart_smart_idle_enable(uart, 0);
 
 	if (cpu_is_omap34xx()) {