Skip to contentSkip to conversation

scsi: fix bad use of udelay in atp870u.c

PATCH In review [email protected] 2 participants 2 messages Dec 1, 2008 – Dec 2, 2008 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 10/10 scsi: fix bad use of udelay in atp870u.c

From: Martin Michlmayr <[email protected]>

The ACARD driver calls udelay() with a value > 2000, which leads to to the following compilation error on ARM:
ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined! make[1]: *** [__modpost] Error 1
Fix this by using a combination of mdelay and udelay.

---

 drivers/scsi/atp870u.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/atp870u.c renamed from drivers/scsi/atp870u.c~scsi-fix-bad-use-of-udelay-in-atp870uc +2 -1
diff -puN drivers/scsi/atp870u.c~scsi-fix-bad-use-of-udelay-in-atp870uc drivers/scsi/atp870u.c
@@ -1171,7 +1171,8 @@ wait_io1:
 	outw(val, tmport);
 	outb(2, 0x80);
 TCM_SYNC:
-	udelay(0x800);
+	mdelay(2);
+	udelay(48);
 	if ((inb(tmport) & 0x80) == 0x00) {	/* bsy ? */
 		outw(0, tmport--);
 		outb(0, tmport);

_

#1 lore raw
Quoted 5 lines · * [email protected] <[email protected]> [2008-12-01 14:32]:

The ACARD driver calls udelay() with a value > 2000, which leads to to the following compilation error on ARM:
ERROR: "__bad_udelay" [drivers/scsi/atp870u.ko] undefined! make[1]: *** [__modpost] Error 1
Fix this by using a combination of mdelay and udelay.

Well, James Bottomley said that this simple patch is wrong, so I guess you should drop it. On the other hand, this probably means this build failure will never get fixed.

Except for this build failure and another, unrelated build failure of a SCSI module, I managed to get all the build failures I see when compiling the Debian kernel on ARM and MIPS fixed. It's a pity the SCSI folks aren't as responsive as the rest of the world...

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/