Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp255624imu; Fri, 7 Dec 2018 00:02:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/VHD9OTrFa5ptspb4c+9wv9t5xNo7t7TZ3gQsaBz+cd+P2NDW+HwSzhBtdyZSMaCeDectZj X-Received: by 2002:a62:e201:: with SMTP id a1mr1231103pfi.75.1544169739865; Fri, 07 Dec 2018 00:02:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544169739; cv=none; d=google.com; s=arc-20160816; b=RuWYFTvyJMv6VBBiL/jiXMrDSu0wmCRdHb3M7jzymD8JVVdQT766cTiQRgFzKtXRJh Qrqncta4ohrsjElsZjUr0pxE/MOL85DiQc7F5DGerresaFKTLwGTgWlH+2JDalVnh01A 7B2cFnLhN2Tdc/fw9O2+yo2fChUEsvRiAh2jmu6wjeM2oklPImh02SFNgfS6F01lzqZv 5at21TYXey/sdvHFM7Cr07//YRHk0GU2afBRi7+MHklphB7AhkFeL5CIUJtcqLDy/9u1 otMj7TQ5JhXXMKolzbGFcu4Ky0vs+zL64rKhxjdinCgSRzIhrdSD4KbyrCCgfnDwT0Z2 JQXA== 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=+sY6sFIWn1lWSf1o18txFEuBzrymF9m/XkaWTx98dYE=; b=kqI95AxF+dY/DK96RfTe3MimoFDzEp4f1GkdBz3BUJbJ86m7HWXgq8InAvRZd1FB80 WnuurCJJgXh7msxAja4LavGzj/v+b1amTXTwy5WqrjtQhoIACsIkAjrp3pEmvMk+epsz Jxj5EXWv8VDAs1zIxtwkX7dtv4KJsHaGBnVNugVCNBwm/9sWrJHvCSYzpyxKekXRdwD5 ZWBXntCabGGPV70l30n1yCQt6f+GrDhM32poqZG1UN6Ys8AlDMP+aNCiLGgE6T2xmqcu v8Sl9Ft0Mz857auJdQFFljT87a8I1zlid+296rNCZGCdcDD26XhPxOFIT/SCJ+Nhg9Hx 9Ujw== 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 p5si1288767pls.338.2018.12.07.00.02.00; Fri, 07 Dec 2018 00:02:19 -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 S1726019AbeLGIAz convert rfc822-to-8bit (ORCPT + 99 others); Fri, 7 Dec 2018 03:00:55 -0500 Received: from mail.bootlin.com ([62.4.15.54]:44313 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725952AbeLGIAz (ORCPT ); Fri, 7 Dec 2018 03:00:55 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 7719520CC3; Fri, 7 Dec 2018 09:00:52 +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 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 26C362073D; Fri, 7 Dec 2018 09:00:42 +0100 (CET) Date: Fri, 7 Dec 2018 09:00:41 +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: <20181207090041.6b8d9731@xps13> In-Reply-To: <1543823821-18352-1-git-send-email-frieder.schrempf@kontron.de> References: <1543823821-18352-1-git-send-email-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 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? Thanks, Miquèl