From patchwork Thu May 12 07:05:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nitin Garg X-Patchwork-Id: 95263 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 91376B6F73 for ; Thu, 12 May 2011 17:06:52 +1000 (EST) Received: from canuck.infradead.org ([134.117.69.58]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QKPxv-0006rz-Jl; Thu, 12 May 2011 07:05:43 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1QKPxu-00081t-Nc; Thu, 12 May 2011 07:05:42 +0000 Received: from mail-gy0-f177.google.com ([209.85.160.177]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QKPxs-00081b-1I for linux-mtd@lists.infradead.org; Thu, 12 May 2011 07:05:40 +0000 Received: by gyh20 with SMTP id 20so505470gyh.36 for ; Thu, 12 May 2011 00:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=rcmOCVGIr2mhAWz1ulzpbWel/bE2/y1UvXoS2P7NQUk=; b=gyGzGbIeV1msiMi4H/UGVyQzJFJjibDav3mnLMnV/xntM+NRmumQBY+5ThDGw9hsUP Ngnt7+kHlJb42+K8Z+9vf/rTlk+djETDPoJMO72UciEI7Kg6H73CtJiJzZ2rkjWzug3Q BxSyUEzjmeRMgKfGUWAuZE+R/25ZJ4EKgfWlA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oftGfCPt/pKJLUbSEFfkO4IhMtW5lrcWppZpckx0ngSF63CAMt2/VV7jeCO7WLubid CF3OX8OLkVm2fZVHi4s+SutCpku80weH/XHhDAfpwmdDM+L/cYTmUcdeJ/ujrZJouTkh 387AFfwUtaK8Ki73qxTRreBYKH/3/bPn83vMY= MIME-Version: 1.0 Received: by 10.101.83.5 with SMTP id k5mr6509395anl.132.1305183937500; Thu, 12 May 2011 00:05:37 -0700 (PDT) Received: by 10.101.68.4 with HTTP; Thu, 12 May 2011 00:05:37 -0700 (PDT) In-Reply-To: References: <20110511183322.da0739c9.akpm@linux-foundation.org> Date: Thu, 12 May 2011 02:05:37 -0500 Message-ID: Subject: Re: Bug in MTD NAND ONFI chipsize detection From: Nitin Garg To: Andrew Morton X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110512_030540_193924_6F5FBE3F X-CRM114-Status: GOOD ( 12.47 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is freemail (nitingarg98[at]gmail.com) 2.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (nitingarg98[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.177 listed in list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain Cc: linux-mtd@lists.infradead.org, David Woodhouse , 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 Here is the tested patch, pls apply. From 1a73f1c3d066a491d0c806883788ab9abdc736f3 Mon Sep 17 00:00:00 2001 From: Nitin Garg Date: Thu, 12 May 2011 01:31:53 -0500 Subject: [PATCH] Fix ONFI NAND flash size detection by using number of Logical Units in device Signed-off-by: Nitin Garg ---  drivers/mtd/nand/nand_base.c |    2 +-  1 files changed, 1 insertions(+), 1 deletions(-)        busw = 0;        if (le16_to_cpu(p->features) & 1)                busw = NAND_BUSWIDTH_16; -- 1.5.5.6 diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index c54a4cb..cdf6015 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2892,7 +2892,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,        mtd->writesize = le32_to_cpu(p->byte_per_page);        mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;        mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page); -       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize; +       chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * le32_to_cpu(p->lun_count) * mtd->erasesize;