* [Qemu-devel] [PATCH] nand: fix flash erase when oob is in memory
@ 2015-11-13 7:55 Ricard Wanderlof
0 siblings, 0 replies; 5+ messages in thread
From: Ricard Wanderlof @ 2015-11-13 7:55 UTC (permalink / raw)
To: qemu-devel; +Cc: Rabin Vincent
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] nand: fix flash erase when oob is in memory
@ 2015-11-13 13:17 Ricard Wanderlof
2015-11-13 15:19 ` Ricard Wanderlof
2015-11-24 5:39 ` Rabin Vincent
0 siblings, 2 replies; 5+ messages in thread
From: Ricard Wanderlof @ 2015-11-13 13:17 UTC (permalink / raw)
To: QEMU development; +Cc: Rabin Vincent
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] nand: fix flash erase when oob is in memory
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
1 sibling, 0 replies; 5+ messages in thread
From: Ricard Wanderlof @ 2015-11-13 15:19 UTC (permalink / raw)
To: QEMU development
On Fri, 13 Nov 2015, Ricard Wanderlof wrote:
> For the "main area on file, oob in memory" case, fix the shifts so that
> we erase the correct number of pages.
> ...
Sorry about the duplicate post.
Initially used the wrong email address when subscribing so when I
subscribed with the correct one one it seems that the first post was
submitted as well as the second.
/Ricard
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] nand: fix flash erase when oob is in memory
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
2015-11-24 13:09 ` Kevin Wolf
1 sibling, 1 reply; 5+ messages in thread
From: Rabin Vincent @ 2015-11-24 5:39 UTC (permalink / raw)
To: Ricard Wanderlöf, kwolf; +Cc: QEMU development, qemu-block
(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
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] nand: fix flash erase when oob is in memory
2015-11-24 5:39 ` Rabin Vincent
@ 2015-11-24 13:09 ` Kevin Wolf
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2015-11-24 13:09 UTC (permalink / raw)
To: Rabin Vincent; +Cc: Ricard Wanderlöf, QEMU development, qemu-block
Am 24.11.2015 um 06:39 hat Rabin Vincent geschrieben:
> (to: Kevin and cc: qemu-block)
Thanks for forwarding!
> 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>
Thanks, applied to my block branch for 2.5.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-24 13:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-11-24 13:09 ` Kevin Wolf
-- strict thread matches above, loose matches on Subject: below --
2015-11-13 7:55 Ricard Wanderlof
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).