public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>
Subject: Re: [PATCH 3/7] mtd: rawnand: Expose _notsupp() helpers for raw page accessors
Date: Thu, 19 Jul 2018 23:15:39 +0200	[thread overview]
Message-ID: <20180719231539.0f519cc5@xps13> (raw)
In-Reply-To: <20180719112217.592b6484@bbrezillon>

Hi Boris,

Boris Brezillon <boris.brezillon@bootlin.com> wrote on Thu, 19 Jul 2018
11:22:17 +0200:

> On Wed, 18 Jul 2018 10:42:17 +0200
> Boris Brezillon <boris.brezillon@bootlin.com> wrote:
> 
> > Some implementations simply can't disable their ECC engine. Expose
> > helpers returning -ENOTSUPP so that the caller knows that raw accesses
> > are not supported instead of silently falling back to non-raw
> > accessors.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> > ---
> >  drivers/mtd/nand/raw/nand_base.c | 33 +++++++++++++++++++++++++++++++++
> >  include/linux/mtd/rawnand.h      |  4 ++++
> >  2 files changed, 37 insertions(+)
> > 
> > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> > index 4fa5e20d9690..323a900f3697 100644
> > --- a/drivers/mtd/nand/raw/nand_base.c
> > +++ b/drivers/mtd/nand/raw/nand_base.c
> > @@ -2966,6 +2966,23 @@ int nand_check_erased_ecc_chunk(void *data, int datalen,
> >  }
> >  EXPORT_SYMBOL(nand_check_erased_ecc_chunk);
> >  
> > +/**
> > + * nand_read_page_raw_notsupp - dummy read raw page function
> > + * @mtd: mtd info structure
> > + * @chip: nand chip info structure
> > + * @buf: buffer to store read data
> > + * @oob_required: caller requires OOB data read to chip->oob_poi
> > + * @page: page number to read
> > + *
> > + * Returns -ENOTSUPP unconditionally.
> > + */
> > +int nand_read_page_raw_notsupp(struct mtd_info *mtd, struct nand_chip *chip,
> > +			       u8 *buf, int oob_required, int page)
> > +{
> > +	return -ENOTSUPP;
> > +}
> > +EXPORT_SYMBOL(nand_read_page_raw_notsupp);
> > +
> >  /**
> >   * nand_read_page_raw - [INTERN] read raw page data without ecc
> >   * @mtd: mtd info structure
> > @@ -3960,6 +3977,22 @@ static int nand_read_oob(struct mtd_info *mtd, loff_t from,
> >  	return ret;
> >  }
> >  
> > +/**
> > + * nand_write_page_raw - dummy raw page write function  
> 
> Crap, I forgot to add the _notsupp suffix in the doc.

Suffix "_notsupp" added.

Miquèl

  reply	other threads:[~2018-07-19 21:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18  8:42 [PATCH 1/7] mtd: rawnand: micron: Fix on-die ECC detection logic Boris Brezillon
2018-07-18  8:42 ` [PATCH 2/7] mtd: rawnand: micron: support 8/512 on-die ECC Boris Brezillon
2018-07-18 18:32   ` Boris Brezillon
2018-07-18  8:42 ` [PATCH 3/7] mtd: rawnand: Expose _notsupp() helpers for raw page accessors Boris Brezillon
2018-07-19  9:22   ` Boris Brezillon
2018-07-19 21:15     ` Miquel Raynal [this message]
2018-07-18  8:42 ` [PATCH 4/7] mtd: rawnand: micron: allow forced on-die ECC Boris Brezillon
2018-07-18 18:32   ` Boris Brezillon
2018-07-18  8:42 ` [PATCH 5/7] mtd: rawnand: micron: Get the actual number of bitflips Boris Brezillon
2018-07-18  8:42 ` [PATCH 6/7] mtd: rawnand: micron: Avoid enabling/disabling ECC when it can't be disabled Boris Brezillon
2018-07-18  8:42 ` [PATCH 7/7] mtd: rawnand: micron: Make ECC activation stateful Boris Brezillon
2018-07-18 21:38 ` [PATCH 1/7] mtd: rawnand: micron: Fix on-die ECC detection logic Miquel Raynal

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=20180719231539.0f519cc5@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.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