[PATCH 6/6] add NAND_BUSWIDTH_AUTO

Brian Norris computersforpeace at gmail.com
Wed Jun 29 12:37:39 EDT 2011


Hi,

I have a few comments below.

On Sun, Jun 26, 2011 at 9:26 AM, Matthieu CASTET
<matthieu.castet at parrot.com> wrote:
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3096,11 +3096,16 @@ ident_done:
...
> +       if (chip->options & NAND_BUSWIDTH_AUTO) {
> +               BUG_ON(chip->options & NAND_BUSWIDTH_16);
> +               chip->options |= busw;
> +               nand_set_defaults(chip, busw);
> +       }

Doesn't this get called after nand_set_defaults() is already called?
(see nand_scan_ident) If so, then changing the buswidth here won't
actually affect any of the function assignments. That's probably not
your expected behavior, is it?

> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -240,6 +240,11 @@ typedef enum {
...
> +/* autodetect nand buswidth with readid. This suppose the driver will
> + * configure the hardware has 8 bit in nand_scan_ident, and update
> + * configuration before calling nand_scan_tail
> + */

This is not the correct multi-line comment format.

> +#define NAND_BUSWIDTH_AUTO                     0x02000000

I recently did some revamping of a lot of these flags, so the
numbering has all changed in Artem's staging tree, l2-mtd-2.6.git.
Assuming both our patches are taken into mainline, it'd probably be
good if you rebased on the l2 tree and choose a new bit value for this
flag. AFAICT it'd be good like:

+#define NAND_BUSWIDTH_AUTO                     0x00080000

Brian



More information about the linux-mtd mailing list