From: Willem Atsma <willem.atsma@tanglebridge.com>
To: linux-mtd@lists.infradead.org
Cc: Willem Atsma <willem.atsma@tanglebridge.com>, dwmw2@infradead.org
Subject: [PATCH] Bug fix in kernel nand driver code for ONFI flash with unconfigured buswidth
Date: Thu, 25 Jun 2015 16:46:46 -0700 [thread overview]
Message-ID: <1435276006-804-1-git-send-email-willem.atsma@tanglebridge.com> (raw)
Previously, when ONFI configuration succeeds the driver configuration might
still fail in the calling function nand_get_flash_type() if the
chip->options was not configured for the detected busw (8 or 16bit). With
ONFI present the hardware driver does not need to be configured. However
downstream the driver uses the chip->options field, so this patch updates
the bits when ONFI detection succeeds.
This fixes nand driver configuration on the overo-earth platform with
micron nand flash.
Signed-off-by: Willem Atsma <willem.atsma@tanglebridge.com>
---
drivers/mtd/nand/nand_base.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ceb68ca..7b20471 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3218,6 +3218,11 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
else
*busw = 0;
+ /* Set the chip option here since ONFI succeeded and non-ONFI config may
+ * be incomplete:
+ */
+ chip->options |= *busw;
+
if (p->ecc_bits != 0xff) {
chip->ecc_strength_ds = p->ecc_bits;
chip->ecc_step_ds = 512;
--
1.9.1
next reply other threads:[~2015-06-25 23:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 23:46 Willem Atsma [this message]
2015-06-29 18:29 ` [PATCH] Bug fix in kernel nand driver code for ONFI flash with unconfigured buswidth pekon
2015-06-29 18:56 ` Willem Atsma
2015-06-30 19:10 ` pekon
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=1435276006-804-1-git-send-email-willem.atsma@tanglebridge.com \
--to=willem.atsma@tanglebridge.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox