Commit ace52288 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-20171218' of git://git.infradead.org/linux-mtd

Pull MTD fixes from Richard Weinberger:
 "This contains the following regression fixes:

   - fix bitflip handling in brcmnand and gpmi nand drivers

   - revert a bad device tree binding for spi-nor

   - fix a copy&paste error in gpio-nand driver

   - fix a too strict length check in mtd core"

* tag 'for-linus-20171218' of git://git.infradead.org/linux-mtd:
  mtd: Fix mtd_check_oob_ops()
  mtd: nand: gpio: Fix ALE gpio configuration
  mtd: nand: brcmnand: Zero bitflip is not an error
  mtd: nand: gpmi: Fix failure when a erased page has a bitflip at BBM
  Revert "dt-bindings: mtd: add sst25wf040b and en25s64 to sip-nor list"
parents cb81fc6a d82c3682
...@@ -13,7 +13,6 @@ Required properties: ...@@ -13,7 +13,6 @@ Required properties:
at25df321a at25df321a
at25df641 at25df641
at26df081a at26df081a
en25s64
mr25h128 mr25h128
mr25h256 mr25h256
mr25h10 mr25h10
...@@ -33,7 +32,6 @@ Required properties: ...@@ -33,7 +32,6 @@ Required properties:
s25fl008k s25fl008k
s25fl064k s25fl064k
sst25vf040b sst25vf040b
sst25wf040b
m25p40 m25p40
m25p80 m25p80
m25p16 m25p16
......
...@@ -1114,7 +1114,7 @@ static int mtd_check_oob_ops(struct mtd_info *mtd, loff_t offs, ...@@ -1114,7 +1114,7 @@ static int mtd_check_oob_ops(struct mtd_info *mtd, loff_t offs,
if (!ops->oobbuf) if (!ops->oobbuf)
ops->ooblen = 0; ops->ooblen = 0;
if (offs < 0 || offs + ops->len >= mtd->size) if (offs < 0 || offs + ops->len > mtd->size)
return -EINVAL; return -EINVAL;
if (ops->ooblen) { if (ops->ooblen) {
......
...@@ -1763,7 +1763,7 @@ static int brcmnand_read(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -1763,7 +1763,7 @@ static int brcmnand_read(struct mtd_info *mtd, struct nand_chip *chip,
err = brcmstb_nand_verify_erased_page(mtd, chip, buf, err = brcmstb_nand_verify_erased_page(mtd, chip, buf,
addr); addr);
/* erased page bitflips corrected */ /* erased page bitflips corrected */
if (err > 0) if (err >= 0)
return err; return err;
} }
......
...@@ -253,9 +253,9 @@ static int gpio_nand_probe(struct platform_device *pdev) ...@@ -253,9 +253,9 @@ static int gpio_nand_probe(struct platform_device *pdev)
goto out_ce; goto out_ce;
} }
gpiomtd->nwp = devm_gpiod_get(dev, "ale", GPIOD_OUT_LOW); gpiomtd->ale = devm_gpiod_get(dev, "ale", GPIOD_OUT_LOW);
if (IS_ERR(gpiomtd->nwp)) { if (IS_ERR(gpiomtd->ale)) {
ret = PTR_ERR(gpiomtd->nwp); ret = PTR_ERR(gpiomtd->ale);
goto out_ce; goto out_ce;
} }
......
...@@ -1067,9 +1067,6 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -1067,9 +1067,6 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
return ret; return ret;
} }
/* handle the block mark swapping */
block_mark_swapping(this, payload_virt, auxiliary_virt);
/* Loop over status bytes, accumulating ECC status. */ /* Loop over status bytes, accumulating ECC status. */
status = auxiliary_virt + nfc_geo->auxiliary_status_offset; status = auxiliary_virt + nfc_geo->auxiliary_status_offset;
...@@ -1158,6 +1155,9 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -1158,6 +1155,9 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
max_bitflips = max_t(unsigned int, max_bitflips, *status); max_bitflips = max_t(unsigned int, max_bitflips, *status);
} }
/* handle the block mark swapping */
block_mark_swapping(this, buf, auxiliary_virt);
if (oob_required) { if (oob_required) {
/* /*
* It's time to deliver the OOB bytes. See gpmi_ecc_read_oob() * It's time to deliver the OOB bytes. See gpmi_ecc_read_oob()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment