Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7599535imu; Tue, 22 Jan 2019 08:29:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN7tqDf4b9luVBZrRq9v2C46OyNLTbJOglAv/jGCFd38IZ1wfFEuWRpGFbdiHEsudrg/MfnV X-Received: by 2002:a17:902:31a4:: with SMTP id x33mr34295163plb.41.1548174564139; Tue, 22 Jan 2019 08:29:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548174564; cv=none; d=google.com; s=arc-20160816; b=ImlLJG5eG9Z7/xK3JLvEiTldGYwwR3PRlsoqKM5CgQuDP1HEPihKn1OmvNt5UJtt8t ECNP7mkhL7kOGbJxozAgZ/tLESRnBvHfApFy0z93vDY/tR34CXKFIKEtd7D6drDY7hya ZDaa4tUKu5kLA4uwjSJ7KtKfd9rSHcN452PQGoObzdOlboeialP9HeWv7dZWIOMU6WL5 AeyPA0NDw4ScUmMVSZG2RRm+Z1LDuXwgX5X2vcjbdfshC2DaFbhuXa0Ycvwk1VynjMAS 8iBKjy3BgP1KxjUepjnXzo7BvbEcQpg2EhF+K7bVjtlUPXyUjaF+TNLCOdXsa2NHyusH TToA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=1/vKT4JzNrrHsKbNY4nLFP8XCZFIMO+QGwNuxgxdKSk=; b=aadlicSsquEexptHlOdRbYZkYEGniUi33SKi533NGrcDFtDI38wop4EsRsfynsA/uc G4NcxIyTdJuIoWT1RDT7Tbhj/NaEXCCb9zO6yUl3AIUEm7kQh6u6VFuAzEu9kilaj3Wd r4EGytBbGZdYgqkhKctX8DV19IIimG2lNuU/g6EegD0AR6BADuGAXx4vwnceqti1SHCp g5OGJ48NXljY4whC2Xb8nASBecFhY1YqWqSDZ9/wpZ9UG0TC1vYXLEKz1dZW7DWtuTBe V284G4RXcNAilJr/m4I9OawDWPVaCLlV4nt+RUyJnUGa+g86WNKokIrYBcZbpYPbSKdK EAyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q20oaR1Y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4si16872469pgr.346.2019.01.22.08.29.08; Tue, 22 Jan 2019 08:29:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=q20oaR1Y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729103AbfAVQ1o (ORCPT + 99 others); Tue, 22 Jan 2019 11:27:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:52284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728580AbfAVQ1o (ORCPT ); Tue, 22 Jan 2019 11:27:44 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E465A2085A; Tue, 22 Jan 2019 16:27:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548174463; bh=lNb94LlMvk29Pwlw43y6W7QGnz/YG5YHhNI1f7bJR/s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=q20oaR1YZGO/U/b56cCmuuKPr+yI5cE8yPwQcQoWWAfM0G9I6P6tJBXgCfNX66UnS D7hz6bKX54/B3f9hxC7IMzfC9n4m1JNMdOFh6ehFX+PgOHIV94dEfMaX0+U0mqC4Ov N3VzuFHyWtVPLsrzYVEEvBmZFq7zVuoR+wYMvAXI= Date: Tue, 22 Jan 2019 17:27:32 +0100 From: Boris Brezillon To: Schrempf Frieder Cc: "boris.brezillon@bootlin.com" , "miquel.raynal@bootlin.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , David Woodhouse , Brian Norris , Marek Vasut Subject: Re: [PATCH v2 3/4] mtd: rawnand: ESMT: Also use the last page for bad block markers Message-ID: <20190122172732.6cbcffec@bbrezillon> In-Reply-To: <20190122112258.20042-4-frieder.schrempf@kontron.de> References: <20190122112258.20042-1-frieder.schrempf@kontron.de> <20190122112258.20042-4-frieder.schrempf@kontron.de> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Jan 2019 11:23:32 +0000 Schrempf Frieder wrote: > 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; > }