Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4126789yba; Wed, 17 Apr 2019 05:17:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzA7s7lsp62CglOP2UzfSCMqC/ZSIaRaPDp0R6sZwGPIx1lIXaK7rgbkgh7IWGUIolK22WY X-Received: by 2002:a63:1c6:: with SMTP id 189mr83798788pgb.22.1555503452949; Wed, 17 Apr 2019 05:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555503452; cv=none; d=google.com; s=arc-20160816; b=JZRoRPD4HZMkhYVRLBf6fAHVdxsqZvKMs9Yao10t9Mqe6G8tJ1dTnbkJoZtvG+RxPb CleWtCTZdswa7S7L5dY0jGR+Lgi2wFs6qGO2MYS/TrvrMjzyS0G0YeXnRMcS6fA1Jeez QTLUEjXwz209LLvHeh8P/kX8FZXkOXB3JAx5ycSPEK/Yvrd3Nd7pasAoEoq043Iat1O0 wdlCLhXgA7v4jWfkt+EOOX9mFkXe6Yjy74HwzDNa8t0y2ZBUhcwE1xVqx1tOsIYPrUI+ af7KtKsoDvZF7SYhz+IDVCue7pgUNTmqu9EmbsfEz1rYhqlv1zg+k9+IKb7eL3MLfYiT YblA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=DXjbpar4IDTB5xW7tHWErQLE/SOKBafZe5ihpozJWro=; b=DqvZisM0gu17QR+vftyuj9gaJ33MjrALIv514hY8ef+Y5eTVaWrL0C5YsXBMYMWt54 YIOMTvQGp8dUw3ABIbbfii+PbXKs6/V2XpVpvczsBadHjigoJv1Sj8z1q47tTbabzZ7G 1e9kp42izb1ADxlLYkgMHygKmG2R/jCGWxzdqXr+487ivuZ47c1NbxGH1pD8ZIFz3sx/ kj20IdvH7+iBxTb0KsBClY56sHKsNGx8SP7zyOIXWKeVwemwciVK5Xbm4lJ2c0kToQxq 3Q3yBkyeidYSJdSfcS24gX3BbRccwlWaDUhD7DnKR3fnnr0mizOlWE1GXQ2xmrU+O5/p Ytyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si24664823plb.176.2019.04.17.05.17.17; Wed, 17 Apr 2019 05:17:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732173AbfDQMPq convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Apr 2019 08:15:46 -0400 Received: from skedge04.snt-world.com ([91.208.41.69]:49294 "EHLO skedge04.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732097AbfDQMP0 (ORCPT ); Wed, 17 Apr 2019 08:15:26 -0400 Received: from sntmail10s.snt-is.com (unknown [10.203.32.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by skedge04.snt-world.com (Postfix) with ESMTPS id 9596F67A876; Wed, 17 Apr 2019 14:15:22 +0200 (CEST) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail10s.snt-is.com (10.203.32.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 17 Apr 2019 14:15:22 +0200 Received: from sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305]) by sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305%3]) with mapi id 15.01.1713.004; Wed, 17 Apr 2019 14:15:22 +0200 From: Schrempf Frieder To: "bbrezillon@kernel.org" , "miquel.raynal@bootlin.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" CC: "linux-mtd@lists.infradead.org" , "Schrempf Frieder" , David Woodhouse , Brian Norris , Marek Vasut Subject: [PATCH v5 6/7] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Topic: [PATCH v5 6/7] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Index: AQHU9Rc6mI0Ov5N+n0m6z29YVGfB0Q== Date: Wed, 17 Apr 2019 12:15:22 +0000 Message-ID: <20190417121420.21752-7-frieder.schrempf@kontron.de> References: <20190417121420.21752-1-frieder.schrempf@kontron.de> In-Reply-To: <20190417121420.21752-1-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.193] x-c2processedorg: 51b406b7-48a2-4d03-b652-521f56ac89f3 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-SnT-MailScanner-Information: Please contact the ISP for more information X-SnT-MailScanner-ID: 9596F67A876.AB806 X-SnT-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-SnT-MailScanner-SpamCheck: X-SnT-MailScanner-From: frieder.schrempf@kontron.de X-SnT-MailScanner-To: bbrezillon@kernel.org, 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Reviewed-by: Boris Brezillon Reviewed-by: Miquel Raynal --- 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 58646ed663ac..3338c68aaaf1 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->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE; + /* + * 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->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE | + NAND_BBM_LASTPAGE; return 0; } -- 2.17.1