Paul Walmsley dc6d1cda04 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>
2010-12-21 19:55:12 -07:00
..
2010-05-20 12:31:06 -06:00
2010-06-16 18:03:14 +02:00
2010-10-05 12:05:11 -07:00
2010-02-15 09:27:05 -08:00
2010-12-07 16:26:57 -08:00
2010-12-21 19:55:12 -07:00
2010-12-21 14:30:40 -08:00
2010-07-05 16:31:36 +03:00
2010-07-05 16:31:36 +03:00
2010-12-21 14:30:40 -08:00
2010-12-17 15:13:44 -08:00
2010-02-23 10:57:40 -08:00
2010-07-05 16:31:40 +03:00
2010-10-22 10:22:16 -07:00