From patchwork Mon Dec 17 15:49:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frieder Schrempf X-Patchwork-Id: 1014600 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kontron.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nc5Z5zZ4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43JQvv1LF3z9sBh for ; Tue, 18 Dec 2018 03:04:43 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IY3yh42MnwKRXKuJAMYTGkiagRlg4nKndpAQSRJGrcs=; b=nc5Z5zZ4hlShXL APQg0IGUgfVo7ThBcXSNllDngC9thEpA65kwSUOHhy7axiMb1QSll0BQ32lXVf9xO1fHRLsAdsbSh Mle0bfIliQHTZm8Xwab57u4+kuxXKjzP7NYkjwhQN3WSkC+FO5tv0S1JQno32AUZoVxNOXHfZ/49X u0QzJ2pFY9vFyMeGcdHYCmGYSd3ZBPzZ6O9FQmpkDPWsTVk0B9Zm5+rAbCLB7uhEPXhfVF5X5gLwk pUSpPNNbbNQll6jWPxuQiTuhDsqodYy+L1i3rZ8IhUbF6WxOQ57l2I488GSlAlSagYXhcKL74b3C7 FQZamT8jwtscp9AV/vpg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYvNc-000361-TL; Mon, 17 Dec 2018 16:04:28 +0000 Received: from skedge03.snt-world.com ([91.208.41.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYv92-0003h4-2M for linux-mtd@lists.infradead.org; Mon, 17 Dec 2018 15:49:25 +0000 Received: from sntmail14r.snt-is.com (unknown [10.203.32.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by skedge03.snt-world.com (Postfix) with ESMTPS id EE45467A898; Mon, 17 Dec 2018 16:49:11 +0100 (CET) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail14r.snt-is.com (10.203.32.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1466.3; Mon, 17 Dec 2018 16:49:11 +0100 Received: from sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305]) by sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305%5]) with mapi id 15.01.1466.003; Mon, 17 Dec 2018 16:49:11 +0100 From: Schrempf Frieder To: "boris.brezillon@bootlin.com" , "miquel.raynal@bootlin.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" Subject: [PATCH 2/3] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Topic: [PATCH 2/3] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Index: AQHUliANLCGy+3v2/02EovWY7zBuNQ== Date: Mon, 17 Dec 2018 15:49:11 +0000 Message-ID: <1545061693-29216-3-git-send-email-frieder.schrempf@kontron.de> References: <1545061693-29216-1-git-send-email-frieder.schrempf@kontron.de> In-Reply-To: <1545061693-29216-1-git-send-email-frieder.schrempf@kontron.de> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.25.9.42] x-c2processedorg: 51b406b7-48a2-4d03-b652-521f56ac89f3 MIME-Version: 1.0 X-SnT-MailScanner-Information: Please contact the ISP for more information X-SnT-MailScanner-ID: EE45467A898.AD7ED X-SnT-MailScanner: Found to be clean X-SnT-MailScanner-SpamCheck: X-SnT-MailScanner-From: frieder.schrempf@kontron.de X-SnT-MailScanner-To: boris.brezillon@bootlin.com, computersforpeace@gmail.com, dwmw2@infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, marek.vasut@gmail.com, miquel.raynal@bootlin.com, richard@nod.at X-Spam-Status: No X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181217_074924_377011_657951D2 X-CRM114-Status: GOOD ( 10.57 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [91.208.41.68 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Woodhouse , Brian Norris , "linux-mtd@lists.infradead.org" , Schrempf Frieder , Marek Vasut Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Frieder Schrempf It is known that some ESMT SLC NANDs have been shipped with the factory bad block markers in the first or last page of the block, instead of the first or second page. To be on the safe side, let's check all three locations. Signed-off-by: Frieder Schrempf --- drivers/mtd/nand/raw/nand_esmt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/nand_esmt.c b/drivers/mtd/nand/raw/nand_esmt.c index 96f039a..275bc8e 100644 --- a/drivers/mtd/nand/raw/nand_esmt.c +++ b/drivers/mtd/nand/raw/nand_esmt.c @@ -36,7 +36,14 @@ static void esmt_nand_decode_id(struct nand_chip *chip) static int esmt_nand_init(struct nand_chip *chip) { if (nand_is_slc(chip)) - chip->bbt_options |= NAND_BBT_SCAN2NDPAGE; + /* + * It is known that some ESMT SLC NANDs have been shipped + * with the factory bad block markers in the first or last page + * of the block, instead of the first or second page. To be on + * the safe side, let's check all three locations. + */ + chip->bbt_options |= NAND_BBT_SCAN2NDPAGE | + NAND_BBT_SCANLASTPAGE; return 0; }