diff options
author | Paul Walmsley <paul@pwsan.com> | 2009-12-09 00:33:16 +0100 |
---|---|---|
committer | paul <paul@twilight.(none)> | 2009-12-12 01:00:43 +0100 |
commit | 6f8b7ff5b01e16a65c3b17865ce047faeca40907 (patch) | |
tree | ae5ecb4b377588b157c23176cf95a5c9631206ba /arch/arm/mach-omap2/prcm.c | |
parent | OMAP3: PM: Fix for MPU power domain MEM BANK position (diff) | |
download | linux-6f8b7ff5b01e16a65c3b17865ce047faeca40907.tar.xz linux-6f8b7ff5b01e16a65c3b17865ce047faeca40907.zip |
OMAP clock/hwmod: fix off-by-one errors
Fix loop bailout off-by-one bugs reported by Juha Leppänen
<juha_motorsportcom@luukku.com>.
This second version incorporates comments from Russell King
<linux@arm.linux.org.uk>. A new macro, 'omap_test_timeout', has
been created, with cleaner code, and existing code has been converted
to use it.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Juha Leppänen <juha_motorsportcom@luukku.com>
Cc: Russell King <linux@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2/prcm.c')
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 9208b6e873ae..79637c2eaf64 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c @@ -241,9 +241,8 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name) BUG(); /* Wait for lock */ - while (((__raw_readl(reg) & mask) != ena) && - (i++ < MAX_MODULE_ENABLE_WAIT)) - udelay(1); + omap_test_timeout(((__raw_readl(reg) & mask) == ena), + MAX_MODULE_ENABLE_WAIT, i); if (i < MAX_MODULE_ENABLE_WAIT) pr_debug("cm: Module associated with clock %s ready after %d " |