提交 34627f0e 编写于 作者: A Adrian Hunter 提交者: David Woodhouse

[MTD] [OneNAND] Synchronize block locking operations

Ensure OneNAND's block locking operations are synchronized
like all other operations.
Signed-off-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
Acked-by: NKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 d773b339
......@@ -1904,7 +1904,12 @@ static int onenand_do_lock_cmd(struct mtd_info *mtd, loff_t ofs, size_t len, int
*/
static int onenand_lock(struct mtd_info *mtd, loff_t ofs, size_t len)
{
return onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_LOCK);
int ret;
onenand_get_device(mtd, FL_LOCKING);
ret = onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_LOCK);
onenand_release_device(mtd);
return ret;
}
/**
......@@ -1917,7 +1922,12 @@ static int onenand_lock(struct mtd_info *mtd, loff_t ofs, size_t len)
*/
static int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
{
return onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_UNLOCK);
int ret;
onenand_get_device(mtd, FL_LOCKING);
ret = onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_UNLOCK);
onenand_release_device(mtd);
return ret;
}
/**
......@@ -1979,7 +1989,7 @@ static int onenand_unlock_all(struct mtd_info *mtd)
loff_t ofs = this->chipsize >> 1;
size_t len = mtd->erasesize;
onenand_unlock(mtd, ofs, len);
onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_UNLOCK);
}
onenand_check_lock_status(this);
......@@ -1987,7 +1997,7 @@ static int onenand_unlock_all(struct mtd_info *mtd)
return 0;
}
onenand_unlock(mtd, 0x0, this->chipsize);
onenand_do_lock_cmd(mtd, 0x0, this->chipsize, ONENAND_CMD_UNLOCK);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册