Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull MTD fixes from Miquel Raynal:
"Raw NAND controller driver fixes:

- meson:
- Invalidate cache on polling ECC bit
- Initialize struct with zeroes

- nandsim: Artificially prevent sequential page reads

ECC engine driver fixes:

- mxic-ecc: Fix mxic_ecc_data_xfer_wait_for_completion() when irq is
used

Binging fixes:

- jedec,spi-nor: Document CPOL/CPHA support"

* tag 'mtd/fixes-for-6.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
mtd: rawnand: meson: invalidate cache on polling ECC bit
mtd: rawnand: nandsim: Artificially prevent sequential page reads
dt-bindings: mtd: jedec,spi-nor: Document CPOL/CPHA support
mtd: nand: mxic-ecc: Fix mxic_ecc_data_xfer_wait_for_completion() when irq is used
mtd: rawnand: meson: initialize struct with zeroes

+32 -3
+7
Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
··· 76 76 If "broken-flash-reset" is present then having this property does not 77 77 make any difference. 78 78 79 + spi-cpol: true 80 + spi-cpha: true 81 + 82 + dependencies: 83 + spi-cpol: [ spi-cpha ] 84 + spi-cpha: [ spi-cpol ] 85 + 79 86 unevaluatedProperties: false 80 87 81 88 examples:
+1
drivers/mtd/nand/ecc-mxic.c
··· 429 429 mxic_ecc_enable_int(mxic); 430 430 ret = wait_for_completion_timeout(&mxic->complete, 431 431 msecs_to_jiffies(1000)); 432 + ret = ret ? 0 : -ETIMEDOUT; 432 433 mxic_ecc_disable_int(mxic); 433 434 } else { 434 435 ret = readl_poll_timeout(mxic->regs + INTRPT_STS, val,
+8 -2
drivers/mtd/nand/raw/meson_nand.c
··· 176 176 177 177 dma_addr_t daddr; 178 178 dma_addr_t iaddr; 179 + u32 info_bytes; 179 180 180 181 unsigned long assigned_cs; 181 182 }; ··· 504 503 nfc->daddr, datalen, dir); 505 504 return ret; 506 505 } 506 + nfc->info_bytes = infolen; 507 507 cmd = GENCMDIADDRL(NFC_CMD_AIL, nfc->iaddr); 508 508 writel(cmd, nfc->reg_base + NFC_REG_CMD); 509 509 ··· 522 520 struct meson_nfc *nfc = nand_get_controller_data(nand); 523 521 524 522 dma_unmap_single(nfc->dev, nfc->daddr, datalen, dir); 525 - if (infolen) 523 + if (infolen) { 526 524 dma_unmap_single(nfc->dev, nfc->iaddr, infolen, dir); 525 + nfc->info_bytes = 0; 526 + } 527 527 } 528 528 529 529 static int meson_nfc_read_buf(struct nand_chip *nand, u8 *buf, int len) ··· 714 710 usleep_range(10, 15); 715 711 /* info is updated by nfc dma engine*/ 716 712 smp_rmb(); 713 + dma_sync_single_for_cpu(nfc->dev, nfc->iaddr, nfc->info_bytes, 714 + DMA_FROM_DEVICE); 717 715 ret = *info & ECC_COMPLETE; 718 716 } while (!ret); 719 717 } ··· 997 991 998 992 static int meson_nfc_clk_init(struct meson_nfc *nfc) 999 993 { 1000 - struct clk_parent_data nfc_divider_parent_data[1]; 994 + struct clk_parent_data nfc_divider_parent_data[1] = {0}; 1001 995 struct clk_init_data init = {0}; 1002 996 int ret; 1003 997
+16 -1
drivers/mtd/nand/raw/nandsim.c
··· 2160 2160 const struct nand_op_instr *instr = NULL; 2161 2161 struct nandsim *ns = nand_get_controller_data(chip); 2162 2162 2163 - if (check_only) 2163 + if (check_only) { 2164 + /* The current implementation of nandsim needs to know the 2165 + * ongoing operation when performing the address cycles. This 2166 + * means it cannot make the difference between a regular read 2167 + * and a continuous read. Hence, this hack to manually refuse 2168 + * supporting sequential cached operations. 2169 + */ 2170 + for (op_id = 0; op_id < op->ninstrs; op_id++) { 2171 + instr = &op->instrs[op_id]; 2172 + if (instr->type == NAND_OP_CMD_INSTR && 2173 + (instr->ctx.cmd.opcode == NAND_CMD_READCACHEEND || 2174 + instr->ctx.cmd.opcode == NAND_CMD_READCACHESEQ)) 2175 + return -EOPNOTSUPP; 2176 + } 2177 + 2164 2178 return 0; 2179 + } 2165 2180 2166 2181 ns->lines.ce = 1; 2167 2182