Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8412763ybi; Thu, 6 Jun 2019 11:54:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEh6JMagCL90wyT96iWfZbGYx47CV1+Ouhq4OCWOQzTXy52PTj5XPaEjv9rVRwaT4G7w+F X-Received: by 2002:a62:ee04:: with SMTP id e4mr52472681pfi.232.1559847248089; Thu, 06 Jun 2019 11:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559847248; cv=none; d=google.com; s=arc-20160816; b=olKAkgLk7vjYvXawDdvrM9Ssz1XMWCnQidXW/1mU5SWPo/tIaEEnklp2sv2B0WIile /l+l3pCWj0q7XnKRWUkKAjUVYLq2fJWfOZUsfvru3UGKPR43lNHA1FY55RAZd4cpBQMi uwgu6+wias9/gmzzbSRFp56cz6d/tbt13YbKMo+CDfYTkI4qYDV3u/+aIBrjUkLQRArN MGr+bh5t0mYl0IkItjs90JhIWF3TCI4Wmg4T1OWwW3gSQ8NfOrv148FqapO/BtSTxIcH wV4A+zCJ3ekxpycy8V0y1uOMSscI2JlzJU6/OB6DjNs4M1Fn2PDZG70hdo09CcpsgC0o /LeQ== 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=373fdGIekHcgnvymxOvIh0xq7zkMkYADPIu5zQLTtao=; b=zacN78Pjdmd+lwrLmPlSXau1gik/z5JIKZ+jXaOFk6F0RV9p2uD/TH20RHOJO0F6qs yc7l46FY9JxyAA0pAzPNklNuQLBhn5muDu1mEQ/NAm+mac3r2f8b7jlpmcWPPd48wr64 +IfG4anImsteHRItv/+PxXWwtJE1jBJmGdmH2cP9IR2LLrBS33Srz+8oSk8xA84gHtUS 7S9iElgHTTZPMCRnbYPJp1EUFif0W+4ido6iKldlPmxvreaGSk0djngYuIy33I/hYTeu XpJCD+2GpiBcr18slGITqgZna0+965HL7fDwzT6QZAK03qqBrhG8kT2tJt27wd0RPqRY /b1g== 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 d3si2498627pju.69.2019.06.06.11.53.52; Thu, 06 Jun 2019 11:54:08 -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 S1729899AbfFFRH7 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 6 Jun 2019 13:07:59 -0400 Received: from skedge04.snt-world.com ([91.208.41.69]:58594 "EHLO skedge04.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728081AbfFFRH7 (ORCPT ); Thu, 6 Jun 2019 13:07:59 -0400 Received: from sntmail11s.snt-is.com (unknown [10.203.32.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by skedge04.snt-world.com (Postfix) with ESMTPS id 5E45B661177; Thu, 6 Jun 2019 19:07:56 +0200 (CEST) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail11s.snt-is.com (10.203.32.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 6 Jun 2019 19:07:55 +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; Thu, 6 Jun 2019 19:07:55 +0200 From: Schrempf Frieder To: "linux-mtd@lists.infradead.org" , "emil.lenngren@gmail.com" , "miquel.raynal@bootlin.com" , "linux-kernel@vger.kernel.org" CC: "bbrezillon@kernel.org" , Schrempf Frieder , Richard Weinberger , "David Woodhouse" , Brian Norris , Marek Vasut , Vignesh Raghavendra Subject: [PATCH] mtd: spinand: Fix max_bad_eraseblocks_per_lun info in memorg Thread-Topic: [PATCH] mtd: spinand: Fix max_bad_eraseblocks_per_lun info in memorg Thread-Index: AQHVHIpiPxYIjYD5lkmpT+H/FkTT7Q== Date: Thu, 6 Jun 2019 17:07:55 +0000 Message-ID: <20190606170754.6531-1-frieder.schrempf@kontron.de> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 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: 5E45B661177.AF631 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, emil.lenngren@gmail.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, marek.vasut@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com 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 The 1Gb Macronix chip can have a maximum of 20 bad blocks, while the 2Gb version has twice as many blocks and therefore the maximum number of bad blocks is 40. The 4Gb GigaDevice GD5F4GQ4xA has twice as many blocks as its 2Gb counterpart and therefore a maximum of 80 bad blocks. Fixes: 377e517b5fa5 ("mtd: nand: Add max_bad_eraseblocks_per_lun info to memorg") Reported-by: Emil Lenngren Signed-off-by: Frieder Schrempf --- drivers/mtd/nand/spi/gigadevice.c | 2 +- drivers/mtd/nand/spi/macronix.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c index e5586390026a..e6c646007cda 100644 --- a/drivers/mtd/nand/spi/gigadevice.c +++ b/drivers/mtd/nand/spi/gigadevice.c @@ -180,7 +180,7 @@ static const struct spinand_info gigadevice_spinand_table[] = { SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout, gd5fxgq4xa_ecc_get_status)), SPINAND_INFO("GD5F4GQ4xA", 0xF4, - NAND_MEMORG(1, 2048, 64, 64, 4096, 40, 1, 1, 1), + NAND_MEMORG(1, 2048, 64, 64, 4096, 80, 1, 1, 1), NAND_ECCREQ(8, 512), SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c index 6502727049a8..21def3f8fb36 100644 --- a/drivers/mtd/nand/spi/macronix.c +++ b/drivers/mtd/nand/spi/macronix.c @@ -100,7 +100,7 @@ static int mx35lf1ge4ab_ecc_get_status(struct spinand_device *spinand, static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO("MX35LF1GE4AB", 0x12, - NAND_MEMORG(1, 2048, 64, 64, 1024, 40, 1, 1, 1), + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), NAND_ECCREQ(4, 512), SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, @@ -109,7 +109,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)), SPINAND_INFO("MX35LF2GE4AB", 0x22, - NAND_MEMORG(1, 2048, 64, 64, 2048, 20, 2, 1, 1), + NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1), NAND_ECCREQ(4, 512), SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, -- 2.17.1