linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Lior Amsalem <alior@marvell.com>,
	Tawfik Bayouk <tawfik@marvell.com>,
	Daniel Mack <zonque@gmail.com>,
	linux-mtd@lists.infradead.org,
	Gregory Clement <gregory.clement@free-electrons.com>
Subject: Re: [PATCH 2/2] mtd: nand: pxa3xx: Allocate data buffer on detected flash size
Date: Wed, 16 Oct 2013 07:25:58 -0300	[thread overview]
Message-ID: <20131016102557.GA2518@localhost> (raw)
In-Reply-To: <20131015194159.GV23337@ld-irv-0074.broadcom.com>

On Tue, Oct 15, 2013 at 12:41:59PM -0700, Brian Norris wrote:
> On Fri, Oct 04, 2013 at 03:30:38PM -0300, Ezequiel Garcia wrote:
> > This commit replaces the currently hardcoded buffer size, by a
> > dynamic detection scheme. First a small 256 bytes buffer is allocated
> > so the device can be detected (using READID and friends commands).
> > 
> > After detection, this buffer is released and a new buffer is allocated
> > to acommodate the page size plus out-of-band size.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> >  drivers/mtd/nand/pxa3xx_nand.c | 45 ++++++++++++++++++++++++++++--------------
> >  1 file changed, 30 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> > index a47c67f..bfb2b9f 100644
> > --- a/drivers/mtd/nand/pxa3xx_nand.c
> > +++ b/drivers/mtd/nand/pxa3xx_nand.c
> > @@ -39,6 +39,13 @@
> >  #define NAND_STOP_DELAY		(2 * HZ/50)
> >  #define PAGE_CHUNK_SIZE		(2048)
> >  
> > +/*
> > + * Define a buffer size for the initial command that detects the flash device:
> > + * STATUS, READID and PARAM. The largest of these is the PARAM command,
> > + * needing 256 bytes.
> > + */
> > +#define INIT_BUFFER_SIZE	256
> > +
> 
> Actually, PARAM tries to get 768 bytes in nand_base.c to retrieve the
> redundant copies, but your current driver implementation seems to ignore
> the 2nd and 3rd parameter pages by returning 0xFF.
> 
> So this is not a criticism of the current patch, but you may want to
> consider improving your NAND_CMD_PARAM support (also, you don't support
> NAND_CMD_RNDOUT, which is now used for extended parameter page support).
> 

Ah, good input. I'll research a bit more and try to cook a patch, it doesn't
sound like a lot of work, and it would be nice to have better command support.

Thanks,
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

  reply	other threads:[~2013-10-16 10:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04 18:30 [PATCH 0/2] pxa3xx: Data buffer dynamic allocation Ezequiel Garcia
2013-10-04 18:30 ` [PATCH 1/2] mtd: nand: pxa3xx: Move DMA I/O enabling Ezequiel Garcia
2013-10-04 18:30 ` [PATCH 2/2] mtd: nand: pxa3xx: Allocate data buffer on detected flash size Ezequiel Garcia
2013-10-15 19:41   ` Brian Norris
2013-10-16 10:25     ` Ezequiel Garcia [this message]
2013-10-09 11:48 ` [PATCH 0/2] pxa3xx: Data buffer dynamic allocation Ezequiel Garcia
2013-10-09 12:00   ` Daniel Mack
2013-10-09 14:03     ` Ezequiel Garcia
2013-10-15 18:29       ` Ezequiel Garcia
2013-10-15 19:16         ` Brian Norris
2013-10-15 20:47 ` Brian Norris
2013-10-16 11:05   ` Ezequiel Garcia

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=20131016102557.GA2518@localhost \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=alior@marvell.com \
    --cc=computersforpeace@gmail.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tawfik@marvell.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=zonque@gmail.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;
as well as URLs for NNTP newsgroup(s).