Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2251514imj; Mon, 18 Feb 2019 02:44:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMdXaQfYYgAjP+a9lpoV2q3vQPXVOS93my4e3h5EYK1IEiFiuA4NBeW7bxWAB7G+rdjvBi X-Received: by 2002:a17:902:a513:: with SMTP id s19mr24281359plq.324.1550486642554; Mon, 18 Feb 2019 02:44:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550486642; cv=none; d=google.com; s=arc-20160816; b=x8nMhOtYriCDT5PjYUAdPHFdReqBSu4ENTlYACXWnpZC4GhmZP+0WIclTDY9zJtVyU vDjUqktkcE6WjUZgreVKcj1LLKn0nmu0Au51/HMsY7HXvDi7galJ0w07pjYLk3v0rXbr +wSf9AiMw+fGvPSe3qhS8gI8OG6GxBNvXmbw5tXLcdhyz9Z74dkPAGp+TC+BOixsvEHM F7CX5zc/7bz4OXed0xVAr78+LQ+FwsE0MHACLk/g8+XTUP2qEiLbkeLW8HwkOJNI/bbT EtfN6daOCSWvOgzP1Q6gEeUMVM88AWtwxqDn7vYo/ll94Gy3/hCRxpDLmUSJFa/EAAiT u/JQ== 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=piJNterUL8Mb6fYGHvjK7/Gg/z7piChNER2ZqiRus8Q=; b=XemhX4Tr6UvssHaQommkMI5TWViC9yNltfIHapYvMQKtk4iSe6+t5JEKprg/VvEj1d yfh/JNAIfcgJXOhhItKt0feTYRD7VSKp8z2LLjcVP/NKGgTcEz8nu+xA/DeuJ0LU2DMr zV5TmoBT/rmktVnvBcfhB3MKIemg7tT5nlE8edj5IJzf28N78i2nTo4NXvMx2lqtlWM0 zgewIpp5alk8BukXFErK/jOLU2+QP7/cEdD7D4B34KEUTrD939LqB/Xeb4AR7MSmekam oF+Me+is2IXJJhkZdd+ZJ4QQttMtKo7XVu5LLjJXuMZjH+eQ5eDDMNiHMQRkQfPCBdSP LPOw== 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 i18si12476104pgm.566.2019.02.18.02.43.47; Mon, 18 Feb 2019 02:44:02 -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 S1730244AbfBRKnJ convert rfc822-to-8bit (ORCPT + 99 others); Mon, 18 Feb 2019 05:43:09 -0500 Received: from skedge03.snt-world.com ([91.208.41.68]:50240 "EHLO skedge03.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730138AbfBRKmt (ORCPT ); Mon, 18 Feb 2019 05:42:49 -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 9AFDF603768; Mon, 18 Feb 2019 11:42:46 +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.1713.5; Mon, 18 Feb 2019 11:42:46 +0100 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; Mon, 18 Feb 2019 11:42:46 +0100 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 v4 6/7] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Topic: [PATCH v4 6/7] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Index: AQHUx3avvmy6NK5LnkqXCtbnQbpnMQ== Date: Mon, 18 Feb 2019 10:42:45 +0000 Message-ID: <20190218104122.18788-7-frieder.schrempf@kontron.de> References: <20190218104122.18788-1-frieder.schrempf@kontron.de> In-Reply-To: <20190218104122.18788-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: 9AFDF603768.AF9B0 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 --- 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