From 2fffd81f7af6d50461dae4c5943c87c3c044d856 Mon Sep 17 00:00:00 2001 From: unsik Kim Date: Tue, 28 Jul 2009 08:52:07 +0200 Subject: [PATCH] --- yaml --- r: 156161 b: refs/heads/master c: eb32baec15c38ae6f06cb898a9f791578c5f8c79 h: refs/heads/master i: 156159: dc27219e59a7839a986ecde66408ad52f82ac14c v: v3 --- [refs] | 2 +- trunk/drivers/block/mg_disk.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 35b17e86bbf8..b757f6fd7f07 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 48f5690d45b79ffeedc5ab24243b576056f1d2ff +refs/heads/master: eb32baec15c38ae6f06cb898a9f791578c5f8c79 diff --git a/trunk/drivers/block/mg_disk.c b/trunk/drivers/block/mg_disk.c index 5b120eab2baa..6440d5945414 100644 --- a/trunk/drivers/block/mg_disk.c +++ b/trunk/drivers/block/mg_disk.c @@ -219,6 +219,16 @@ static unsigned int mg_wait(struct mg_host *host, u32 expect, u32 msec) host->error = MG_ERR_NONE; expire = jiffies + msecs_to_jiffies(msec); + /* These 2 times dummy status read prevents reading invalid + * status. A very little time (3 times of mflash operating clk) + * is required for busy bit is set. Use dummy read instead of + * busy wait, because mflash's PLL is machine dependent. + */ + if (prv_data->use_polling) { + status = inb((unsigned long)host->dev_base + MG_REG_STATUS); + status = inb((unsigned long)host->dev_base + MG_REG_STATUS); + } + status = inb((unsigned long)host->dev_base + MG_REG_STATUS); do {