aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-11-29 17:36:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-29 17:36:07 -0500
commita9735c81a43054a7e8cb8771c8e04c01fcacde10 (patch)
tree53d0fa7f31240a95eb7a77cd555d87ce9c20472e /arch/arm
parentaa3fc52546b847f590d86a093afd863ff9081628 (diff)
parent0d8e2d0dad98a693bad88aea6876ac8b94ad95c6 (diff)
Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: OMAP2+: PM/serial: hold console semaphore while OMAP UARTs are disabled OMAP: UART: don't resume UARTs that are not enabled.
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/pm24xx.c7
-rw-r--r--arch/arm/mach-omap2/pm34xx.c10
-rw-r--r--arch/arm/mach-omap2/serial.c7
3 files changed, 23 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index a40457d81927..c85923e56b85 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -30,6 +30,7 @@
30#include <linux/irq.h> 30#include <linux/irq.h>
31#include <linux/time.h> 31#include <linux/time.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/console.h>
33 34
34#include <asm/mach/time.h> 35#include <asm/mach/time.h>
35#include <asm/mach/irq.h> 36#include <asm/mach/irq.h>
@@ -118,6 +119,10 @@ static void omap2_enter_full_retention(void)
118 if (omap_irq_pending()) 119 if (omap_irq_pending())
119 goto no_sleep; 120 goto no_sleep;
120 121
122 /* Block console output in case it is on one of the OMAP UARTs */
123 if (try_acquire_console_sem())
124 goto no_sleep;
125
121 omap_uart_prepare_idle(0); 126 omap_uart_prepare_idle(0);
122 omap_uart_prepare_idle(1); 127 omap_uart_prepare_idle(1);
123 omap_uart_prepare_idle(2); 128 omap_uart_prepare_idle(2);
@@ -131,6 +136,8 @@ static void omap2_enter_full_retention(void)
131 omap_uart_resume_idle(1); 136 omap_uart_resume_idle(1);
132 omap_uart_resume_idle(0); 137 omap_uart_resume_idle(0);
133 138
139 release_console_sem();
140
134no_sleep: 141no_sleep:
135 if (omap2_pm_debug) { 142 if (omap2_pm_debug) {
136 unsigned long long tmp; 143 unsigned long long tmp;
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 75c0cd13ad8e..0ec8a04b7473 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -28,6 +28,7 @@
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/console.h>
31 32
32#include <plat/sram.h> 33#include <plat/sram.h>
33#include <plat/clockdomain.h> 34#include <plat/clockdomain.h>
@@ -385,6 +386,12 @@ void omap_sram_idle(void)
385 omap3_enable_io_chain(); 386 omap3_enable_io_chain();
386 } 387 }
387 388
389 /* Block console output in case it is on one of the OMAP UARTs */
390 if (per_next_state < PWRDM_POWER_ON ||
391 core_next_state < PWRDM_POWER_ON)
392 if (try_acquire_console_sem())
393 goto console_still_active;
394
388 /* PER */ 395 /* PER */
389 if (per_next_state < PWRDM_POWER_ON) { 396 if (per_next_state < PWRDM_POWER_ON) {
390 omap_uart_prepare_idle(2); 397 omap_uart_prepare_idle(2);
@@ -463,6 +470,9 @@ void omap_sram_idle(void)
463 omap_uart_resume_idle(3); 470 omap_uart_resume_idle(3);
464 } 471 }
465 472
473 release_console_sem();
474
475console_still_active:
466 /* Disable IO-PAD and IO-CHAIN wakeup */ 476 /* Disable IO-PAD and IO-CHAIN wakeup */
467 if (omap3_has_io_wakeup() && 477 if (omap3_has_io_wakeup() &&
468 (per_next_state < PWRDM_POWER_ON || 478 (per_next_state < PWRDM_POWER_ON ||
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index becf0e38ef7e..d17960a1be25 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -27,6 +27,7 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/serial_8250.h> 28#include <linux/serial_8250.h>
29#include <linux/pm_runtime.h> 29#include <linux/pm_runtime.h>
30#include <linux/console.h>
30 31
31#ifdef CONFIG_SERIAL_OMAP 32#ifdef CONFIG_SERIAL_OMAP
32#include <plat/omap-serial.h> 33#include <plat/omap-serial.h>
@@ -406,7 +407,7 @@ void omap_uart_resume_idle(int num)
406 struct omap_uart_state *uart; 407 struct omap_uart_state *uart;
407 408
408 list_for_each_entry(uart, &uart_list, node) { 409 list_for_each_entry(uart, &uart_list, node) {
409 if (num == uart->num) { 410 if (num == uart->num && uart->can_sleep) {
410 omap_uart_enable_clocks(uart); 411 omap_uart_enable_clocks(uart);
411 412
412 /* Check for IO pad wakeup */ 413 /* Check for IO pad wakeup */
@@ -807,6 +808,8 @@ void __init omap_serial_init_port(int port)
807 808
808 oh->dev_attr = uart; 809 oh->dev_attr = uart;
809 810
811 acquire_console_sem(); /* in case the earlycon is on the UART */
812
810 /* 813 /*
811 * Because of early UART probing, UART did not get idled 814 * Because of early UART probing, UART did not get idled
812 * on init. Now that omap_device is ready, ensure full idle 815 * on init. Now that omap_device is ready, ensure full idle
@@ -831,6 +834,8 @@ void __init omap_serial_init_port(int port)
831 omap_uart_block_sleep(uart); 834 omap_uart_block_sleep(uart);
832 uart->timeout = DEFAULT_TIMEOUT; 835 uart->timeout = DEFAULT_TIMEOUT;
833 836
837 release_console_sem();
838
834 if ((cpu_is_omap34xx() && uart->padconf) || 839 if ((cpu_is_omap34xx() && uart->padconf) ||
835 (uart->wk_en && uart->wk_mask)) { 840 (uart->wk_en && uart->wk_mask)) {
836 device_init_wakeup(&od->pdev.dev, true); 841 device_init_wakeup(&od->pdev.dev, true);