aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/serial.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-12-14 14:42:35 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-21 21:55:12 -0500
commitdc6d1cda044b24c3d9f8e4af0431887ebe3488ef (patch)
tree475596354e1a9e3d861ee02e50e0b82575377cb3 /arch/arm/mach-omap2/serial.c
parentbd36179eec2827cd60b4a8c6e180cc030c74a4ec (diff)
OMAP2+: hwmod: upgrade per-hwmod mutex to a spinlock
Change the per-hwmod mutex to a spinlock. (The per-hwmod lock serializes most post-initialization hwmod operations such as enable, idle, and shutdown.) Spinlocks are needed, because in some cases, hwmods must be enabled from timer interrupt disabled-context, such as an ISR. The current use-case that is driving this is the OMAP GPIO block ISR: it can trigger interrupts even with its clocks disabled, but these clocks are needed for register accesses in the ISR to succeed. This patch also effectively reverts commit 848240223c35fcc71c424ad51a8e8aef42d3879c - this patch makes _omap_hwmod_enable() and _omap_hwmod_init() static, renames them back to _enable() and _idle(), and changes their callers to call the spinlocking versions. Previously, since omap_hwmod_{enable,init}() attempted to take mutexes, these functions could not be called while the timer interrupt was disabled; but now that the functions use spinlocks and save and restore the IRQ state, it is appropriate to call them directly. Kevin Hilman <khilman@deeprootsystems.com> originally proposed this patch - thanks Kevin. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: BenoƮt Cousson <b-cousson@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r--arch/arm/mach-omap2/serial.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 9dc077e2d8af..0548bbd43407 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -106,21 +106,16 @@ struct omap_uart_state {
106static LIST_HEAD(uart_list); 106static LIST_HEAD(uart_list);
107static u8 num_uarts; 107static u8 num_uarts;
108 108
109/*
110 * Since these idle/enable hooks are used in the idle path itself
111 * which has interrupts disabled, use the non-locking versions of
112 * the hwmod enable/disable functions.
113 */
114static int uart_idle_hwmod(struct omap_device *od) 109static int uart_idle_hwmod(struct omap_device *od)
115{ 110{
116 _omap_hwmod_idle(od->hwmods[0]); 111 omap_hwmod_idle(od->hwmods[0]);
117 112
118 return 0; 113 return 0;
119} 114}
120 115
121static int uart_enable_hwmod(struct omap_device *od) 116static int uart_enable_hwmod(struct omap_device *od)
122{ 117{
123 _omap_hwmod_enable(od->hwmods[0]); 118 omap_hwmod_enable(od->hwmods[0]);
124 119
125 return 0; 120 return 0;
126} 121}