Skip to content

mtd: spi-nor: otp: 4 byte mode fix and erase support

Michael Walle linux-mtd lkml 4 versions – Applied

Status from this message: Applied to spi-nor/next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest4 patches 1 replyApplied
  2. v55 patches 10 repliesSuperseded
  3. v44 patches 13 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v33 patches8 repliesSuperseded

Changes in v6 from the cover letter

- squash new patch into "Fixes:" patch

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/4mtd: spi-nor: otp: fix access to security registers in 4 byte modedrivers/mtd/spi-nor/otp.c+0 -20 replies
2/4mtd: spi-nor: otp: use more consistent wordingdrivers/mtd/spi-nor/otp.c+19 -80 replies
3/4mtd: spi-nor: otp: return -EROFS if region is read-onlydrivers/mtd/spi-nor/otp.c+38 -30 replies
4/4mtd: spi-nor: otp: implement erase for Winbond and similar flashesdrivers/mtd/spi-nor/core.c drivers/mtd/spi-nor/core.h drivers/mtd/spi-nor/otp.c +1 more+92 -10 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchPratyush YadavTudor Ambarus
1/4A-b R-b
2/4R-b R-b
3/4R-b R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/4] mtd: spi-nor: otp: 4 byte mode fix and erase support

This series is the follow up on the single patch
mtd: spi-nor: implement OTP erase for Winbond and similar flashes

Pratyush Yadav discovered a likely problem with bigger flashes, the address to access the security registers is either 3 or 4 byte (at least for winbond flashes).

Changes since v5:
- squash new patch into "Fixes:" patch

Changes since v4:
- add new patch to get rid taking the spi lock if length is zero. Please note, that I didn't squash this into the "Fixes:" patch because it is unrelated to the actual bug.
- add comment which explains that we could also branch on an error in spi_nor_mtd_otp_range_is_locked()
- check zero length in spi_nor_mtd_otp_erase() and return early before taking the lock

Changes since v3:
- new patch to check for read-only OTP regions before writing
- clarify term "security register"
- don't combine lock and erase functions anymore. there are now more difference than similarities.

Changes since v2:
- fix 3/4 byte mode access
- use spi_nor_erase_sector() by swapping the nor->erase_opcode
- use more consistent wording regarding the security registers

Changes since v1:
- fixed kernel doc

Michael Walle (4):
mtd: spi-nor: otp: fix access to security registers in 4 byte mode
mtd: spi-nor: otp: use more consistent wording
mtd: spi-nor: otp: return -EROFS if region is read-only
mtd: spi-nor: otp: implement erase for Winbond and similar flashes

 drivers/mtd/spi-nor/core.c    |   2 +-
 drivers/mtd/spi-nor/core.h    |   4 +
 drivers/mtd/spi-nor/otp.c     | 156 +++++++++++++++++++++++++++++++---
 drivers/mtd/spi-nor/winbond.c |   1 +
 4 files changed, 149 insertions(+), 14 deletions(-)
Signature · 1 line
2.20.1