[PATCH A 10/15] tidspbridge: remove udelay and use time_after instead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Felipe Contreras <felipe.contreras@xxxxxxxxx>

As suggested by Juha Yrjola.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 658064f..735f8e9 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -105,7 +105,7 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 	u32 opplevel = 0;
 #endif
 	struct CFG_HOSTRES resources;
-	u16 cnt = 10;
+	unsigned long timeout;
 	u32 temp;
 	/* We are waiting indefinitely here. This needs to be fixed in the
 	 * second phase */
@@ -143,12 +143,12 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 
 		pDevContext->dwBrdState = BRD_RUNNING;
 	}
+	timeout = jiffies + msecs_to_jiffies(10);
 	while (fifo_full((void __iomem *) resources.dwMboxBase, 0)) {
-		if (--cnt == 0) {
+		if (time_after(jiffies, timeout)) {
 			DBG_Trace(DBG_LEVEL7, "Timed out waiting for DSP mailbox \n");
 			return WMD_E_TIMEOUT;
 		}
-		mdelay(1);
 	}
 	DBG_Trace(DBG_LEVEL3, "writing %x to Mailbox\n",
 		  pDevContext->wIntrVal2Dsp);
-- 
1.6.2.1.287.g9a8be

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux