Patchwork [v2] hw/nand.c: bug fix to erase operation

login
register
mail settings
Submitter Kuo-Jung Su
Date Jan. 25, 2013, 7:21 a.m.
Message ID <1359098492-11044-1-git-send-email-dantesu@gmail.com>
Download mbox | patch
Permalink /patch/215568/
State New
Headers show

Comments

Kuo-Jung Su - Jan. 25, 2013, 7:21 a.m.
From: Kuo-Jung Su <dantesu@faraday-tech.com>

The s->addr should be reset along with the s->addrlen,
or it might contains the previous address at last address cycle,
and causes problem to nand erase operation.

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
Cc: balrog@zabor.org
---

Changes for v2:
   - coding style fix

---
 hw/nand.c |    1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/hw/nand.c b/hw/nand.c
index 4ddb22b..cbc45cc 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -510,6 +510,7 @@  void nand_setio(DeviceState *dev, uint32_t value)
             nand_command(s);
 
         if (s->cmd != NAND_CMD_RANDOMREAD2) {
+            s->addr = 0;
             s->addrlen = 0;
         }
     }