linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Chuanxiao.Dong" <chuanxiao.dong@intel.com>
To: linux-mtd@lists.infradead.org, dwmw2@infradead.org
Subject: [PATCH v2 3/6]nand/denali: Fixed driver r/w bug
Date: Thu, 12 Aug 2010 18:51:30 +0800	[thread overview]
Message-ID: <20100812105130.GC11634@intel.com> (raw)

From 2e36a92751c8002164396c003dd1472392af1b26 Mon Sep 17 00:00:00 2001
From: Chuanxiao Dong <chuanxiao.dong@intel.com>
Date: Thu, 12 Aug 2010 18:01:28 +0800
Subject: [PATCH 3/6] nand/denali: Fixed driver r/w bug

This issue is happened when using large NAND and some ONFI nand:
1) Large NAND need 32bits number to represent page id
2) Some Micro ONFI nand has a special OOB size

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
 drivers/mtd/nand/denali.c |    6 +++++-
 drivers/mtd/nand/denali.h |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index a7d71e8..920c1cf 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -2021,7 +2021,11 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	 * MTD known nothing about multi nand,
 	 * so we should tell it the real pagesize
 	 * and anything necessery
-	 */
+	 * Some NAND chip has a spectial OOB size, so here do
+	 * a recheck
+	 * */
+	denali->mtd.oobsize = ioread32(denali->flash_reg +
+						DEVICE_SPARE_AREA_SIZE);
 	denali->devnum = ioread32(denali->flash_reg + DEVICES_CONNECTED);
 	denali->nand.chipsize <<= (denali->devnum - 1);
 	denali->nand.page_shift += (denali->devnum - 1);
diff --git a/drivers/mtd/nand/denali.h b/drivers/mtd/nand/denali.h
index 05f7415..9c244f7 100644
--- a/drivers/mtd/nand/denali.h
+++ b/drivers/mtd/nand/denali.h
@@ -744,7 +744,7 @@ struct denali_nand_info {
 	struct pci_dev *dev;
 	int total_used_banks;
 	uint32_t block;  /* stored for future use */
-	uint16_t page;
+	uint32_t page;
 	void __iomem *flash_reg;  /* Mapped io reg base address */
 	void __iomem *flash_mem;  /* Mapped io reg base address */
 
-- 
1.6.6.1

                 reply	other threads:[~2010-08-12 10:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100812105130.GC11634@intel.com \
    --to=chuanxiao.dong@intel.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;
as well as URLs for NNTP newsgroup(s).