Skip to contentSkip to conversation

spi: dw_spi: fix a bug in wait_till_not_busy()

PATCH In review Feng Tang 1 participant 1 message Jan 19, 2010 SPI

lore
Share & tools
lore

Feng Tang

author
#0 lore raw

PATCH 1/3 spi: dw_spi: fix a bug in wait_till_not_busy()

Quoted 1 line

From 124fda393891d31debc2a3b760627edb18422203 Mon Sep 17 00:00:00 2001

From: Feng Tang <[email protected]>
Date: Fri, 25 Dec 2009 11:18:32 +0800
Subject: [PATCH 1/3] spi: dw_spi: fix a bug in wait_till_not_busy()

Make the driver wait at least for 1 jiffie before issuing the warning, no matter what HZ is set to

---
 drivers/spi/dw_spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/spi/dw_spi.c +1 -1
index 31620fa..521d680 100644
@@ -161,7 +161,7 @@ static inline void mrst_spi_debugfs_remove(struct dw_spi *dws)
 
 static void wait_till_not_busy(struct dw_spi *dws)
 {
-	unsigned long end = jiffies + usecs_to_jiffies(1000);
+	unsigned long end = jiffies + 1 + usecs_to_jiffies(1000);
 
 	while (time_before(jiffies, end)) {
 		if (!(dw_readw(dws, sr) & SR_BUSY))
Signature · 8 lines
1.6.0.4

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev