From c811a1c6aef38f53fadc4d51b17c56116d2baaac Mon Sep 17 00:00:00 2001 From: Jens Rottmann Date: Wed, 22 Oct 2008 22:30:17 +0000 Subject: Made await_ide(), which polls for an ide status change, check the status reg much more often. In my case this reduced the time spent in coreboot by 1.5 sec! The timeout values of course aren't changed, only the granularity. Also, I didn't see any udelay() implementation that looked like it couldn't cope with 10 us delays. (Most are written as for (...) inb(0x80) loops.) Signed-off-by: Jens Rottmann Acked-by: Marc Jones git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3690 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/pc80/ide/ide.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pc80/ide/ide.c b/src/pc80/ide/ide.c index eab879bc32..a164e9e762 100644 --- a/src/pc80/ide/ide.c +++ b/src/pc80/ide/ide.c @@ -29,6 +29,7 @@ static int await_ide(int (*done)(struct controller *ctrl), struct controller *ctrl, unsigned long timeout) { int result; + timeout *= 100; /* timeout was ms; finer granularity => reacts faster */ for(;;) { result = done(ctrl); if (result) { @@ -38,7 +39,7 @@ static int await_ide(int (*done)(struct controller *ctrl), if (timeout-- <= 0) { break; } - udelay(1000); /* Added to avoid spinning GRW */ + udelay(10); /* Added to avoid spinning GRW */ } printk_info("IDE time out\n"); return -1; -- cgit v1.2.3