Commit d36d63d4 authored by Kyungmin Park's avatar Kyungmin Park Committed by Thomas Gleixner

[PATCH] OneNAND: Fix bug in write verify

- Remove unused block, page parameters
- Add constant instead of runtime value
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 405c829f
...@@ -719,13 +719,10 @@ out: ...@@ -719,13 +719,10 @@ out:
* onenand_verify_page - [GENERIC] verify the chip contents after a write * onenand_verify_page - [GENERIC] verify the chip contents after a write
* @param mtd MTD device structure * @param mtd MTD device structure
* @param buf the databuffer to verify * @param buf the databuffer to verify
* @param block block address
* @param page page address
* *
* Check DataRAM area directly * Check DataRAM area directly
*/ */
static int onenand_verify_page(struct mtd_info *mtd, u_char *buf, static int onenand_verify_page(struct mtd_info *mtd, u_char *buf, loff_t addr)
loff_t addr, int block, int page)
{ {
struct onenand_chip *this = mtd->priv; struct onenand_chip *this = mtd->priv;
void __iomem *dataram0, *dataram1; void __iomem *dataram0, *dataram1;
...@@ -816,7 +813,7 @@ static int onenand_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, ...@@ -816,7 +813,7 @@ static int onenand_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
written += thislen; written += thislen;
/* Only check verify write turn on */ /* Only check verify write turn on */
ret = onenand_verify_page(mtd, (u_char *) buf, to, block, page); ret = onenand_verify_page(mtd, (u_char *) buf, to);
if (ret) { if (ret) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_write_ecc: verify failed %d\n", ret); DEBUG(MTD_DEBUG_LEVEL0, "onenand_write_ecc: verify failed %d\n", ret);
goto out; goto out;
...@@ -940,7 +937,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, ...@@ -940,7 +937,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
u_char *eccbuf, struct nand_oobinfo *oobsel) u_char *eccbuf, struct nand_oobinfo *oobsel)
{ {
struct onenand_chip *this = mtd->priv; struct onenand_chip *this = mtd->priv;
unsigned char buffer[mtd->oobblock], *pbuf; unsigned char buffer[MAX_ONENAND_PAGESIZE], *pbuf;
size_t total_len, len; size_t total_len, len;
int i, written = 0; int i, written = 0;
int ret = 0; int ret = 0;
...@@ -1025,7 +1022,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, ...@@ -1025,7 +1022,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
/* Only check verify write turn on */ /* Only check verify write turn on */
ret = onenand_verify_page(mtd, (u_char *) pbuf, to, block, page); ret = onenand_verify_page(mtd, (u_char *) pbuf, to);
if (ret) { if (ret) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_writev_ecc: verify failed %d\n", ret); DEBUG(MTD_DEBUG_LEVEL0, "onenand_writev_ecc: verify failed %d\n", ret);
goto out; goto out;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/mtd/bbm.h> #include <linux/mtd/bbm.h>
#define MAX_BUFFERRAM 2 #define MAX_BUFFERRAM 2
#define MAX_ONENAND_PAGESIZE (2048 + 64)
/* Scan and identify a OneNAND device */ /* Scan and identify a OneNAND device */
extern int onenand_scan(struct mtd_info *mtd, int max_chips); extern int onenand_scan(struct mtd_info *mtd, int max_chips);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment