linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Brian Norris" <norris@broadcom.com>
To: "Michael Guntsche" <mike@it-loops.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] Nand support broken with v2.6.36-rc1
Date: Tue, 17 Aug 2010 14:42:34 -0700	[thread overview]
Message-ID: <4C6B024A.7040505@broadcom.com> (raw)
In-Reply-To: <20100817200559.GA4542@gibson.comsick.at>

On 08/17/2010 01:05 PM, Michael Guntsche wrote:
> On 17 Aug 10 11:49, Brian Norris wrote:
>> First, have you ever used any of the mtdutils? In particular,
>> running the command "mtdinfo -a" and sending the output is helpful
>> if you have the utility installed on your board.
> hmm mtdinfo tries to open /sys/class/mtd/mtd0/dev which das not exist
> the device is working ok as block device on the other hand so let's try
> the next thing.

I'm not an expert on the workings of mtdutils, so I don't know
why your device does not have the necessary sysfs entries. Perhaps
weird hardware features or a strange, incorrect driver (I can't work
on your board specific driver for you). I suppose it's OK to ignore
this problem for the moment.

> Output booting with a patched .36-rc1
> 
> [    0.279217] rbppc_nand_probe: MikroTik RouterBOARD 600 series NAND driver, version 0.0.2
> [    0.287535] ID byte 0: 0xad
> [    0.290373] ID byte 1: 0x76
> [    0.293185] ID byte 2: 0xad
> [    0.295985] ID byte 3: 0x76
> [    0.298798] ID byte 4: 0xad
> [    0.301610] ID byte 5: 0x76
> [    0.304423] ID byte 6: 0xad
> [    0.307223] ID byte 7: 0x76
> [    0.310046] NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
> 
> Hope this helps...
> 

Honestly, that doesn't really help :) I guess the device is old
enough it does not have an extended ID. In that case, I will need
the part number to be able to diagnose for sure. Can you find the
physical chip on the board and give me whatever labeling is on it?

In place of that, though, you can just try this patch on 2.6.36-rc1.
I believe it should satisfy the intention of my previous (faulty)
commit while reverting the regression behavior. If this works OK, I
will submit it to be included in the mainline kernel.

Thanks for taking the time to debug this.

Brian

---
 drivers/mtd/nand/nand_base.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index a3c7473..a22ed7b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2934,14 +2934,10 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 		chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32)) + 32 - 1;
 
 	/* Set the bad block position */
-	if (!(busw & NAND_BUSWIDTH_16) && (*maf_id == NAND_MFR_STMICRO ||
-				(*maf_id == NAND_MFR_SAMSUNG &&
-				 mtd->writesize == 512) ||
-				*maf_id == NAND_MFR_AMD))
-		chip->badblockpos = NAND_SMALL_BADBLOCK_POS;
-	else
+	if (mtd->writesize > 512 || (busw & NAND_BUSWIDTH_16))
 		chip->badblockpos = NAND_LARGE_BADBLOCK_POS;
-
+	else
+		chip->badblockpos = NAND_SMALL_BADBLOCK_POS;
 
 	/* Get chip options, preserve non chip based options */
 	chip->options &= ~NAND_CHIPOPTIONS_MSK;
-- 
1.7.0.4

  reply	other threads:[~2010-08-17 21:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17 11:36 [BUG] Nand support broken with v2.6.36-rc1 Michael Guntsche
2010-08-17 17:00 ` Brian Norris
2010-08-17 17:47   ` Michael Guntsche
2010-08-17 18:49     ` Brian Norris
2010-08-17 20:06       ` Michael Guntsche
2010-08-17 21:42         ` Brian Norris [this message]
2010-08-18  5:53           ` Michael Guntsche
2010-08-17 20:59   ` Abdoulaye Walsimou GAYE
2010-08-17 22:07     ` Brian Norris
2010-08-18 18:25   ` [PATCH] mtd: nand: Fix regression in BBM detection Brian Norris
2010-08-18 19:30     ` Abdoulaye Walsimou GAYE
2010-08-19  0:04       ` Brian Norris
  -- strict thread matches above, loose matches on Subject: below --
2010-08-17  8:52 [BUG] Nand support broken with v2.6.36-rc1 Michael Guntsche

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=4C6B024A.7040505@broadcom.com \
    --to=norris@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mike@it-loops.com \
    /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).