public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: remove stale comment in mtd_oob_ops structure
Date: Tue, 17 Jul 2018 14:25:24 +0200	[thread overview]
Message-ID: <20180717142524.434972e6@bbrezillon> (raw)
In-Reply-To: <20180714123234.16127-1-miquel.raynal@bootlin.com>

On Sat, 14 Jul 2018 14:32:34 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> A comment in the kernel doc of the mtd_oob_ops structure tells that it
> is not possible to write more than one page with OOB. This was
> probably true at some time in the past but today it is entirely wrong.
> 
> As one can see for instance in the nand_do_write_ops() helper available
> in the NAND core, this implementation called by mtd->_write_oob()
> simply loops over the pages until everything has been written.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  include/linux/mtd/mtd.h | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
> index a86c4fa93115..59578aab277a 100644
> --- a/include/linux/mtd/mtd.h
> +++ b/include/linux/mtd/mtd.h
> @@ -66,10 +66,6 @@ struct mtd_erase_region_info {
>   *		mode = MTD_OPS_PLACE_OOB or MTD_OPS_RAW)
>   * @datbuf:	data buffer - if NULL only oob data are read/written
>   * @oobbuf:	oob data buffer
> - *
> - * Note, it is allowed to read more than one OOB area at one go, but not write.
> - * The interface assumes that the OOB write requests program only one page's
> - * OOB area.

Hm, I wouldn't be so prompt at nuking this comment since some
implementations (like onenand) really have this limitation. How about
adjusting the comment to reflect the fact that this limitation is
implementation dependent?

"
Note, some MTD drivers do not allow you to write more than one OOB area
at one go. If you try to do that on such an MTD device, -EINVAL will be
returned. If you want to make your implementation portable on all kind
of MTD devices you should split the write request into several
sub-requests when the request crosses a page boundary.
"

>   */
>  struct mtd_oob_ops {
>  	unsigned int	mode;

  reply	other threads:[~2018-07-17 12:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-14 12:32 [PATCH] mtd: remove stale comment in mtd_oob_ops structure Miquel Raynal
2018-07-17 12:25 ` Boris Brezillon [this message]
2018-07-17 12:34   ` Miquel Raynal
2018-07-17 12:39     ` Boris Brezillon

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=20180717142524.434972e6@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    /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