Re: mtd: spi-nor: fatal issue during the mtd_erase() calls

From: mika.westerberg@xxxxxxxxxxxxxxx
Date: Mon Apr 25 2022 - 03:57:12 EST


On Sat, Apr 23, 2022 at 10:32:28PM +0000, Oleksandr Ocheretnyi -X (oocheret - GLOBALLOGIC INC at Cisco) wrote:
> Hello guys,
> recently I've faced the fatal issue "mtdblock: erase of region ... on
> ... failed"
> working with MTD device (Micron n25q128a13) on recent kernels with
> version
> 5.15.x and newer.
> Commit 094d3b9 ("mtd: spi-nor: Add USE_FSR flag for n25q* entries")
> adds
> SPINOR_OP_RDFSR opcode handling ability, however controller driver's
> side
> (i.e. intel-spi) cannot handle it properly in the intel_spi_hw_cycle()
> what causes
> a failures in the the spi_nor_fsr_ready() call what breaks some mtd
> callbacks.
> Are there any plans to implement this SPINOR_OP_RDFSR opcode handling
> on the intel controller side? Is there acceptable way to provide
> case response from controller driver side to spi-nor driver?

I think the Intel controller does support this internally but it does
not expose this to the software. I wonder if in this case we can, like
you suggest, return -ENOTSUPP and make micron_st_nor_ready() to handle
that case?

SPI-NOR folks, what you do think?