Commit 793cfd59 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mtd/fixes-for-6.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux

Pull mtd fixes from Miquel Raynal:
 "Core fix:

   - mtdblock: Tolerate corrected bit-flips

  Raw NAND fixes:

   - meson: Fix bitmask for length in command word

   - stm32_fmc2:

       - Remove unsupported EDO mode

       - Use timings.mode instead of checking tRC_min.

         The first patch is the real fix but nowadays we use
         timings.mode instead of bare timings, so in order to ease the
         backports, the fix was split into two steps, the first one easy
         to backport on older kernels, the second one just as a
         follow-up so recent stable kernels would look like the
         mainline"

* tag 'mtd/fixes-for-6.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
  mtd: rawnand: meson: fix bitmask for length in command word
  mtdblock: tolerate corrected bit-flips
  mtd: rawnand: stm32_fmc2: use timings.mode instead of checking tRC_min
  mtd: rawnand: stm32_fmc2: remove unsupported EDO mode
parents 43fef9ae 93942b70
...@@ -153,7 +153,7 @@ static int do_cached_write (struct mtdblk_dev *mtdblk, unsigned long pos, ...@@ -153,7 +153,7 @@ static int do_cached_write (struct mtdblk_dev *mtdblk, unsigned long pos,
mtdblk->cache_state = STATE_EMPTY; mtdblk->cache_state = STATE_EMPTY;
ret = mtd_read(mtd, sect_start, sect_size, ret = mtd_read(mtd, sect_start, sect_size,
&retlen, mtdblk->cache_data); &retlen, mtdblk->cache_data);
if (ret) if (ret && !mtd_is_bitflip(ret))
return ret; return ret;
if (retlen != sect_size) if (retlen != sect_size)
return -EIO; return -EIO;
...@@ -188,8 +188,12 @@ static int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos, ...@@ -188,8 +188,12 @@ static int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos,
pr_debug("mtdblock: read on \"%s\" at 0x%lx, size 0x%x\n", pr_debug("mtdblock: read on \"%s\" at 0x%lx, size 0x%x\n",
mtd->name, pos, len); mtd->name, pos, len);
if (!sect_size) if (!sect_size) {
return mtd_read(mtd, pos, len, &retlen, buf); ret = mtd_read(mtd, pos, len, &retlen, buf);
if (ret && !mtd_is_bitflip(ret))
return ret;
return 0;
}
while (len > 0) { while (len > 0) {
unsigned long sect_start = (pos/sect_size)*sect_size; unsigned long sect_start = (pos/sect_size)*sect_size;
...@@ -209,7 +213,7 @@ static int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos, ...@@ -209,7 +213,7 @@ static int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos,
memcpy (buf, mtdblk->cache_data + offset, size); memcpy (buf, mtdblk->cache_data + offset, size);
} else { } else {
ret = mtd_read(mtd, pos, size, &retlen, buf); ret = mtd_read(mtd, pos, size, &retlen, buf);
if (ret) if (ret && !mtd_is_bitflip(ret))
return ret; return ret;
if (retlen != size) if (retlen != size)
return -EIO; return -EIO;
......
...@@ -280,7 +280,7 @@ static void meson_nfc_cmd_access(struct nand_chip *nand, int raw, bool dir, ...@@ -280,7 +280,7 @@ static void meson_nfc_cmd_access(struct nand_chip *nand, int raw, bool dir,
if (raw) { if (raw) {
len = mtd->writesize + mtd->oobsize; len = mtd->writesize + mtd->oobsize;
cmd = (len & GENMASK(5, 0)) | scrambler | DMA_DIR(dir); cmd = (len & GENMASK(13, 0)) | scrambler | DMA_DIR(dir);
writel(cmd, nfc->reg_base + NFC_REG_CMD); writel(cmd, nfc->reg_base + NFC_REG_CMD);
return; return;
} }
...@@ -544,7 +544,7 @@ static int meson_nfc_read_buf(struct nand_chip *nand, u8 *buf, int len) ...@@ -544,7 +544,7 @@ static int meson_nfc_read_buf(struct nand_chip *nand, u8 *buf, int len)
if (ret) if (ret)
goto out; goto out;
cmd = NFC_CMD_N2M | (len & GENMASK(5, 0)); cmd = NFC_CMD_N2M | (len & GENMASK(13, 0));
writel(cmd, nfc->reg_base + NFC_REG_CMD); writel(cmd, nfc->reg_base + NFC_REG_CMD);
meson_nfc_drain_cmd(nfc); meson_nfc_drain_cmd(nfc);
...@@ -568,7 +568,7 @@ static int meson_nfc_write_buf(struct nand_chip *nand, u8 *buf, int len) ...@@ -568,7 +568,7 @@ static int meson_nfc_write_buf(struct nand_chip *nand, u8 *buf, int len)
if (ret) if (ret)
return ret; return ret;
cmd = NFC_CMD_M2N | (len & GENMASK(5, 0)); cmd = NFC_CMD_M2N | (len & GENMASK(13, 0));
writel(cmd, nfc->reg_base + NFC_REG_CMD); writel(cmd, nfc->reg_base + NFC_REG_CMD);
meson_nfc_drain_cmd(nfc); meson_nfc_drain_cmd(nfc);
......
...@@ -1531,6 +1531,9 @@ static int stm32_fmc2_nfc_setup_interface(struct nand_chip *chip, int chipnr, ...@@ -1531,6 +1531,9 @@ static int stm32_fmc2_nfc_setup_interface(struct nand_chip *chip, int chipnr,
if (IS_ERR(sdrt)) if (IS_ERR(sdrt))
return PTR_ERR(sdrt); return PTR_ERR(sdrt);
if (conf->timings.mode > 3)
return -EOPNOTSUPP;
if (chipnr == NAND_DATA_IFACE_CHECK_ONLY) if (chipnr == NAND_DATA_IFACE_CHECK_ONLY)
return 0; return 0;
......
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