public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] Bug fix in kernel nand driver code for ONFI flash with unconfigured buswidth
@ 2015-06-25 23:46 Willem Atsma
  2015-06-29 18:29 ` pekon
  0 siblings, 1 reply; 4+ messages in thread
From: Willem Atsma @ 2015-06-25 23:46 UTC (permalink / raw)
  To: linux-mtd; +Cc: Willem Atsma, dwmw2

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-30 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 23:46 [PATCH] Bug fix in kernel nand driver code for ONFI flash with unconfigured buswidth Willem Atsma
2015-06-29 18:29 ` pekon
2015-06-29 18:56   ` Willem Atsma
2015-06-30 19:10     ` pekon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox