[PATCH] MTD: fix partition scan control logic in physmap_ofand fsl_elbc_nand

Li Yang LeoLi at freescale.com
Fri Apr 25 07:09:59 EDT 2008


> -----Original Message-----
> From: David Woodhouse [mailto:dwmw2 at infradead.org] 
> Sent: Wednesday, April 23, 2008 2:49 AM
> To: Li Yang
> Cc: linux-mtd at lists.infradead.org; Stefan Roese; 
> linuxppc-dev at ozlabs.org
> Subject: Re: [PATCH] MTD: fix partition scan control logic in 
> physmap_ofand fsl_elbc_nand
> 
> On Thu, 2008-02-28 at 20:17 +0800, Li Yang wrote:
> > The generic rule for partition scan is to try all supported 
> partition 
> > types before an usable partition table is found.
> > However the original code returns unsuccessful when there 
> is an error 
> > in any of the partition types.
> > 
> > Signed-off-by: Li Yang <leoli at freescale.com>
> > Cc: Stefan Roese <sr at denx.de>
> > Cc: Peter Korsgaard <jacmet at sunsite.dk>
> > ---
> > I later found that Stefan has proposed a similar patch for 
> physmap_of 
> > and Peter proposed another patch to fix cmdlinepart instead.
> > I'd say that even after cmdlinepart patch is applied the 
> scan control 
> > logic still needs to be fixed.
> 
> I'm not convinced. I think the partition code should return 
> an error if it hits a hard error, like a failure to read from 
> the device. And return zero when it doesn't find anything.

The error can also be soft error like a typo in the cmdline or device
tree.  I could be better to try other ways to see if we can find a sane
partition table than just to fail.

- Leo



More information about the linux-mtd mailing list