Re: [PATCH v3 1/2] mtd: spi-nor: issi: is25wp256: Init flash based on SFDP

Guenter Roeck
2022-12-21T00:30:33Z

Hi,

On Tue, Sep 20, 2022 at 07:48:07PM +0100, Sudip Mukherjee wrote:
> The datasheet of is25wp256 says it supports SFDP. Get rid of the static
> initialization of the flash parameters and init them when parsing SFDP.
>
> Testing showed the flash using SPINOR_OP_READ_1_1_4_4B 0x6c,
> SPINOR_OP_PP_4B 0x12 and SPINOR_OP_BE_4K_4B 0x21 before enabling SFDP.
> After this patch, it parses the SFDP information and still uses the
> same opcodes.
>
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@sifive.com>

With this patch in place, qemu emulations with is25wp256 fail to
instantiate the flash. Specifically, this affects the qemu sifive_u
emulation. The resulting error message is:

spi-nor spi0.0: BFPT parsing failed. Please consider using SPI_NOR_SKIP_SFDP when declaring the flash
spi-nor: probe of spi0.0 failed with error -22

qemu command line:

qemu-system-riscv64 -M sifive_u -m 512M \
-no-reboot -kernel arch/riscv/boot/Image -snapshot \
-drive file=flash.8Vtb7,format=raw,if=mtd -bios default \
-append "root=/dev/mtdblock0 mtdparts=spi0.0:- console=ttySIF0,115200 earlycon" \
-nographic -monitor none

Reverting this patch fixes the problem.

Guenter

---
# bad: [1e4fa020d574768445fca2d9bbfe473ec8bbd224] Merge tag 'mtd/for-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
# good: [a594533df0f6ca391da003f43d53b336a2d23ffa] Merge tag 'drm-next-2022-12-13' of git://anongit.freedesktop.org/drm/drm
git bisect start '1e4fa020d574' 'a594533df0f6'
# good: [2399401feee27c639addc5b7e6ba519d3ca341bf] mtd: maps: pxa2xx-flash: fix memory leak in probe
git bisect good 2399401feee27c639addc5b7e6ba519d3ca341bf
# good: [bcc0c61e6134066f4629845691a514ea33465653] mtd: spi-nor: micron-st: Enable locking for mt25qu256a
git bisect good bcc0c61e6134066f4629845691a514ea33465653
# good: [a50ae8c98e5766a4fcb78e76f13cc658b784eac1] mtd: nand: drop EXPORT_SYMBOL_GPL for nanddev_erase()
git bisect good a50ae8c98e5766a4fcb78e76f13cc658b784eac1
# good: [6408cc05a50aaf88074a5a31d065e5af87a456f5] mtd: rawnand: Drop obsolete dependencies on COMPILE_TEST
git bisect good 6408cc05a50aaf88074a5a31d065e5af87a456f5
# bad: [1799cd8540b67b88514c82f5fae1c75b986bcbd8] mtd: spi-nor: add SFDP fixups for Quad Page Program
git bisect bad 1799cd8540b67b88514c82f5fae1c75b986bcbd8
# bad: [a30f53d8bc0f9b55b4e8eea0e17b68cfd1f07f34] mtd: spi-nor: issi: is25wp256: Init flash based on SFDP
git bisect bad a30f53d8bc0f9b55b4e8eea0e17b68cfd1f07f34
# good: [ef434f08b0562069cf431873a052692357d325a1] mtd: spi-nor: winbond: add support for W25Q512NW-IQ
git bisect good ef434f08b0562069cf431873a052692357d325a1
# first bad commit: [a30f53d8bc0f9b55b4e8eea0e17b68cfd1f07f34] mtd: spi-nor: issi: is25wp256: Init flash based on SFDP