Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2789174imu; Mon, 17 Dec 2018 07:52:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wv3YuP49k5Yx5reOPuqrSIhlRK96/uWYNKtcYrOQqLBPDjL6g7qz68BVO+/bklvzeG7v5F X-Received: by 2002:a63:2406:: with SMTP id k6mr12164313pgk.229.1545061958124; Mon, 17 Dec 2018 07:52:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545061958; cv=none; d=google.com; s=arc-20160816; b=WAsHeqPlZqoJl+drrnHF2M86WmkNGjAQk9hixZ2I+2HCzdlFKFJPbNmob80wD53F7W 1fHfiKkbkXseobMh8lBNZO7MeG0YE+r7lVYoJI5K7p7gooz8yFLBxHYmC6lnjGuhIPdm s2bIVsJsiZZVPglCAn7p7esJG1ChOVMNKL/UrJLMHBAuXSC5Q6DphDntz4dZYYQILd2f ptkmcN9uuV5LidkM9ve8khA1dPYS3XfxaOQsmkV3DjjMelL6HJ65la0tF2Zj30LuCJvh zhd0u9iagUtqC9z0gfjWgwsS4DVV2x4RG5+357JjVqnaCcuwOaazzVTEEvgGJ1i9fIIs CPhQ== 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=qa1QZeMOFWeYzv2MJOEIRnnvj8l+yo8w5NTSS06G6CI=; b=uKnewm/GKX/2d6n953XKSKIDjTDMFvD85f0xgaOQXR8z8/nZXZlkUfOAO6XVvseSxV fSXl1ph15fu2nn/4ahPy7pQL/WvKInlTcsBMaEPKRA0z5MsxqxPopimRpyPrUMfRlhJY MJdRej2P5LPGQRWTbnOFGbheFqJQVop42FQikCsUt8rqKwC5dgLywHNttZd6nH5oO1fN 7LhPs6RpLmCeypgv3HpQ+PE+YPKo7thftZoc1mDsJ7Fj5RRWF6wiuYCF3IiWF+5yYVtM bjKe8RV6I2078jPKehbVX03t/6MmYsn/k+G9MbsNL201sII3NkM+dE2zcRypF5gYXZEO OIcw== 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 h9si11404065pgb.319.2018.12.17.07.52.23; Mon, 17 Dec 2018 07:52:38 -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 S2387941AbeLQPt3 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 17 Dec 2018 10:49:29 -0500 Received: from skedge03.snt-world.com ([91.208.41.68]:41630 "EHLO skedge03.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387896AbeLQPtO (ORCPT ); Mon, 17 Dec 2018 10:49:14 -0500 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" CC: "linux-mtd@lists.infradead.org" , "Schrempf Frieder" , David Woodhouse , Brian Norris , Marek Vasut 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 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: 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 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 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; } -- 2.7.4