提交 eb32baec 编写于 作者: U unsik Kim 提交者: Jens Axboe

mg_disk: fix reading invalid status when use polling driver

When using polling driver, little delay is required to access
status register. Without this, host might read invalid status.
Signed-off-by: Nunsik Kim <donari75@gmail.com>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 48f5690d
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册