]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
omap: Fix wrong condition check in while loop for mailbox and iommu2
authorHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Mon, 28 Sep 2009 16:21:26 +0000 (09:21 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 28 Sep 2009 16:21:26 +0000 (09:21 -0700)
It's worked fine so far since reset is done for the first time.

Reported-by: Juha Leppanen <juha_motorsportcom@luukku.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Juha Leppanen <juha_motorsportcom@luukku.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/iommu2.c
arch/arm/mach-omap2/mailbox.c

index 2d9b5cc981cd8f27d37e6dfedf4dea43dfc10a1e..4a0e1cd5c1f4a4f5e65dbd2cbf06acefb6fceec6 100644 (file)
@@ -79,7 +79,7 @@ static int omap2_iommu_enable(struct iommu *obj)
                l = iommu_read_reg(obj, MMU_SYSSTATUS);
                if (l & MMU_SYS_RESETDONE)
                        break;
                l = iommu_read_reg(obj, MMU_SYSSTATUS);
                if (l & MMU_SYS_RESETDONE)
                        break;
-       } while (time_after(jiffies, timeout));
+       } while (!time_after(jiffies, timeout));
 
        if (!(l & MMU_SYS_RESETDONE)) {
                dev_err(obj->dev, "can't take mmu out of reset\n");
 
        if (!(l & MMU_SYS_RESETDONE)) {
                dev_err(obj->dev, "can't take mmu out of reset\n");
index f3fefca584949831d0905bd35a74627927b91d9e..c035ad3426d0bf8998a9e981b2e327ab66da5ee7 100644 (file)
@@ -93,7 +93,7 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
                l = mbox_read_reg(MAILBOX_SYSSTATUS);
                if (l & RESETDONE)
                        break;
                l = mbox_read_reg(MAILBOX_SYSSTATUS);
                if (l & RESETDONE)
                        break;
-       } while (time_after(jiffies, timeout));
+       } while (!time_after(jiffies, timeout));
 
        if (!(l & RESETDONE)) {
                pr_err("Can't take mmu out of reset\n");
 
        if (!(l & RESETDONE)) {
                pr_err("Can't take mmu out of reset\n");