All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	linux-mtd@lists.infradead.org,
	Richard Weinberger <richard@nod.at>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 1/2] mtd: nand: Drop mtd.owner requirement in nand_scan
Date: Sat, 2 Apr 2016 15:52:16 +0200	[thread overview]
Message-ID: <20160402155216.48866776@bbrezillon> (raw)
In-Reply-To: <20160401222649.GK2545@google.com>

On Fri, 1 Apr 2016 15:26:49 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> On Fri, Apr 01, 2016 at 06:29:23PM -0300, Ezequiel Garcia wrote:
> > Since commit 807f16d4db95 ("mtd: core: set some defaults
> > when dev.parent is set"), it's now legal for drivers
> > to call nand_scan and nand_scan_ident without setting
> > mtd.owner.
> > 
> > Drop the check and while at it remove the BUG() abuse.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> > ---
> >  drivers/mtd/nand/nand_base.c | 10 +---------
> >  1 file changed, 1 insertion(+), 9 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> > index c3733a10a6e7..befa04ef4a04 100644
> > --- a/drivers/mtd/nand/nand_base.c
> > +++ b/drivers/mtd/nand/nand_base.c
> > @@ -4013,7 +4013,6 @@ static int nand_dt_init(struct nand_chip *chip)
> >   * This is the first phase of the normal nand_scan() function. It reads the
> >   * flash ID and sets up MTD fields accordingly.
> >   *
> > - * The mtd->owner field must be set to the module of the caller.
> >   */
> >  int nand_scan_ident(struct mtd_info *mtd, int maxchips,
> >  		    struct nand_flash_dev *table)
> > @@ -4433,19 +4432,12 @@ EXPORT_SYMBOL(nand_scan_tail);
> >   *
> >   * This fills out all the uninitialized function pointers with the defaults.
> >   * The flash ID is read and the mtd/chip structures are filled with the
> > - * appropriate values. The mtd->owner field must be set to the module of the
> > - * caller.
> > + * appropriate values.
> >   */
> >  int nand_scan(struct mtd_info *mtd, int maxchips)
> >  {
> >  	int ret;
> >  
> > -	/* Many callers got this wrong, so check for it for a while... */
> > -	if (!mtd->owner && caller_is_module()) {
> > -		pr_crit("%s called with NULL mtd->owner!\n", __func__);
> > -		BUG();
> > -	}
> 
> Ooh, yikes! Forgot this was there. I guess no one noticed, because fewer
> drivers are using plain nand_scan() these days (instead of splitting up
> nand_scan_ident() and nand_scan_tail()), and also, many NAND users don't
> run their drivers as modules.
> 
> Anyway, this is probably worth -stable, right? (i.e., "Fixes:
> 807f16d4db95 ..." and "Cc: <stable@vger.kernel.org>")
> 
> I can take this directly, or Boris, if you feel like there will be other
> for-v4.5 NAND material, you can queue this up instead.

No, take it directly.

On a more general note, not sure creating a nand/fixes branch and
sending you PRs after each -rc (if fixes are available of course) is
really efficient. Maybe I'm wrong, but I don't expect to see more than a
couple of fixes per release, and it's probably better if you keep
taking them directly (with my acks).

What do you think?


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-04-02 13:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 21:29 [PATCH 0/2] nand: Remove BUG abuse Ezequiel Garcia
2016-04-01 21:29 ` [PATCH 1/2] mtd: nand: Drop mtd.owner requirement in nand_scan Ezequiel Garcia
2016-04-01 21:57   ` Richard Weinberger
2016-04-01 22:06     ` Ezequiel Garcia
2016-04-01 22:26   ` Brian Norris
2016-04-02 13:52     ` Boris Brezillon [this message]
2016-04-03  6:14       ` Brian Norris
2016-04-01 21:29 ` [PATCH 2/2] mtd: nand: Remove BUG() abuse in nand_scan_tail Ezequiel Garcia
2016-04-01 21:51   ` Richard Weinberger
2016-04-02 13:55   ` Boris Brezillon
2016-04-04 15:20     ` Boris Brezillon
2016-04-04 15:26       ` Ezequiel Garcia
2016-04-04 15:30       ` Richard Weinberger
2016-04-04 15:34         ` Ezequiel Garcia
2016-04-04 18:30           ` Boris Brezillon
2016-04-04 16:43       ` Brian Norris
2016-04-05 16:58   ` Boris Brezillon
2016-04-02 13:55 ` [PATCH 0/2] nand: Remove BUG abuse Boris Brezillon
2016-04-02 15:37   ` Ezequiel Garcia
2016-04-04 15:33     ` Boris Brezillon
2016-04-04 15:39       ` Ezequiel Garcia

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=20160402155216.48866776@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /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.