qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] nand: fix flash erase when oob is in memory


From: Rabin Vincent
Subject: Re: [Qemu-block] [PATCH] nand: fix flash erase when oob is in memory
Date: Tue, 24 Nov 2015 06:39:58 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

(to: Kevin and cc: qemu-block)

On Fri, Nov 13, 2015 at 02:17:28PM +0100, Ricard Wanderlöf wrote:
> 
> 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>
> ---
>  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.7.10.4
> 
> -- 
> Ricard Wolf Wanderlöf                           ricardw(at)axis.com
> Axis Communications AB, Lund, Sweden            www.axis.com
> Phone +46 46 272 2016                           Fax +46 46 13 61 30
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]