From: Brian Norris <computersforpeace@gmail.com>
To: Richard Weinberger <richard@nod.at>
Cc: linux-mtd@lists.infradead.org,
boris.brezillon@free-electrons.com, dwmw2@infradead.org
Subject: Re: [PATCH 4/5] mtd: Don't unconditionally execute remove notifiers
Date: Wed, 28 Sep 2016 13:31:33 -0700 [thread overview]
Message-ID: <20160928203133.GD142302@google.com> (raw)
In-Reply-To: <1467669983-12105-5-git-send-email-richard@nod.at>
On Tue, Jul 05, 2016 at 12:06:22AM +0200, Richard Weinberger wrote:
> Only call them when we're really removing the MTD.
>
> Signed-off-by: Richard Weinberger <richard@nod.at>
> ---
> drivers/mtd/mtdcore.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 36e5fb0..f49e103 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -499,16 +499,16 @@ int del_mtd_device(struct mtd_info *mtd)
> goto out_error;
> }
>
> - /* No need to get a refcount on the module containing
> - the notifier, since we hold the mtd_table_mutex */
> - list_for_each_entry(not, &mtd_notifiers, list)
> - not->remove(mtd);
> -
> if (mtd->usecount) {
> printk(KERN_NOTICE "Removing MTD device #%d (%s) with use count %d\n",
> mtd->index, mtd->name, mtd->usecount);
> ret = -EBUSY;
> } else {
> + /* No need to get a refcount on the module containing
> + the notifier, since we hold the mtd_table_mutex */
> + list_for_each_entry(not, &mtd_notifiers, list)
> + not->remove(mtd);
> +
The ordering looks like it was somewhat intentional here:
75c0b84d41c6 mtd: call the remove notifiers before assuming it is in use
Have we fixed or refactored the issues that seem to have prompted that?
Brian
> device_unregister(&mtd->dev);
>
> idr_remove(&mtd_idr, mtd->index);
> --
> 2.7.3
>
next prev parent reply other threads:[~2016-09-28 20:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 22:06 MTD life cycle fixes Richard Weinberger
2016-07-04 22:06 ` [PATCH 1/5] mtdpart: Propagate _get/put_device() Richard Weinberger
2016-07-04 22:06 ` [PATCH 2/5] mtd: nand: Propagate mtd_device_unregister() return value in tear down Richard Weinberger
2016-07-06 13:34 ` Boris Brezillon
2016-07-07 18:29 ` Richard Weinberger
2016-07-07 18:58 ` Boris Brezillon
2016-07-04 22:06 ` [PATCH 3/5] mtd: Don't unconditionally unregister reboot notifier Richard Weinberger
2016-09-28 20:30 ` Brian Norris
2016-07-04 22:06 ` [PATCH 4/5] mtd: Don't unconditionally execute remove notifiers Richard Weinberger
2016-07-07 14:59 ` Boris Brezillon
2016-09-28 20:31 ` Brian Norris [this message]
2016-07-04 22:06 ` [PATCH 5/5] mtd: Don't print a scary message when trying to remove a busy MTD Richard Weinberger
2016-07-07 14:58 ` Boris Brezillon
2016-07-07 18:48 ` Richard Weinberger
2016-07-07 18:53 ` Boris Brezillon
2016-07-07 18:56 ` Richard Weinberger
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=20160928203133.GD142302@google.com \
--to=computersforpeace@gmail.com \
--cc=boris.brezillon@free-electrons.com \
--cc=dwmw2@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).