All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Kevin Cernekee <cernekee@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [RFC] mtd: nand: separate chip options / bbt_options
Date: Fri, 22 Apr 2011 11:02:09 +0300	[thread overview]
Message-ID: <1303459329.2757.40.camel@localhost> (raw)
In-Reply-To: <1303283589-14415-1-git-send-email-computersforpeace@gmail.com>

Hi Brian,

On Wed, 2011-04-20 at 00:13 -0700, Brian Norris wrote:
> This RFC begins to handle the conflicts we've been having with using
> conflicting flags from nand.h and bbm.h in the same nand_chip.options
> field. We should try to separate these two spaces a little more
> clearly, and so I have added a bbt_options field to nand_chip.

Sounds good.

> Important notes about nand_chip fields:
> * bbt_options field should contain ONLY flags from bbm.h. They should
>   be able to pass safely to a nand_bbt_descr data structure.
> * options field should contian ONLY flags from nand.h. Ideally, they
>   should not be involved in any BBT related options.

Sounds good. I'd add the following:

* NAND chip option flags start with the: NAND_ prefix
* BBT options start with BBT_ prefix.

You may choose different prefixes, e.g., NAND_BBT_ for BBT options, but
the separation is needed, I think. Also, the renaming of the options
should be a separate patch or set of patches.

I'd also add:
* Every flag should have a nice comment explaining what the flag is.

This is optional, but would be nice :-)

> Other things to consider (not yet implemented):
> * Is it safe to move NAND_CREATE_EMPTY_BBT to bbm.h and require it to be
>   put in bbt_options? It seems not to be used by any in-kernel drivers
>   so it's only likely to mess with independent drivers...

What exactly this option mean and how could it be used?

> 
> * Consider the following three flags:
>   (1) NAND_USE_FLASH_BBT (nand.h)
>   (2) NAND_USE_FLASH_BBT_NO_OOB (nand.h)
>   (3) NAND_BBT_NO_OOB (bbm.h)
> 
>   These flags are all related, yet they are in different headers. Also,
>   flag (2) is simply the combination of (1) and (3) and seemingly can be
>   eliminated. Is it safe to move (1) and (3) to bbm.h and remove (2)
>   altogether? (with appropriate code adjustments of course)

Yes, I think so.

> Regarding Artem's suggestion of bit-fields:
> If we turn all the flags into bit-fields in nand_chip, we still need to
> add these fields to the bbt_descr, right? That seems like too much
> duplication of information and would just be messier.

Let's for get about this for now, then. We can look at this idea at the
end of the clean-up then, again, may be.

Thanks!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2011-04-22  8:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-19  4:53 [PATCH 1/2] mtd: nand: renumber conflicting BBT flags Brian Norris
2011-03-19  4:53 ` [PATCH 2/2] mtd: nand: dynamic allocation of flash-based BBT structs Brian Norris
2011-03-31 12:58 ` [PATCH 1/2] mtd: nand: renumber conflicting BBT flags Artem Bityutskiy
2011-04-02  8:04   ` Brian Norris
2011-04-04  7:52     ` Artem Bityutskiy
2011-04-20  7:13       ` [RFC] mtd: nand: separate chip options / bbt_options Brian Norris
2011-04-22  8:02         ` Artem Bityutskiy [this message]
2011-05-25 18:15           ` Brian Norris
2011-05-26  8:04             ` Sebastian Andrzej Siewior
2011-05-31 17:25               ` Brian Norris
2011-04-04  7:58 ` [PATCH 1/2] mtd: nand: renumber conflicting BBT flags Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1303459329.2757.40.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=cernekee@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.