[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1340036345-96726-14-git-send-email-richard@nod.at>
Date: Mon, 18 Jun 2012 18:18:56 +0200
From: Richard Weinberger <richard@....at>
To: linux-mtd@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, adrian.hunter@...el.com,
Heinz.Egger@...utronix.de, thomas.wucher@...utronix.de,
shmulik.ladkani@...il.com, tglx@...utronix.de,
tim.bird@...sony.com, Marius.Mazarel@...l.ro,
artem.bityutskiy@...ux.intel.com,
Richard Weinberger <richard@....at>
Subject: [PATCH 13/22] UBI: Fastmap: Fix EC values
Return the correct EC values back to the WL sub-system.
Signed-off-by: Richard Weinberger <richard@....at>
---
drivers/mtd/ubi/fastmap.c | 2 ++
drivers/mtd/ubi/wl.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 33a14cf..b4f7fce 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -721,6 +721,7 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list) {
if (aeb->pnum == tmp_aeb->pnum) {
aeb->scrub = tmp_aeb->scrub;
+ aeb->ec = tmp_aeb->ec;
list_del(&tmp_aeb->u.list);
kfree(tmp_aeb);
continue;
@@ -1345,6 +1346,7 @@ int ubi_update_fastmap(struct ubi_device *ubi)
ec = be64_to_cpu(ec_hdr->ec);
ec += ret;
+ old_fm->e[0]->ec = ec;
if (ec > UBI_MAX_ERASECOUNTER) {
ubi_err("erase counter overflow!");
kfree(ec_hdr);
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 25d2e0b..eec3940 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -839,8 +839,10 @@ int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *fm_e,
e = fm_e;
ubi_assert(e->ec);
ubi->lookuptbl[pnum] = e;
- } else
+ } else {
+ e->ec = fm_e->ec;
kfree(fm_e);
+ }
spin_unlock(&ubi->wl_lock);
--
1.7.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists