diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-07-19 07:33:14 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-08-14 13:01:36 -0400 |
commit | 4a406856ea6830d8b8dba6a27d9f9331c5f4c13a (patch) | |
tree | 9bca90ac072a68eb762f985d62c512c55ba6dadc /drivers/mtd/ubi/scan.h | |
parent | 5b289b562f6d236108569a880cb38cc03d17a50d (diff) |
UBI: print a warning if too many PEBs are corrupted
There was a bug report recently where UBI prints:
UBI error: ubi_attach_mtd_dev: failed to attach by scanning, error -22
error messages and refuses to attach a PEB. It turned out to be a
buggy flash driver which returned garbage to almost every UBI read.
This patch makes UBI print a better message in such cases. Namely,
if UBI finds 8 or more corrupted PEBs, it prints a warning and
lists the corrupted PEBs.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.h')
-rw-r--r-- | drivers/mtd/ubi/scan.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h index 1017cf12def5..bab31695dace 100644 --- a/drivers/mtd/ubi/scan.h +++ b/drivers/mtd/ubi/scan.h | |||
@@ -102,6 +102,7 @@ struct ubi_scan_volume { | |||
102 | * @mean_ec: mean erase counter value | 102 | * @mean_ec: mean erase counter value |
103 | * @ec_sum: a temporary variable used when calculating @mean_ec | 103 | * @ec_sum: a temporary variable used when calculating @mean_ec |
104 | * @ec_count: a temporary variable used when calculating @mean_ec | 104 | * @ec_count: a temporary variable used when calculating @mean_ec |
105 | * @corr_count: count of corrupted PEBs | ||
105 | * @image_seq_set: indicates @ubi->image_seq is known | 106 | * @image_seq_set: indicates @ubi->image_seq is known |
106 | * | 107 | * |
107 | * This data structure contains the result of scanning and may be used by other | 108 | * This data structure contains the result of scanning and may be used by other |
@@ -125,6 +126,7 @@ struct ubi_scan_info { | |||
125 | int mean_ec; | 126 | int mean_ec; |
126 | uint64_t ec_sum; | 127 | uint64_t ec_sum; |
127 | int ec_count; | 128 | int ec_count; |
129 | int corr_count; | ||
128 | int image_seq_set; | 130 | int image_seq_set; |
129 | }; | 131 | }; |
130 | 132 | ||