[PATCH] mtd: spi-nor: read 6 bytes for the ID

Huang Shijie shijie.huang at intel.com
Tue Aug 5 17:23:46 PDT 2014


On Tue, Aug 05, 2014 at 09:14:11AM +0200, Marek Vasut wrote:
> On Tuesday, August 05, 2014 at 02:52:00 AM, Huang Shijie wrote:
> > On Mon, Aug 04, 2014 at 04:24:07PM -0700, Brian Norris wrote:
> > > The logic here is just plain convoluted, because we haven't updated the
> > > flash_info struct to contain the ID length. Please fix this. Just like
> > > struct nand_flash_dev, we probably need an 'id_len' field. Bonus points
> > > if you can extend the structure properly without having to modify the
> > > entire existing table... Maybe a new INFO6() macro? (Better name
> > > suggestions are welcome.)
> > 
> > ok. I will try to add a "id_len" field in the next patch.
> > 
> > > Another reason for adding this field: what if we need to match to a
> > > 6-byte ID where the 6th byte is 0x00? I already see a 5-byte ID in our
> > > table where the 5th byte is 0x00.
> > 
> > I think it is okay if the 6the byte is 0x00.
> > Anyway, we do not meet such NOR. If we meet such NOR in future, we
> > can check it carefully, and see if we need to change the code a little.
> 
> Well, I expressed my disagreement on that matter a few times already. Like Brian 
> mentioned, adding an id_len field would be the way to go. It would prevent all 
> kinds of crazy wrap-arounds when reading the IDs and other such strange 
> behavior.
thanks Marek, but i need to collect more comments to change patch.
Brian was busy in the past month.. 

thanks again.
Huang Shijie



More information about the linux-mtd mailing list