Skip to content

mtd: core: protect access to mtd devices while in suspend

Sean Nyekjaer linux-mtd lkml 5 versions – Applied

Status from this message: Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 24 repliesApplied
  2. v44 patches 5 repliesSuperseded
  3. v34 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 of 4 patches4 repliesSuperseded
v13 patches18 repliesSuperseded

Changes in v5 from the cover letter

- removed protection around _panic_write()
- removed all fixes tag, as a simpler solution is needed for backporting.

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/4mtd: rawnand: nand_bbt: hide suspend/resume hooks while scanning bbtdrivers/mtd/nand/raw/nand_bbt.c+27 -11 reply
2/4mtd: mtdconcat: don't use mtd_{suspend,resume}()drivers/mtd/mtdconcat.c+13 -21 reply
3/4mtd: core: protect access to MTD devices while in suspenddrivers/mtd/mtdcore.c include/linux/mtd/mtd.h+169 -2721 replies
4/4mtd: rawnand: remove suspended checkdrivers/mtd/nand/raw/nand_base.c include/linux/mtd/rawnand.h+14 -431 reply

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchSean NyekjaerMiquel Raynal
1/4T-b
2/4T-b
3/4
4/4R-b

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

Read the v5 thread

Cover letter [PATCH v5 0/4] mtd: core: protect access to mtd devices while in suspend

Changes since v4:
- removed protection around _panic_write()
- removed all fixes tag, as a simpler solution is needed for backporting.

Follow-up on discussion in:
https://lkml.org/lkml/2021/10/4/41
https://lkml.org/lkml/2021/10/11/435

Changes since v3:
- edited commit msg and author for mtdconcat patch

Changes since v2:
- added signoff's to patch from Boris
- removed accidential line break
- kept tests consistent: master->master.suspended == 0 -> !master->master.suspended
- added comments to mtdconcat patch
- moved mtdconcat before ('mtd: core: protect access to MTD devices while in suspend')

Changes since v1:
- removed __mtd_suspend/__mtd_resume functions as they are not used by mtdconcat anymore.
- only master mtd_info is used for mtd_{start,end}_access(). Warn if we got mtd's.
- added Boris patch for using uninitialized _suspend/_resume hooks when bbt scanning
- mtdconcat uses device _suspend/_resume hooks
- I don't really like the macro proposal from Boris mtd_no_suspend_void_call()/mtd_no_suspend_ret_call() I think they make the code complex to read and the macro's doesn't fit every where anyway...

Changes since from rfc v1/v2:
- added access protection for all device access hooks in mtd_info.
- added Suggested-by to [1/3] patch.
- removed refereces to commit ef347c0cfd61 ("mtd: rawnand: gpmi: Implement exec_op") from commit msg as commit 013e6292aaf5 ("mtd: rawnand: Simplify the locking") is to be blamed.
- tested on a kernel with LOCKDEP enabled.

Boris Brezillon (2):
mtd: rawnand: nand_bbt: hide suspend/resume hooks while scanning bbt
mtd: mtdconcat: don't use mtd_{suspend,resume}()

Sean Nyekjaer (2):
mtd: core: protect access to MTD devices while in suspend
mtd: rawnand: remove suspended check

 drivers/mtd/mtdconcat.c          |  15 +++-
 drivers/mtd/mtdcore.c            | 124 +++++++++++++++++++++++++++----
 drivers/mtd/nand/raw/nand_base.c |  52 ++++---------
 drivers/mtd/nand/raw/nand_bbt.c  |  28 ++++++-
 include/linux/mtd/mtd.h          |  81 ++++++++++++++++----
 include/linux/mtd/rawnand.h      |   5 +-
 6 files changed, 230 insertions(+), 75 deletions(-)
Signature · 1 line
2.33.0