From patchwork Sun Jun 10 10:58:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shmulik Ladkani X-Patchwork-Id: 163982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 600D0B6F62 for ; Sun, 10 Jun 2012 21:00:36 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sdfql-0002He-6Q; Sun, 10 Jun 2012 10:58:27 +0000 Received: from mail-lpp01m010-f49.google.com ([209.85.215.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sdfqe-0002HQ-Fd for linux-mtd@lists.infradead.org; Sun, 10 Jun 2012 10:58:21 +0000 Received: by laap9 with SMTP id p9so2439638laa.36 for ; Sun, 10 Jun 2012 03:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-transfer-encoding; bh=5gD7J/i0oZTr/qPSQJsKqd+/PmwvUdq5+IXfFaQRZc4=; b=mJHLay6NbgJXbd9m3Lg2ka4SxMS88lA/YzoDd0/ag6ApyhUQFKW3PZt26gZdA+CiqM O9qJ8nkqUD3UJTxHsCDJQ02wnVZC2poqVdca8bkYAsvgSjaPDzgVadz8q72LwjMDZ6o2 0/XtDpcLLh6DLOWDVj/Ri0QbpOgeG7KY1ibbAFVS982S18OCUvcz0U0aoNn9aCm3rJlK 9yJP7J+YI/FsoZTbSpUW5eY2VHjN+pN6vhd17/v1FD6LuPJ/eXpMBDDvW0+/mPPhLJco hdNJ7wLi/t6ra9rwdEE7i3fYtJCbwQ7Z2gUpDdg0jPqsEMknVWJAZiOTGI7eAriG5TrH 4zmQ== Received: by 10.152.102.234 with SMTP id fr10mr14215617lab.32.1339325897705; Sun, 10 Jun 2012 03:58:17 -0700 (PDT) Received: from pixies.home.jungo.com (212-150-239-254.bb.netvision.net.il. [212.150.239.254]) by mx.google.com with ESMTPS id sy1sm19024896lab.13.2012.06.10.03.58.15 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 10 Jun 2012 03:58:16 -0700 (PDT) Date: Sun, 10 Jun 2012 13:58:12 +0300 From: Shmulik Ladkani To: linux-mtd@lists.infradead.org Subject: [PATCH] mtd: nand: Use the mirror BBT descriptor when reading its version Message-ID: <20120610135812.01dce4e7@pixies.home.jungo.com> Mime-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shmulik.ladkani[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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 Cc: Sebastian Andrzej Siewior , David Woodhouse , dedekind1@gmail.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 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 The code responsible for reading the version of the mirror bbt was incorrectly using the descriptor of the main bbt. Pass the mirror bbt descriptor to 'scan_read_raw' when reading the version of the mirror bbt. Signed-off-by: Shmulik Ladkani Acked-by: Sebastian Andrzej Siewior --- - Spotted while reviewing BBT code. - Introduced by 7cba7b1 [mtd: nand: add support for BBT without OOB]. - Looks like a typo. - Not runtime tested. - Sebastian, care to take a look and Ack? diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 30d1319..c126469 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -390,7 +390,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf, /* Read the mirror version, if available */ if (md && (md->options & NAND_BBT_VERSION)) { scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift, - mtd->writesize, td); + mtd->writesize, md); md->version[0] = buf[bbt_get_ver_offs(mtd, md)]; pr_info("Bad block table at page %d, version 0x%02X\n", md->pages[0], md->version[0]);