[U-Boot] [PATCH] [nand] Implement nand_extent_skip_bad

Scott Wood scottwood at freescale.com
Tue Dec 11 18:13:55 CET 2012


On 12/11/2012 03:40:53 AM, Pantelis Antoniou wrote:
> Hi Scott,
> 
> On Dec 11, 2012, at 12:53 AM, Scott Wood wrote:
> 
> >> +/**
> >> + * nand_extent_skip_bad:
> >> + *
> >> + * Find the extent of a chunk, return the offset where it ends
> >> + * Blocks that are marked bad are skipped and the next block is  
> examined
> >> + * instead as long as the extend is short enough to fit even  
> after skipping the
> >> + * bad blocks.
> >> + *
> >> + * @param nand NAND device
> >> + * @param offset offset in flash
> >> + * @param length extend length
> >> + * @return next offset in case of success (loff_t)-1 on error
> >> + */
> >
> > Would it be better to return this information from existing  
> read/write functions -- either instead of or in addition to exporting  
> this functionality?
> >
> 
> Yes it would. However that would require modifying all callers, which  
> would be a hard sell when there's only one user of it.

There aren't that many callers, and it's all common code (so no issue  
with testing on obscure hardware).

> > This seems duplicative of check_skip_len().
> >
> 
> It is. check_skip_len doesn't return the information I need. I could  
> modify check_skip_len with
> an extra parameter if that's going to be OK with you.

Yes, please modify check_skip_len() instead.

-Scott


More information about the U-Boot mailing list