Skip to content

mtdchar: add MEMREAD ioctl

Michał Kępień linux-mtd lkml 4 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. v4 Latest4 patches 5 repliesApplied
  2. v34 patches 5 repliesSuperseded
  3. v25 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch9 repliesSuperseded

Changes in v4 from the cover letter

- Fixed two issues found by Richard Weinberger [1]:

- prevent integer overflow,
- use kvmalloc() for potentially large allocations.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4mtd: track maximum number of bitflips for each read requestdrivers/mtd/mtdcore.c include/linux/mtd/mtd.h+10 -01 reply
2/4mtd: always initialize 'stats' in struct mtd_oob_opsdrivers/mtd/inftlcore.c drivers/mtd/mtdswap.c drivers/mtd/nand/onenand/onenand_base.c +10 more+29 -291 reply
3/4mtd: add ECC error accounting for each read requestdrivers/mtd/devices/docg3.c drivers/mtd/nand/onenand/onenand_base.c drivers/mtd/nand/raw/nand_base.c +2 more+42 -01 reply
4/4mtdchar: add MEMREAD ioctldrivers/mtd/mtdchar.c include/uapi/mtd/mtd-abi.h+198 -52 replies

Reviews trailers per patch

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

PatchRichard Weinberger
1/4
2/4
3/4
4/4A-b

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

Read the v4 thread

Cover letter [PATCH v4 0/4] mtdchar: add MEMREAD ioctl

This patch series adds a new mtdchar ioctl, MEMREAD. Its purpose is to serve as a read counterpart of the MEMWRITE ioctl, exposing a broader set of capabilities for read operations (e.g. use of MTD_OPS_AUTO_OOB, access to ECC statistics) to user-space applications making use of MTD devices via /dev/mtd* character devices.

Changes from v3:

- Fixed two issues found by Richard Weinberger [1]:

- prevent integer overflow,
- use kvmalloc() for potentially large allocations.

(Identical fixes have already been applied to mtdchar_write_ioctl(), i.e. the write counterpart of the ioctl proposed in this patch series, in mtd/next. [2] [3])

Changes from v2:

- Squashed patch 1/5 into patch 5/5 to prevent breaking bisectability due to an incompatible ABI change between those two patches. Revised commit messages accordingly.

Changes from v1:

- Added patches 2-5 which enable the new MEMREAD ioctl to report ECC statistics for the read operation back to user space. (There are obviously different ways these changes can be split up into separate commits; I was aiming for maximum ease of review.)

- The 'retlen' and 'oobretlen' fields were not set in the struct mtd_read_req returned to userspace. This was done properly in Boris' original draft patch [1], but I missed it in my v1.

- Invalid IS_ERR() checks were replaced with NULL checks. This was an artifact of copy-pasting mtdchar_write_ioctl() in v1: unlike memdup_user() used therein, kmalloc() always returns NULL on error.

- Minor subject prefix adjustment for patch 1/5 ("mtd" -> "mtdchar").

[1] http://lists.infradead.org/pipermail/linux-mtd/2022-February/091276.html
[2] http://lists.infradead.org/pipermail/linux-mtd/2022-June/093829.html
[3] http://lists.infradead.org/pipermail/linux-mtd/2022-June/093828.html

Michał Kępień (4):
mtd: track maximum number of bitflips for each read request
mtd: always initialize 'stats' in struct mtd_oob_ops
mtd: add ECC error accounting for each read request
mtdchar: add MEMREAD ioctl

 drivers/mtd/devices/docg3.c             |   8 ++
 drivers/mtd/inftlcore.c                 |   6 +-
 drivers/mtd/mtdchar.c                   | 139 ++++++++++++++++++++++++
 drivers/mtd/mtdcore.c                   |   5 +
 drivers/mtd/mtdswap.c                   |   6 +-
 drivers/mtd/nand/onenand/onenand_base.c |  16 ++-
 drivers/mtd/nand/onenand/onenand_bbt.c  |   2 +-
 drivers/mtd/nand/raw/nand_base.c        |  10 ++
 drivers/mtd/nand/raw/nand_bbt.c         |   8 +-
 drivers/mtd/nand/raw/sm_common.c        |   2 +-
 drivers/mtd/nand/spi/core.c             |  10 ++
 drivers/mtd/nftlcore.c                  |   6 +-
 drivers/mtd/sm_ftl.c                    |   4 +-
 drivers/mtd/ssfdc.c                     |   2 +-
 drivers/mtd/tests/nandbiterrs.c         |   2 +-
 drivers/mtd/tests/oobtest.c             |   8 +-
 drivers/mtd/tests/readtest.c            |   2 +-
 fs/jffs2/wbuf.c                         |   6 +-
 include/linux/mtd/mtd.h                 |   7 ++
 include/uapi/mtd/mtd-abi.h              |  64 ++++++++++-
 20 files changed, 279 insertions(+), 34 deletions(-)
Signature · 7 lines
2.37.0



______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/