Skip to contentSkip to conversation

omap: Fix wrong condition check in while loop for mailbox and iommu2

PATCH New Hiroshi DOYU 1 participant 1 message Sep 28, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap: Fix wrong condition check in while loop for mailbox and iommu2

It's worked fine so far since reset is done for the first time.

arch/arm/mach-omap2/iommu2.c +1 -1
index 2d9b5cc..4a0e1cd 100644
@@ -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;
-	} 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");
arch/arm/mach-omap2/mailbox.c +1 -1
index f3fefca..c035ad3 100644
@@ -93,7 +93,7 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
 		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");

--Pd0ReVV5GZGQvF3a--