Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp332047imu; Fri, 7 Dec 2018 01:42:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/VZdzyFiZyYJVjncwKXGBePQk04O0aKeyIuAo5+O2EAMNUhp+x/J2lLJDBdBCmPCZ/NKK4R X-Received: by 2002:a63:d252:: with SMTP id t18mr1317322pgi.133.1544175724437; Fri, 07 Dec 2018 01:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544175724; cv=none; d=google.com; s=arc-20160816; b=GBae/HazLBi2r7SrtmvK7t+urrzFwG9d8yi+/81tkG1FLNmVznI/5y0VoJ+VGleGc7 k9/1eHo9fjLAP3iHoHuEu6cNIffIVd0FhN9Ek8mlG0PcViCQvycZBKlhP8AOI5dwU0Tn Qex8GROWLdK6LnADyLTW/kcB2lhRx81d/5mhLtwHGzmcMIRHUK8XdaEgw3z+p0jGdkEY +9OImDbKItHWAJLvCdCM/wjBCA692PtLKkfmiON0N9IYWxw4tbxyTgblBNQtNI3nE57N 5bdPv3K1z7TLCYPgiknTHhZjavsBCJwrHGYZRKe83ScCzRg04JeJU+B0Nz9yj6X3p/CM 4NFQ== 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=aNOMRpkcrMZiHLbjfOYnlgA9PLMpki3ZFaTK54t38Ts=; b=uynqJx0bFJAbvbDSGgqZu6cd7vJcpHJecwXbHYqdX7vuzLkOv7WaPYGiGVS4JPJrkC 7BasH6kiu3TyPLE8fI1L+DV28q7NJ5KovlPoB8GW5j0137GB80/cHpihV/6NGxRiW0BV +zYUXq84L7OSIFks8Wo4bHMGZcFGsaVcNO+n5JYzW/aQW0uEKbtZmEvWhaS0EtCSZxkQ jx3JyZq/Yc0K6akj9aSxFV+FA63C9rdIfEaLJtvDtVPQnKAMTy1r+7LYP9jLBSLk1BYO S5w+8Kr0KR4u5gPIvxDp/pTXaiuyKRzzufV+snS8UMmzWIWgm2ZPKw0s6cT8MM+WbMLX yNZw== 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 d34si2309717pgb.43.2018.12.07.01.41.48; Fri, 07 Dec 2018 01:42:04 -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 S1726051AbeLGJjb convert rfc822-to-8bit (ORCPT + 99 others); Fri, 7 Dec 2018 04:39:31 -0500 Received: from mail.bootlin.com ([62.4.15.54]:48392 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbeLGJja (ORCPT ); Fri, 7 Dec 2018 04:39:30 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id B90F520717; Fri, 7 Dec 2018 10:39:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from xps13 (aaubervilliers-681-1-79-44.w90-88.abo.wanadoo.fr [90.88.21.44]) by mail.bootlin.com (Postfix) with ESMTPSA id 6759620711; Fri, 7 Dec 2018 10:39:17 +0100 (CET) Date: Fri, 7 Dec 2018 10:39:17 +0100 From: Miquel Raynal To: Schrempf Frieder Cc: "linux-kernel@vger.kernel.org" , "peron.clem@gmail.com" , Boris Brezillon , Richard Weinberger , "David Woodhouse" , Brian Norris , Marek Vasut , "linux-mtd@lists.infradead.org" Subject: Re: [PATCH v3] mtd: spinand: Fix ECC status and OOB layout for Toshiba TC58CVG2S0H Message-ID: <20181207103917.55496da2@xps13> In-Reply-To: <8e70737f-0780-d607-eadc-f6435288f660@kontron.de> References: <1543823821-18352-1-git-send-email-frieder.schrempf@kontron.de> <20181207090041.6b8d9731@xps13> <8e70737f-0780-d607-eadc-f6435288f660@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 Schrempf, Clement, Schrempf Frieder wrote on Fri, 7 Dec 2018 09:31:47 +0000: > Hi Miquèl, > > On 07.12.18 09:00, Miquel Raynal wrote: > > Hi Schrempf, Clément, > > > > Schrempf Frieder wrote on Mon, 3 Dec 2018 > > 08:01:38 +0000: > > > >> From: Frieder Schrempf > >> > >> When reading the status of the on-chip ECC, the Toshiba chip returns > >> two different states for reporting corrected bitflips. We should check > >> for both of them. > >> > >> Also return the free OOB bytes as one contiguous area, instead of > >> multiple sections. > >> > >> Suggested-by: Clément Péron > >> Signed-off-by: Frieder Schrempf > >> Acked-by: Clément Péron > >> --- > >> Changes for v3: > >> =============== > >> * Add Acked-by > >> * Add comment for BBM in OOB layout > >> > >> Changes for v2: > >> =============== > >> * Remove the changes to the ECC bytes in the OOB layout > >> --- > >> drivers/mtd/nand/spi/toshiba.c | 11 ++++++----- > >> 1 file changed, 6 insertions(+), 5 deletions(-) > >> > >> diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c > >> index 294bcf6..0812655 100644 > >> --- a/drivers/mtd/nand/spi/toshiba.c > >> +++ b/drivers/mtd/nand/spi/toshiba.c > >> @@ -11,6 +11,7 @@ > >> #include > >> > >> #define SPINAND_MFR_TOSHIBA 0x98 > >> +#define TOSH_STATUS_ECC_HAS_BITFLIPS_T (3 << 4) > >> > >> static SPINAND_OP_VARIANTS(read_cache_variants, > >> SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), > >> @@ -33,19 +34,18 @@ static int tc58cvg2s0h_ooblayout_ecc(struct mtd_info *mtd, int section, > >> region->offset = 128 + 16 * section; > >> region->length = 16; > >> > >> - > >> return 0; > >> } > >> > >> static int tc58cvg2s0h_ooblayout_free(struct mtd_info *mtd, int section, > >> struct mtd_oob_region *region) > >> { > >> - if (section > 7) > >> + if (section > 0) > >> return -ERANGE; > >> > >> - region->offset = 2 + 16 * section; > >> - region->length = 14; > >> - > >> + /* 2 bytes reserved for BBM */ > >> + region->offset = 2; > >> + region->length = 126; > >> > >> return 0; > >> } > >> @@ -70,6 +70,7 @@ static int tc58cvg2s0h_ecc_get_status(struct spinand_device *spinand, > >> return -EBADMSG; > >> > >> case STATUS_ECC_HAS_BITFLIPS: > >> + case TOSH_STATUS_ECC_HAS_BITFLIPS_T: > >> /* > >> * Let's try to retrieve the real maximum number of bitflips > >> * in order to avoid forcing the wear-leveling layer to move > > > > If you don't mind, I would like to squash this with the original patch. > > What about also adding Clement's Acked-by to it? > > Sure, you can squash this with the original patch. And I guess adding > Clément's Acked-by would be appropriate, too. Fix squashed, I will push on nand/next today. Thanks, Miquèl