[PATCH] mtd: nand: auto-detection of NAND bus-width from ONFI param or nand_id[]

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Mon Nov 25 09:52:18 EST 2013


On Mon, Nov 25, 2013 at 01:26:11PM +0000, Gupta, Pekon wrote:
> Hi Ezequiel,
> 
> 
> > From: Ezequiel Garcia [mailto:ezequiel.garcia at free-electrons.com]
> > Thanks for taking care of this! :-)
> > 
> Yes, I was waiting for -rc1 to be TI-GPMC driver which still gets configured
> from DT independently. However that’s a separate discussion already
> going in your earlier thread.
> 
> 
> > > On Mon, Nov 25, 2013 at 06:02:08PM +0530, Pekon Gupta wrote:
> [...]
> > > +
> > > +	/* re-configure driver is bus-width was incorrectly configured */
> > > +	if (busw != (chip->options & NAND_BUSWIDTH_16)) {
> > > +		pr_warn("reconfiguring NAND bus width to %d instead %d
> > bit\n",
> > > +			   busw ? 16 : 8,
> > > +			   (chip->options & NAND_BUSWIDTH_16) ? 16 : 8);
> > > +		chip->options = (chip->options & ~NAND_BUSWIDTH_16) |
> > busw;
> > 
> > Looking at this makes me wonder why are we *re* configuring, instead of
> > just configuring. I mean, why do we keep the NAND_BUSWIDTH_16 setting?
> > 
> > What use case might need the user to set it, before hand?
> > 
> Nothing.. I just said reconfiguring, bcoz some driver already configure
> 'chip->options & NAND_BUSWIDTH_16' pre-hand before calling
> nand_scan_ident(). So, I wanted to convey that this patch should not
> affect any of their functionality. And no change is should be required.
> 
> Need this to get tested with -ve testing on different boards.. 
> (like setting in-correct DT binding nand-bus-width and driver should still
> be able to detect and probe ONFI params) Then only it proves that this
> patch is actually auto-detecting bus-width under all cases for all controllers.
> 

You seem to keep insisting with the kernel auto-fixing after wrong DT
configuration. I don't think that should matter.

My point is: why don't we *remove* the devicetree property nand-bus-width and the
NAND_BUSWIDTH_16 entirely, together with this patch?

Sounds like the user shouldn't need to mess with any of these, since we
are able to auto-configure things for him.
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-mtd mailing list