Wrong CFI offset in cfi_cmdset_0001.c

Jared Hulbert jaredeh at gmail.com
Tue Oct 25 14:20:15 EDT 2005


On 10/25/05, Josh Boyer <jdub at us.ibm.com> wrote:
> On Mon, 2005-10-24 at 18:00 -0700, Jared Hulbert wrote:
> > Sorry. It took me longer than it should have to track down a P30 part
> > and get it on my machine.  Does this work for you?
>
> No worries.  The patch seems to be working fine on my P30 chips.  I
> don't have any other chips to test on at the moment, but it looks like
> it should work.
>
> Nicolas, could you try it on the chips you have?

FYI - I did try this on L18, M18, and P30.

> >
> > [MTD] CHIPS: fix for P30 cfi parsing
> >
> > Change to the extended cfi table parsing for Intel NOR flash that uses
> > the info in the extended table to 'walk' the table rather than using
> > hard coding for various primary extended query table version numbers.
> > [From: Jared Hulbert <jaredeh at gmail.com>]
> >
> > Index: trunk/drivers/mtd/chips/cfi_cmdset_0001.c
> > ===================================================================
> > --- trunk/drivers/mtd/chips/cfi_cmdset_0001.c (revision 8)
> > +++ trunk/drivers/mtd/chips/cfi_cmdset_0001.c (revision 10)
> > @@ -285,7 +285,7 @@
> >                             sizeof(struct cfi_intelext_otpinfo);
> >
> >               /* Burst Read info */
> > -             extra_size += (extp->MinorVersion < '4') ? 6 : 5;
> > +             extra_size += (unsigned int)extp->extra[extra_size+1]+2;
> >
> >               /* Number of hardware-partitions */
> >               extra_size += 1;
> > @@ -519,7 +519,7 @@
> >                      sizeof(struct cfi_intelext_otpinfo);
> >
> >               /* Burst Read info */
> > -             offs += (extp->MinorVersion < '4') ? 6 : 5;
> > +             offs += (int)extp->extra[offs+1]+2;
>
> Why (int) here and (unsigned int) above?  Not a big deal, but I'm
> curious.

off is an int, extra_size is an unsigned int.  Though off should
probably be made unsigned as well.




More information about the linux-mtd mailing list