From: "Brian Norris" <computersforpeace@gmail.com>
To: "Artem Bityutskiy" <dedekind1@gmail.com>
Cc: dsd@laptop.org, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
linux-mtd@lists.infradead.org, Jamie Iles <jamie@jamieiles.com>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH] mtd: cafe_nand: register master MTD at most once
Date: Tue, 2 Aug 2011 16:38:30 -0700 [thread overview]
Message-ID: <1312328310-18003-1-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <CAN8TOE9mWEmS5YJqNrS9OrG=t+emeLcXNpKR1BiZ6VDJW7_c=A@mail.gmail.com>
This patch addresses a regression where a master MTD object might be
registered twice if no partitions are found. The initial bug report can
be seen here:
http://lists.infradead.org/pipermail/linux-mtd/2011-July/037086.html
The regression is caused by:
commit 0f7451bea72c64d3f0a47850328d52f0315e2ea6
"mtd: cafe_nand.c: use mtd_device_parse_register"
The aforementioned commit was intended to basically just refactor the
codebase; however, it had unintentional side effects. The cafe_nand probe
behavior over time is as follows.
Previous functionality (before commit 0f7451be):
A) register the master device with add_mtd_device()
B) if partitions are found, register them as well
New functionality (at commit 0f7451be):
A) register the master device with add_mtd_device()
B) if partitions are found, register them as well
C) if partitions are not found, register the master device (again)
Correct functionality (this patch):
(remove step A)
B) if partitions are found, register them
C) if partitions are not found, register the master device
Thus, this fix means that we will never register both the master MTD and
its partitions, as we did before commit 0f7451be. This is probably the
expected behavior and should be a welcome change.
Reported-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
drivers/mtd/nand/cafe_nand.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 661e5dc..11a56df 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -797,9 +797,6 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, mtd);
- /* We register the whole device first, separate from the partitions */
- mtd_device_register(mtd, NULL, 0);
-
mtd->name = "cafe_nand";
mtd_device_parse_register(mtd, part_probes, 0, NULL, 0);
--
1.7.0.4
next prev parent reply other threads:[~2011-08-02 23:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 17:37 MTD-related kobject badness during linux-next boot Daniel Drake
2011-08-02 17:40 ` Brian Norris
2011-08-02 17:58 ` Daniel Drake
2011-08-02 18:05 ` Brian Norris
2011-08-02 22:53 ` Jamie Iles
2011-08-02 23:38 ` Brian Norris [this message]
2011-08-15 15:31 ` [PATCH] mtd: cafe_nand: register master MTD at most once Artem Bityutskiy
2011-08-15 17:41 ` Brian Norris
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=1312328310-18003-1-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=dbaryshkov@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dsd@laptop.org \
--cc=dwmw2@infradead.org \
--cc=jamie@jamieiles.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox