Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7277129imu; Tue, 22 Jan 2019 03:24:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN4MQb5z9UiO9U9B5dc0DMY59UpbrTy7oSq6M37hG807ToKO9P/NplaT9l+VAePAxDBwAfRt X-Received: by 2002:a63:e516:: with SMTP id r22mr32018060pgh.256.1548156287514; Tue, 22 Jan 2019 03:24:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548156287; cv=none; d=google.com; s=arc-20160816; b=FWbWvVnKGJitoNnnGmQt0tpAkm6iuPcHo6LcvCyElefuKwSimwq+1j8wH5po1znkub sFMSw1vqIEqdCoWXaZxZ3NLVaYbVuwjoS10iFeFWOLiVDTd9ZmslM0oVSADb3bDXAEn3 O9zx8lj80H154nGHR5LBbEDxJEf12eV/Krf7QnTRXYofAu22LuqN2FtlVsfTHmXe/D1c GPLL0kuOxUsE/FK11iwGjCnq3vPOiaXQM03CM1gX5ejVZYuAx/W/djQyWRSb100Y8IRP 2k+45yVGpwOeqiMhkxficjqqJlBHEYm7K8KGN8tafRkpgIojJv1t37ObvXySVMhUNRgQ xv3g== 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:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=DPHIDO0ccst8KRTDohP4DoGapCfNYsLp3fCWjLvlIHM=; b=I3YKdq6nv3h6hZmpVRhYmRgGOesXIpAXX01ErNxhC1vCDVgquGPkXKk5u20SZ4tZja eTwPD2Qhq2GW8ZIDRIIBujCIy6BMb19xXd0+ZfIYTZ++QYX/9WIg/4SII9IpWy4SQB51 1HgaBtGDyGTj6tfY96j2h/4SAAwlq5cTIR6zvmQnU0Og26HfJM0u3dfRs+gM2GhSqjEF 3zzrMOHSbmSR4X3Ahl9ngbzjpm3oHTGhk5ZeB+StYSlm56okXSxMBRfjhIJLO6NY6VJl uHpGpA5i2JttnDgoJEMZBoWmXMgmNkIQpG5TdZVEFKuCkYD8ktUcr6dwMfVD7EyXMi/8 nq0w== 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 cb1si3113135plb.37.2019.01.22.03.24.32; Tue, 22 Jan 2019 03:24:47 -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 S1727932AbfAVLX2 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 22 Jan 2019 06:23:28 -0500 Received: from skedge03.snt-world.com ([91.208.41.68]:53400 "EHLO skedge03.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727663AbfAVLX1 (ORCPT ); Tue, 22 Jan 2019 06:23:27 -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 AA01767BC89; Tue, 22 Jan 2019 12:23:23 +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.1466.3; Tue, 22 Jan 2019 12:23:23 +0100 Received: from sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305]) by sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305%5]) with mapi id 15.01.1466.003; Tue, 22 Jan 2019 12:23:23 +0100 From: Schrempf Frieder To: "boris.brezillon@bootlin.com" , "miquel.raynal@bootlin.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" CC: "linux-mtd@lists.infradead.org" , "Schrempf Frieder" Subject: [PATCH v2 0/4] mtd: rawnand: Support bad block markers in first, second or last page Thread-Topic: [PATCH v2 0/4] mtd: rawnand: Support bad block markers in first, second or last page Thread-Index: AQHUskTiZRErDsCrDEO9QpZop6Kcxw== Date: Tue, 22 Jan 2019 11:23:23 +0000 Message-ID: <20190122112258.20042-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: AA01767BC89.AEA34 X-SnT-MailScanner: Found to be clean X-SnT-MailScanner-SpamCheck: X-SnT-MailScanner-From: frieder.schrempf@kontron.de X-SnT-MailScanner-To: boris.brezillon@bootlin.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, 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 Currently supported bad block marker positions within the block are: * in first page only * in last page only * in first or second page Some ESMT NANDs are known to have been shipped by the manufacturer with bad block markers in the first or last page, instead of the first or second page. Also the datasheets for Cypress/Spansion/AMD NANDs claim that the first, second *and* last page needs to be checked. Therefore we make it possible to set NAND_BBT_SCAN2NDPAGE and NAND_BBT_SCANLASTPAGE at the same time to scan/set all three pages. This series also contains patches for AMD/Spansion/Cypress and ESMT chips to enable both flags at the same time. --- Changes in v2: ============== * Rebase on 5.0-rc1 * Add patch to move bad block marker position info to a common place and rename/prepare existing flags * improve/rename function nand_bbm_get_next_page() to use new flags --- Frieder Schrempf (4): mtd: nand: Always store info about bad block markers in chip struct mtd: rawnand: Support bad block markers in first, second or last page mtd: rawnand: ESMT: Also use the last page for bad block markers mtd: rawnand: AMD: Also use the last page for bad block markers drivers/mtd/nand/onenand/onenand_base.c | 2 +- drivers/mtd/nand/onenand/onenand_bbt.c | 2 +- drivers/mtd/nand/raw/internals.h | 1 + drivers/mtd/nand/raw/nand_amd.c | 8 +++- drivers/mtd/nand/raw/nand_base.c | 64 +++++++++++++++++-------- drivers/mtd/nand/raw/nand_bbt.c | 28 +++++------ drivers/mtd/nand/raw/nand_esmt.c | 9 +++- drivers/mtd/nand/raw/nand_hynix.c | 4 +- drivers/mtd/nand/raw/nand_macronix.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 2 +- drivers/mtd/nand/raw/nand_samsung.c | 4 +- drivers/mtd/nand/raw/nand_toshiba.c | 2 +- drivers/mtd/nand/raw/sh_flctl.c | 4 +- include/linux/mtd/bbm.h | 14 +----- include/linux/mtd/rawnand.h | 16 +++++++ 15 files changed, 100 insertions(+), 62 deletions(-) -- 2.17.1