|
@@ -982,6 +982,15 @@ int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
|
|
|
|
|
|
chip->select_chip(mtd, chipnr);
|
|
|
|
|
|
+ /*
|
|
|
+ * Reset the chip.
|
|
|
+ * If we want to check the WP through READ STATUS and check the bit 7
|
|
|
+ * we must reset the chip
|
|
|
+ * some operation can also clear the bit 7 of status register
|
|
|
+ * eg. erase/program a locked block
|
|
|
+ */
|
|
|
+ chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
|
|
|
+
|
|
|
/* Check, if it is write protected */
|
|
|
if (nand_check_wp(mtd)) {
|
|
|
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)
|
|
|
|
|
|
chip->select_chip(mtd, chipnr);
|
|
|
|
|
|
+ /*
|
|
|
+ * Reset the chip.
|
|
|
+ * If we want to check the WP through READ STATUS and check the bit 7
|
|
|
+ * we must reset the chip
|
|
|
+ * some operation can also clear the bit 7 of status register
|
|
|
+ * eg. erase/program a locked block
|
|
|
+ */
|
|
|
+ chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
|
|
|
+
|
|
|
/* Check, if it is write protected */
|
|
|
if (nand_check_wp(mtd)) {
|
|
|
pr_debug("%s: device is write protected!\n",
|