Skip to contentSkip to conversation

mtd: ubi: Read threshold verification

PATCH Superseded Tanya Brokhman 1 participant 1 message Sep 28, 2014

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 mtd: ubi: Read threshold verification

From: Tatyana Brokhman <[email protected]>

One of the criteria to scrub an eraseblock due to read disturb issue is if that eraseblock was read from more times then a pre-defined threshold. This is verified at each LEB read according to the read counter parameter of the read PEB.
An eraseblock that is found needs scrubbing is added to the ubi->scrub list.

---
 drivers/mtd/ubi/eba.c |  7 ++++++-
 drivers/mtd/ubi/wl.c  | 56 +++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 56 insertions(+), 7 deletions(-)
drivers/mtd/ubi/eba.c +6 -1
index 0e11671d..1c7b5f9 100644
@@ -1,5 +1,8 @@
 /*
  * Copyright (c) International Business Machines Corp., 2006
+ * Copyright (c) 2014, Linux Foundation. All rights reserved.
+ * Linux Foundation chooses to take subject only to the GPLv2
+ * license terms, and distributes only under these terms.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -466,8 +469,10 @@ retry:
 			goto out_unlock;
 		}
 	}
+	if (ubi->lookuptbl[pnum]->rc >= ubi->rd_threshold)
+		scrub = 1;
 
-	if (scrub)
+	if (scrub && !ubi_in_wl_tree(ubi->lookuptbl[pnum], &ubi->scrub))
 		err = ubi_wl_scrub_peb(ubi, pnum);
 
 	leb_read_unlock(ubi, vol_id, lnum);
drivers/mtd/ubi/wl.c +50 -6

123 lines not on this page · raw message

Signature · 4 lines
1.8.5.2
--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation