Skip to content

Commit

Permalink
mtdswap: kill strict error handling option
Browse files Browse the repository at this point in the history
As Artem Bityutskiy suggested: this option is controversial, as we
do not really have any prove it is useful. And it is too much to have
it as a config parameter. So, better kill it and let the real mtdswap
users decide whether it is needed or not.

Signed-off-by: Yang Ruirui<ruirui.r.yang@tieto.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Yang Ruirui authored and Artem Bityutskiy committed Mar 25, 2011
1 parent fc2ff59 commit e21fa86
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
8 changes: 0 additions & 8 deletions drivers/mtd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,6 @@ config MTD_SWAP
The driver provides wear leveling by storing erase counter into the
OOB.

config MTD_SWAP_STRICT
bool "Strict erase error handling"
depends on MTD_SWAP
help
Enables strict tolerance on failed erasures, marking erase blocks bad
right after the first failed operation. With non-strict mode the
erase operation is retried.

source "drivers/mtd/chips/Kconfig"

source "drivers/mtd/maps/Kconfig"
Expand Down
8 changes: 1 addition & 7 deletions drivers/mtd/mtdswap.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ struct mtdswap_oobdata {
#define MTDSWAP_ERASE_RETRIES 3 /* Before marking erase block bad */
#define MTDSWAP_IO_RETRIES 3

#ifdef CONFIG_MTD_SWAP_STRICT
#define MTDSWAP_STRICT 1
#else
#define MTDSWAP_STRICT 0
#endif

enum {
MTDSWAP_SCANNED_CLEAN,
MTDSWAP_SCANNED_DIRTY,
Expand Down Expand Up @@ -575,7 +569,7 @@ static int mtdswap_erase_block(struct mtdswap_dev *d, struct swap_eb *eb)

ret = mtd->erase(mtd, &erase);
if (ret) {
if (retries++ < MTDSWAP_ERASE_RETRIES && !MTDSWAP_STRICT) {
if (retries++ < MTDSWAP_ERASE_RETRIES) {
dev_warn(d->dev,
"erase of erase block %#llx on %s failed",
erase.addr, mtd->name);
Expand Down

0 comments on commit e21fa86

Please sign in to comment.