[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 3/6] nand: fix flash erase when oob is in memory
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 3/6] nand: fix flash erase when oob is in memory |
Date: |
Wed, 25 Nov 2015 15:10:21 +0100 |
From: Ricard Wanderlof <address@hidden>
For the "main area on file, oob in memory" case, fix the shifts so that
we erase the correct number of pages.
Signed-off-by: Ricard Wanderlöf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/block/nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/block/nand.c b/hw/block/nand.c
index a68266f..f0e3413 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -712,7 +712,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState
*s)
memset(s->storage + (PAGE(addr) << OOB_SHIFT),
0xff, OOB_SIZE << s->erase_shift);
i = SECTOR(addr);
- page = SECTOR(addr + (ADDR_SHIFT + s->erase_shift));
+ page = SECTOR(addr + (1 << (ADDR_SHIFT + s->erase_shift)));
for (; i < page; i ++)
if (blk_write(s->blk, i, iobuf, 1) < 0) {
printf("%s: write error in sector %" PRIu64 "\n", __func__, i);
--
1.8.3.1
- [Qemu-block] [PULL 0/6] Block patches for 2.5.0-rc2, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 2/6] test-aio: Fix event notifier cleanup, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 4/6] raw-posix.c: Make GetBSDPath() handle caching options, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 3/6] nand: fix flash erase when oob is in memory,
Kevin Wolf <=
- [Qemu-block] [PULL 5/6] block/qapi: Plug memory leak on query-block error path, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 1/6] tests/Makefile: Add more dependencies for test-timed-average, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 6/6] qemu-iotests: Add -nographic when starting QEMU in 119 and 120, Kevin Wolf, 2015/11/25
- Re: [Qemu-block] [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2, Peter Maydell, 2015/11/25