diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index d8cdf06343fb..1a27c2da29ff 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -982,6 +982,15 @@ int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | |||
982 | 982 | ||
983 | chip->select_chip(mtd, chipnr); | 983 | chip->select_chip(mtd, chipnr); |
984 | 984 | ||
985 | /* | ||
986 | * Reset the chip. | ||
987 | * If we want to check the WP through READ STATUS and check the bit 7 | ||
988 | * we must reset the chip | ||
989 | * some operation can also clear the bit 7 of status register | ||
990 | * eg. erase/program a locked block | ||
991 | */ | ||
992 | chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); | ||
993 | |||
985 | /* Check, if it is write protected */ | 994 | /* Check, if it is write protected */ |
986 | if (nand_check_wp(mtd)) { | 995 | if (nand_check_wp(mtd)) { |
987 | pr_debug("%s: device is write protected!\n", | 996 | pr_debug("%s: device is write protected!\n", |
@@ -1032,6 +1041,15 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | |||
1032 | 1041 | ||
1033 | chip->select_chip(mtd, chipnr); | 1042 | chip->select_chip(mtd, chipnr); |
1034 | 1043 | ||
1044 | /* | ||
1045 | * Reset the chip. | ||
1046 | * If we want to check the WP through READ STATUS and check the bit 7 | ||
1047 | * we must reset the chip | ||
1048 | * some operation can also clear the bit 7 of status register | ||
1049 | * eg. erase/program a locked block | ||
1050 | */ | ||
1051 | chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); | ||
1052 | |||
1035 | /* Check, if it is write protected */ | 1053 | /* Check, if it is write protected */ |
1036 | if (nand_check_wp(mtd)) { | 1054 | if (nand_check_wp(mtd)) { |
1037 | pr_debug("%s: device is write protected!\n", | 1055 | pr_debug("%s: device is write protected!\n", |