Fix to jedec_probe unlock addresses

Eric W. Biederman ebiederman at lnxi.com
Thu Sep 23 17:36:17 EDT 2004


Ben Dooks <ben-mtd at fluff.org> writes:

> I took the jedec_probe alterations as I was unsure wether I was going
> to damage anything else by changing the cfi cmdset 0002 code.

Your patch is broken with respect to interleaving.  The interleave
gets applied twice.  Once in jedec_probe, and then again in
cfi_send_gen_cmd.


The bottom line is that we need to be consistent with how we do this.
Either we have magic addresses specified in terms as byte addresses
or we have magic addresses specified as device visible addresses.

Right now cfi_cmdset_0002 is the only place that does not use the
device width.

A 16bit device should not even be able to see a non-16bit 
aligned address, and we have to play games with the address
on the bus to handle interleaving so I don't see a reason
why we would want to disable multiplying by device size.

So it looks like the TODO item is to just look up what cfi standard
says are the unlock addresses for cfi command set 2. And make certain
the cfi hard codes are correct and nothing should be broken.

But even without that I would rather see cfi_cmdset_0002 fixed
then seeing this disagreement about how we should pass parameters
to cfi_cmdset_0002.  At least if we agree on conventions the broken
cases can be incrementally fixed until the code works properly for
everyone.

It is nice to see that this problem has nothing to do with
interleaving so that anyone with a 16bit or wider device can test
this.

Eric




More information about the linux-mtd mailing list