[PATCH] mtd: use the full-id string as the keyword to search the id table

Brian Norris computersforpeace at gmail.com
Wed Feb 22 03:18:00 EST 2012


On Mon, Feb 20, 2012 at 7:21 PM, Huang Shijie <b32955 at freescale.com> wrote:
>> Do you have a particular reason why the nand_flash_full_ids[] and
>> nand_flash_ids[] tables can't be merged, and (1) (2) and (4) performed
>
> The particular reason is we can not get the right chipsize when two
> same Device ids appears.

But if we make some small changes to how the table is parsed (as I
already mentioned), then we can order entries properly, such that the
longest ID strings are at the top, with more generic strings (with
just the device ID, for instance, that still require ID decoding)
placed lower in the table. That would allow multiple uses of the same
device ID, matching to the most specific entry available.

> We can not get the right chipsize from H27UBG8T2A's ID data. There is
> already a 0xd7 device id in the nand_flash_ids table.

There is already a 0xD7 device ID, but it's correct, isn't it? I mean,
H27UBG8T2A is 32 Gbit and so is 0xD7? There's still a problem with
parsing the other properties, but there *is* a provided parsing table,
as mentioned already.

>> only after the ONFI detection? We simply order the "full ID" entries
>> first in the table, so that if they match, then we break out of our
>
> I ever thought this method too,  It does works too.
> But  it makes the nand_flash_ids mess in logic. The full ID entries stands
> for single nands, while
> the others stand for a class of nands.  Is the "mess in logic" acceptable to
> us?
>
> I do not object this method, If Artem also agrees this method, I can change
> the patch.

Alright. We'll see if Artem will appear again soon. Looks like he's
been busy with other things for the last week or so.

BTW, there are a few other issues:

(1) you missed a change to nandsim's usage of nand_flash_ids[]
(2) are the SZ_* macros safe to use here? Compilation here (i386,
defconfig + MTD enabled) fails with stuff like the following:

  CC      drivers/mtd/nand/nand_ids.o
drivers/mtd/nand/nand_ids.c:18:5: error: ‘SZ_8K’ undeclared here (not
in a function)

If I make some tweaks or have my own additions based on your patches,
is it best to send my own patch series with your name included in the
description, or is there some official way of tagging it? (Like just a
"Signed-off-by" on an ACKed, final version?)

Brian



More information about the linux-mtd mailing list