diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-05-03 02:04:39 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-06-04 04:30:42 -0400 |
commit | eb89580e1a8388d206bf143c6c39d001095106ba (patch) | |
tree | a0cee0ac8e62a9731ade3d8aa400b621252ea3f4 /drivers/mtd/ubi/scan.c | |
parent | 786d78318586cbdc8aec539fe5a4942490267fef (diff) |
UBI: introduce a new IO return code
This patch introduces the %UBI_IO_BAD_HDR_READ return code for
the I/O level function. We will use this code in order to distinguish
between "corrupted header possibly because this is non-ubi data" and
"corrupted header possibly because of real data corruption and ECC error".
So far this patch does not introduce any functional change, just a
preparation.
This patch is pased on a patch from
Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reviewed-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Tested-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r-- | drivers/mtd/ubi/scan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index b878a7661f5a..c45900744107 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -745,7 +745,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
745 | bitflips = 1; | 745 | bitflips = 1; |
746 | else if (err == UBI_IO_PEB_EMPTY) | 746 | else if (err == UBI_IO_PEB_EMPTY) |
747 | return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase); | 747 | return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase); |
748 | else if (err == UBI_IO_BAD_HDR) { | 748 | else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR) { |
749 | /* | 749 | /* |
750 | * We have to also look at the VID header, possibly it is not | 750 | * We have to also look at the VID header, possibly it is not |
751 | * corrupted. Set %bitflips flag in order to make this PEB be | 751 | * corrupted. Set %bitflips flag in order to make this PEB be |
@@ -813,7 +813,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
813 | return err; | 813 | return err; |
814 | else if (err == UBI_IO_BITFLIPS) | 814 | else if (err == UBI_IO_BITFLIPS) |
815 | bitflips = 1; | 815 | bitflips = 1; |
816 | else if (err == UBI_IO_BAD_HDR || | 816 | else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR || |
817 | (err == UBI_IO_PEB_FREE && ec_corr)) { | 817 | (err == UBI_IO_PEB_FREE && ec_corr)) { |
818 | /* VID header is corrupted */ | 818 | /* VID header is corrupted */ |
819 | err = add_to_list(si, pnum, ec, &si->corr); | 819 | err = add_to_list(si, pnum, ec, &si->corr); |