Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7277292imu; Tue, 22 Jan 2019 03:24:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7BAu2lt/lt23WvJ4MgiGW89KCUIrtKdqTVrN79JQy/YctFGX554j6EyACkb37u0WL7uSlp X-Received: by 2002:a17:902:4222:: with SMTP id g31mr33650915pld.240.1548156297708; Tue, 22 Jan 2019 03:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548156297; cv=none; d=google.com; s=arc-20160816; b=ROkE4WiGHVvnSifXN6VXRxkY9AWlZMiUMFtuWWTVDpnuXo0SxvSXwMWd2sTl+StTe/ HXqtYmoV9XxCsuEseeTpDwzYfARSbgTnSuoAX6kXAIkbzuUROQz37CDposzJqMFuyOsk SZgjYtv6u7ms7jnghw9ltO98WtqOhsTQt3RWvJfhkPwsPWpXsgj+D/GtVl1fe4sv4RIN bccjLu54PE7gE1/xGwRsU72hWtdm2yhj4chApLS5+NaKQcPwwylTCZxgz4a3XPoIhaZf JOFguK/fCZuaMLmHPdNF2Mb/Z8br9/iloMKqc2xZZfCuMyTz+qtMODdKi/ae9Cjul8IY MgXg== 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=FRQsw+iVNpZPcnWfQJK7MlQ5+IpPc+VUkLaMRZa0wss=; b=nxL+2vsfMCezKdbx6lRVI5nMCOEx6lmp0+V/IHsCgF2quEkYW3BYL+touexSM1IJpR nko7eQNX9kMD5hVU2DJltHQRX6mUBkbVPedf7C8rRmXzVSCjEEWjOWnDLxQDgI4RgGFJ o7eBNnzWWZHDPCyxPFbDqx3814pB1X92Yd7dPP/92ka8CTCCB0H0kGcUsUWDRPwpb1G/ QaBA1S65i7FXbtGVHVJEsBb89Rn68UjxzF5fBA63qLtx5+Yj8389VnIVrQchJ9xsDTKI ircLwJd7Fg6TwsWaBN/4MEu0GtI80PU95CHDigHywvnq5Y0fAZEZAO+aH21QqJj+yZZ6 wc1A== 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 h19si14743365plr.67.2019.01.22.03.24.42; Tue, 22 Jan 2019 03:24:57 -0800 (PST) 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 S1728135AbfAVLXg convert rfc822-to-8bit (ORCPT + 99 others); Tue, 22 Jan 2019 06:23:36 -0500 Received: from skedge03.snt-world.com ([91.208.41.68]:53502 "EHLO skedge03.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728018AbfAVLXf (ORCPT ); Tue, 22 Jan 2019 06:23:35 -0500 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 skedge03.snt-world.com (Postfix) with ESMTPS id B87BF67BC80; Tue, 22 Jan 2019 12:23:32 +0100 (CET) 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.1466.3; Tue, 22 Jan 2019 12:23:32 +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; Tue, 22 Jan 2019 12:23:32 +0100 From: Schrempf Frieder To: "boris.brezillon@bootlin.com" , "miquel.raynal@bootlin.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" CC: "linux-mtd@lists.infradead.org" , "Schrempf Frieder" , Boris Brezillon , David Woodhouse , Brian Norris , Marek Vasut Subject: [PATCH v2 3/4] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Topic: [PATCH v2 3/4] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Index: AQHUskToRFdifTqxu0S57aTRv0y72w== Date: Tue, 22 Jan 2019 11:23:32 +0000 Message-ID: <20190122112258.20042-4-frieder.schrempf@kontron.de> References: <20190122112258.20042-1-frieder.schrempf@kontron.de> In-Reply-To: <20190122112258.20042-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.43] 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: B87BF67BC80.AEB9A X-SnT-MailScanner: Found to be clean X-SnT-MailScanner-SpamCheck: X-SnT-MailScanner-From: frieder.schrempf@kontron.de X-SnT-MailScanner-To: bbrezillon@kernel.org, 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 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 --- 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 99a8092969a7..b37e0b5af5ae 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