Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4032616yba; Wed, 17 Apr 2019 03:09:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8mcUriaX7k6GMnbkoP48OEYD+0AMFiESfXWgalitxgNpi/1qXZy7SMDUt8iricD/oIUPO X-Received: by 2002:a17:902:362:: with SMTP id 89mr88855716pld.172.1555495781209; Wed, 17 Apr 2019 03:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555495781; cv=none; d=google.com; s=arc-20160816; b=lNqXUzwa015wLb7bUPkocphUJDztggyAWv0veL7/ejaWDLMjY9G77NEHcn+kXsG0y7 C0HL+yMYz6dO0PkKdo4R2fpUXcj7kz+q+7spYg0XCdQHShGWjLTVqf6Qib7gHhKiuAs0 CudUXZO31KyXjgom/YH6xnIDL3jQPQrERV+cBY+iuF8ultaPr3Fe4mVvnsLqU38lNtQv sYCmjm9WX6RzlaZIJEJPtDwpFxkckdDQ4b53gWIcMo//4B8LH0U50gAa17dFBF3crpY3 vc+2yZOLQQPvN5nOELcPnToH8dT8qh0CINiuDhfe7rehchNBfhSEiS87FVV2QycHTzQ8 n5Ig== 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=SDxWb6B5AEKZM1/a/r1d6cjnqfq3OVVOBaMQ5kZuT4A=; b=Uey9eE4Ciwj+Q/QnJJHuem4PPTc5Zuk2RyNw0WeNFeAUOiGDb+exWny3IvG7nDGa5J KhwT5x5GZPlvQvCDVFo1Y9JP74fBL47Snl6UA5yywDljecdCZKcY8Xh5FU0Qljg7vZaC 3Yd22chW4F/yCqvCbaINVO+GtiXGTh5NEvsgNcFH7MiBIa3uoRFaMx8OfMK/kKveoGD1 fuHeWVoHwkp7G2cLrZHRQ/OiV6WLo2HvCQVOg7ZbqMnW7UeU/Z1YEcAHQzlFjfse9vx3 THAuXSj/PHU+c/u/owhwrIVwbbJ/QMe7v1sQeFkoGR1JWjcmPzIOD4G5DNj99jweGCie Y/Xw== 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 u2si27671393pgc.250.2019.04.17.03.09.26; Wed, 17 Apr 2019 03:09:41 -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 S1731704AbfDQKIY convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Apr 2019 06:08:24 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:42853 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731574AbfDQKIY (ORCPT ); Wed, 17 Apr 2019 06:08:24 -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 C7A9CC0003; Wed, 17 Apr 2019 10:08:21 +0000 (UTC) Date: Wed, 17 Apr 2019 12:08:21 +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 7/7] mtd: rawnand: AMD: Also use the last page for bad block markers Message-ID: <20190417120821.56af381c@xps13> In-Reply-To: <20190218104122.18788-8-frieder.schrempf@kontron.de> References: <20190218104122.18788-1-frieder.schrempf@kontron.de> <20190218104122.18788-8-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:46 +0000: > From: Frieder Schrempf > > According to the datasheet of some Cypress SLC NANDs, the bad > block markers can be in the first, second or last page of a block. > So let's check all three locations. > > Signed-off-by: Frieder Schrempf > Reviewed-by: Boris Brezillon > --- > drivers/mtd/nand/raw/nand_amd.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/nand_amd.c b/drivers/mtd/nand/raw/nand_amd.c > index 6202cbf7ee8d..2ffcddff3e27 100644 > --- a/drivers/mtd/nand/raw/nand_amd.c > +++ b/drivers/mtd/nand/raw/nand_amd.c > @@ -40,7 +40,13 @@ static void amd_nand_decode_id(struct nand_chip *chip) > static int amd_nand_init(struct nand_chip *chip) > { > if (nand_is_slc(chip)) > - chip->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE; > + /* > + * According to the datasheet of some Cypress SLC NANDs, > + * the bad block markers can be in the first, second or last > + * page of a block. So 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