linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Stefan Agner <stefan@agner.ch>,
	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 v3 2/2] mtd: rawnand: add hooks that may be called during nand_scan()
Date: Fri, 27 Jul 2018 00:47:41 +0200	[thread overview]
Message-ID: <20180727004741.4a7db9a6@xps13> (raw)
In-Reply-To: <20180727004032.5b42b62e@bbrezillon>

Hi Boris, Stefan,

Boris Brezillon <boris.brezillon@bootlin.com> wrote on Fri, 27 Jul 2018
00:40:32 +0200:

> On Fri, 27 Jul 2018 00:20:50 +0200
> Stefan Agner <stefan@agner.ch> wrote:
> 
> > On 26.07.2018 20:12, Boris Brezillon wrote:  
> > > On Thu, 26 Jul 2018 18:22:10 +0200
> > > Stefan Agner <stefan@agner.ch> wrote:    
> > >> > +/**
> > >> > + * struct nand_controller_ops - Controller operations
> > >> > + *
> > >> > + * @attach_chip: Callback that will be called between nand_detect() and
> > >> > + *		 nand_scan_tail() during nand_scan() (optional).
> > >> > + * @detach_chip: Callback that will be called from nand_cleanup() or if
> > >> > + *		 nand_scan_tail() fails (optional).    
> > >>
> > >> This documentation reads not very helpful to me.
> > >>
> > >> It would be useful if it is written more from the driver developers
> > >> perspective, e.g. what those callbacks ideally are supposed to do...
> > >>    
> > > 
> > > Indeed. How about:
> > > 
> > > 	@attach_chip: this method is called between after the NAND    
> > 
> > I guess just after.  
> 
> Yep.
> 
> >   
> > > 		      detection phase to let controller driver
> > > 		      tweak/customize the configuration based on the
> > > 		      NAND properties (page size, OOB size, ECC
> > > 		      requirements, ...).    
> > 
> > Maybe explicitly state that NAND flash parameters are available in this
> > call, e.g.
> > 
> > 	@attach_chip: this method is called after the NAND detection 
> > 		      phase after flash ID and MTD fields such as
> > 		      erase size, page size and OOB size have been
> > 		      set up. ECC requirements are available if
> > 		      provided by the NAND chip or device tree.
> > 		      Typically used to chose the appropriate ECC  
> 
> 					^ choose
> 
> > 		      config and allocate associated resources.
> > 		      This hook is optional.
> >   
> 
> Sounds good.
> 
> >   
> > > 	@detach_chip: free all resources allocated/claimed in
> > > 		      nand_controller_ops->detach_chip().    
> > 
> > That probably should read nand_controller_ops->attach_chip().  
> 
> And yes, I meant attach_chip().
> 
> >   
> > > 		      This hook is optional.    

Maybe I've been a bit lazy on the documentation :)

Thanks Stefan for pointing it, I'll fix when applying with the above
proposal.

Miquèl

  reply	other threads:[~2018-07-26 22:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 23:12 [PATCH v3 0/2] Changes in the internal raw NAND API Miquel Raynal
2018-07-18 23:12 ` [PATCH v3 1/2] mtd: rawnand: better name for the controller structure Miquel Raynal
2018-07-18 23:12 ` [PATCH v3 2/2] mtd: rawnand: add hooks that may be called during nand_scan() Miquel Raynal
2018-07-26 16:22   ` Stefan Agner
2018-07-26 18:12     ` Boris Brezillon
2018-07-26 22:20       ` Stefan Agner
2018-07-26 22:40         ` Boris Brezillon
2018-07-26 22:47           ` Miquel Raynal [this message]
2018-07-26 23:12             ` Miquel Raynal
2018-07-19  6:11 ` [PATCH v3 0/2] Changes in the internal raw NAND API Boris Brezillon
2018-07-19 21:10 ` 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=20180727004741.4a7db9a6@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 \
    --cc=stefan@agner.ch \
    /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;
as well as URLs for NNTP newsgroup(s).