Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4032527yba; Wed, 17 Apr 2019 03:09:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtuqOjAVsINHz6+hqL9v/gaM2B7HZ9J6mQZ8QR7JHX/XHncW4chKZUaB82zUrhtIdvCHoU X-Received: by 2002:a17:902:1003:: with SMTP id b3mr85825477pla.306.1555495773595; Wed, 17 Apr 2019 03:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555495773; cv=none; d=google.com; s=arc-20160816; b=wbSFMFmTN8A3ELbzpnmSFZvmv+yNPP3TuSrm8Vw4J5c8Mwp7CfNKDjtW7lCyDiP8HK SkMnwyJkKCRvE4ne/tswblDsvRAXXtO9n/r7qIMdOxjs1eaNq/aT6n/DP5ixR7DNk+VV 2+NYOeBE13lYDIbt4TLPlZGn1ftBp9AEQv6l8LGLQWUtiSCL0gVftUZudSVVIQaMasD6 EZKdZYHsPEfzlF0rN+wxdjCovqdm/p8ZVZJVscKn0NU17fXCX8bObI2I3mAi78/tRlSM b+YdU84uAHHKMGKEGy6HZXdgDd6ZL+2asrqmcm16/evaVzAmXu2SH2fCSS7OR3KoohRO azvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=BGvqUldJn7ijYH/eETvm+9KazbcJlbZJtZsxH3GDI0A=; b=XRLzBmixerm/Sqp/pzy+sv+dEti5nXkbLsTMvqZp7Oq/BW4zNCEMStiV1uz72rP8GS 49sLI2RQQ1PFSfP7/6B+lXiuOBBydqRaIrZzaBBXgHPwwFr9nLonpGAu7GuCOT/ubcKu cUp/6kfTnoXu99XwzrxeKiA0b3weLpuluyUELQmbv8xfYzHO4KL+rsBAn2+RQD6f6eAb 0t5CGYjKMjBhbRsiOGAezbvNm0YsFpfsDU7r4dBIsyiWApBPv2ySQtNdYOm97LHzgJn7 DiUAN3yGhsqNXZZfHZDSHMzsCSyhqzOWqjW7tThLM1gGhlBKW6BdUwXlvv353R1G2Fip yoNw== 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 f2si26814781pgc.182.2019.04.17.03.09.18; Wed, 17 Apr 2019 03:09:33 -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 S1731659AbfDQKIJ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Apr 2019 06:08:09 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:38637 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbfDQKII (ORCPT ); Wed, 17 Apr 2019 06:08:08 -0400 X-Originating-IP: 90.88.160.238 Received: from xps13 (aaubervilliers-681-1-42-238.w90-88.abo.wanadoo.fr [90.88.160.238]) (Authenticated sender: miquel.raynal@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 69223C0007; Wed, 17 Apr 2019 10:08:06 +0000 (UTC) Date: Wed, 17 Apr 2019 12:08:05 +0200 From: Miquel Raynal To: Schrempf Frieder Cc: "bbrezillon@kernel.org" , "richard@nod.at" , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , David Woodhouse , Brian Norris , Marek Vasut Subject: Re: [PATCH v4 6/7] mtd: rawnand: ESMT: Also use the last page for bad block markers Message-ID: <20190417120805.6727d78f@xps13> In-Reply-To: <20190218104122.18788-7-frieder.schrempf@kontron.de> References: <20190218104122.18788-1-frieder.schrempf@kontron.de> <20190218104122.18788-7-frieder.schrempf@kontron.de> Organization: Bootlin X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frieder, Schrempf Frieder wrote on Mon, 18 Feb 2019 10:42:45 +0000: > 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; > } Reviewed-by: Miquel Raynal Thanks, Miquèl