[Yaffs] [PATCH] pass 64 bit addresses to mtd erase

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: srimugunthan dhandapani
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] pass 64 bit addresses to mtd erase
The mtd layer expects 64 bit byte addresses to be passed. Yaffs2
passes 64 bit offsets to mtd's read and write, but for erase only
passes 32 bit offset as byte address. It results in wrong blocks
erased, when using flash sizes greater than 4GB. It manifests as chunk
verification failure.

Signed-off-by: Srimugunthan <>
---
 yaffs_mtdif.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/yaffs_mtdif.c b/yaffs_mtdif.c
index edc1525..609a54f 100644
--- a/yaffs_mtdif.c
+++ b/yaffs_mtdif.c
@@ -25,7 +25,7 @@
 int nandmtd_erase_block(struct yaffs_dev *dev, int block_no)
 {
     struct mtd_info *mtd = yaffs_dev_to_mtd(dev);
-    u32 addr =
+    uint64_t addr =
         ((loff_t) block_no) * dev->param.total_bytes_per_chunk *
         dev->param.chunks_per_block;
     struct erase_info ei;
-- 
1.7.0.4