From: Rabin Vincent <rabin.vincent@axis.com>
To: "Ricard Wanderlöf" <ricardw@axis.com>, kwolf@redhat.com
Cc: QEMU development <qemu-devel@nongnu.org>, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] nand: fix flash erase when oob is in memory
Date: Tue, 24 Nov 2015 06:39:58 +0100 [thread overview]
Message-ID: <20151124053958.GA31927@axis.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1511131335150.11990@lnxricardw1.se.axis.com>
(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 <ricardw@axis.com>
> ---
> 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
>
>
next prev parent reply other threads:[~2015-11-24 5:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 13:17 [Qemu-devel] [PATCH] nand: fix flash erase when oob is in memory Ricard Wanderlof
2015-11-13 15:19 ` Ricard Wanderlof
2015-11-24 5:39 ` Rabin Vincent [this message]
2015-11-24 13:09 ` Kevin Wolf
-- strict thread matches above, loose matches on Subject: below --
2015-11-13 7:55 Ricard Wanderlof
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151124053958.GA31927@axis.com \
--to=rabin.vincent@axis.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ricardw@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.