From patchwork Tue Aug 17 21:42:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 61973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 12497B70A8 for ; Wed, 18 Aug 2010 07:44:04 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OlTvo-0002Pk-1V; Tue, 17 Aug 2010 21:42:52 +0000 Received: from mms3.broadcom.com ([216.31.210.19]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OlTvk-0002FE-NU for linux-mtd@lists.infradead.org; Tue, 17 Aug 2010 21:42:49 +0000 Received: from [10.9.200.133] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Tue, 17 Aug 2010 14:42:36 -0700 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: from mail-irva-12.broadcom.com (10.11.16.101) by IRVEXCHHUB02.corp.ad.broadcom.com (10.9.200.133) with Microsoft SMTP Server id 8.2.247.2; Tue, 17 Aug 2010 14:43:54 -0700 Received: from [10.12.160.50] (ld-irv-0074.broadcom.com [10.12.160.50]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id EAD3D69CA8; Tue, 17 Aug 2010 14:42:35 -0700 (PDT) Message-ID: <4C6B024A.7040505@broadcom.com> Date: Tue, 17 Aug 2010 14:42:34 -0700 From: "Brian Norris" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6 MIME-Version: 1.0 To: "Michael Guntsche" Subject: Re: [BUG] Nand support broken with v2.6.36-rc1 References: <20100817113644.GA31317@gibson.comsick.at> <4C6AC037.7070205@broadcom.com> <20100817174704.GA1322@gibson.comsick.at> <4C6AD9C2.1070705@broadcom.com> <20100817200559.GA4542@gibson.comsick.at> In-Reply-To: <20100817200559.GA4542@gibson.comsick.at> X-WSS-ID: 6075DDC63KC80625448-01-01 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100817_174248_970883_67BC03CE X-CRM114-Status: GOOD ( 30.99 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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;