Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4144336yba; Wed, 17 Apr 2019 05:38:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTUEoV9SarPG+czOivlk5n8UDxYoHp4k8CElNicuPgrAHPy/iR1vQfD4pUUiSADkFwh8Bm X-Received: by 2002:a17:902:31c3:: with SMTP id x61mr85590334plb.143.1555504738791; Wed, 17 Apr 2019 05:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555504738; cv=none; d=google.com; s=arc-20160816; b=l/crQG3Q4OMC1A2xMssgtQcW4Y8+12kn3TJMcYZcdl172DkoEKofcOLuBg9zAonnp6 z/jPr2m9IxDaKke54S05d3i1Dql4e4wRPO7XU9izqgrdK5d1uUbvxO+oLe+c1R5NR2Bc 6iqM+FPUOuSBMXG4mhq2R09X34jjeK5o5lmkjJB4mn+xa9u43KEsMZm/LqcI4go6PFLB b7m9lANqXkZpdjPekFlHwPT0lWZbRzuLuKu4NMZ0MtER3irskKtkAyfG5konZuSScNjD hoMFV4h4Rikbn70dxOgySs23N+p4diQ6+XOZTxtRKOxhECZxgy/XWPGGzlI5+B1bUoME 6oiA== 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=F2bsT7VrIu6/0c/GRrfffyjXQmcYWWbAQntpiyvZbV4ET8LSkRj6+K5YXYcWqdU5T/ qtjyqauUbEqJ+1Cyve3UwMxxLo6D8EEUyLDQfgy2mhYhuTs5fMNeeeJQU/hPyFcI6WWA J1kQpt1O1QtDHANdSdxg4HPQCi6W+Fw6EsrYKV0OZQWeqFUNoiKrJccLSSo1n6j80oV4 sTmlX9qtpsbXoBKDSVBUspfXIgoZBw3rTjwM8CRXInUAcXILr7WuJ9+UTBuV26+m6/fy 6BOaIThZpnXqoGkKYaerDI9O2toPX1QLNnSkEYAoTRv28Ml1FMmQFMW63s9W8gkiZust jUuA== 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 g127si29038905pgc.135.2019.04.17.05.38.43; Wed, 17 Apr 2019 05:38:58 -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 S1732223AbfDQMhH convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Apr 2019 08:37:07 -0400 Received: from skedge03.snt-world.com ([91.208.41.68]:35530 "EHLO skedge03.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732134AbfDQMgk (ORCPT ); Wed, 17 Apr 2019 08:36:40 -0400 Received: from sntmail12r.snt-is.com (unknown [10.203.32.182]) (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 4E17067A900; Wed, 17 Apr 2019 14:36:38 +0200 (CEST) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail12r.snt-is.com (10.203.32.182) 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:36:37 +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:36:37 +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 v6 6/7] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Topic: [PATCH v6 6/7] mtd: rawnand: ESMT: Also use the last page for bad block markers Thread-Index: AQHU9RozvnaZ5hulyESD2RJwiuwRcA== Date: Wed, 17 Apr 2019 12:36:37 +0000 Message-ID: <20190417123631.22545-7-frieder.schrempf@kontron.de> References: <20190417123631.22545-1-frieder.schrempf@kontron.de> In-Reply-To: <20190417123631.22545-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: 4E17067A900.AC3F7 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