public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Michał Kępień" <kernel@kempniu.pl>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/5] mtdchar: add MEMREAD ioctl
Date: Thu, 16 Dec 2021 11:24:56 +0100	[thread overview]
Message-ID: <20211216112456.327298dd@collabora.com> (raw)
In-Reply-To: <20211216083418.13512-1-kernel@kempniu.pl>

On Thu, 16 Dec 2021 09:34:13 +0100
Michał Kępień <kernel@kempniu.pl> wrote:

> 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 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] https://www.infradead.org/pipermail/linux-mtd/2016-April/067187.html
> 
> Michał Kępień (5):
>   mtdchar: add MEMREAD ioctl
>   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: extend MEMREAD ioctl to return ECC statistics

Splitting patch 1 and 5 means you have an incompatible ABI change
between those 2 commits, thus breaking bisectability. I'd recommend
putting patches 2-4 first and squashing patch 1 and 5 in a single
commit placed at the end of the series. The other options would be to
add a way to extend ioctls in a backward compatible way (the DRM
subsystem does that by filling the unspecified part of the struct with
zeros, and relying on the fact that 0 values always implies 'default
behavior' when the struct is extended [1]).

[1]https://elixir.bootlin.com/linux/v5.16-rc5/source/drivers/gpu/drm/drm_ioctl.c#L882

> 
>  drivers/mtd/devices/docg3.c             |   8 ++
>  drivers/mtd/inftlcore.c                 |   6 +-
>  drivers/mtd/mtdchar.c                   | 136 ++++++++++++++++++++++++
>  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, 276 insertions(+), 34 deletions(-)
> 


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

  parent reply	other threads:[~2021-12-16 10:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16  8:34 [PATCH v2 0/5] mtdchar: add MEMREAD ioctl Michał Kępień
2021-12-16  8:34 ` [PATCH v2 1/5] " Michał Kępień
2021-12-16  8:34 ` [PATCH v2 2/5] mtd: track maximum number of bitflips for each read request Michał Kępień
2021-12-16  8:34 ` [PATCH v2 3/5] mtd: always initialize 'stats' in struct mtd_oob_ops Michał Kępień
2021-12-16  8:34 ` [PATCH v2 4/5] mtd: add ECC error accounting for each read request Michał Kępień
2021-12-16  8:34 ` [PATCH v2 5/5] mtdchar: extend MEMREAD ioctl to return ECC statistics Michał Kępień
2021-12-16 10:24 ` Boris Brezillon [this message]
2021-12-16 13:12   ` [PATCH v2 0/5] mtdchar: add MEMREAD ioctl Michał Kępień

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216112456.327298dd@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=kernel@kempniu.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox