Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1907139pxb; Mon, 23 Aug 2021 07:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn7AejsK4D2l72AuJnRV+FqSL3Q0C1GV6EPGblqPMrGPEIguwzSxGZrQMoMFwagh7NzkzL X-Received: by 2002:a17:906:d154:: with SMTP id br20mr35715129ejb.296.1629728782054; Mon, 23 Aug 2021 07:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629728782; cv=none; d=google.com; s=arc-20160816; b=okDOiYeGTaD1RkynB7HFLEF9ntubPGVDWsauyPcQfmlQD+XDfiosx7f8FLCCC2c9Fd oRXpbObS18+wpXYMRU9KXCh95vHGfkXaYKICnfiY3Orgfo/wHJZDIbGLy+2/9MuvEnXx pWU8DdO7YPojCcTfhVcoVExrcYQz8aoAjAQ8qaUFr/DjRCY7Dd914EFJJ46oQ6ir6DEG EU28NniTpF6e5gww4r2UAN7UtfblDS4bu0uHZOIbRy07SI6jwLMFqLqS4eCTIKjluikf 16hFkbsoiF/dYOIn0p8zUs4AXb/zDGSV+YfCnxjpnhpJMSKcRevqsDatPVmjYIKbtee1 e7UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=UG14HwuQyWTatJ5GyK8x9r5N8Lg78HAeFJ8VUfMCkpw=; b=WDP4APQM1HITmVP0fxsq+2oPabsrXMNGEt6U6NLDIDZkpPLXO1Fz2kBR/nLa83ymwP Wjyr4EhfPOnB7wKZcmrJBW7NXPbNN/JhwPQzlDO+zp5gCiPXuwC3VtmuabfR2krLQDM8 fRV7y8yjhhTGe3ifxa6LXpnTd3MThaqX7KOlacWl3CQmbBqMFzBTqDoaNRTGesCz3MKa opAxpMxO+1TdVTCrmEiQt2if6slVmJUl0FCJIVeJJ3u1/VNVM3fFv930ufbzqQncoxEb TWiMGIh6ZvyOeI7q00dttc+AsC3oflCLF1Hz5GBJio0GjhjMRhf48J6mE4iTotFV9GUc 2/0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o4si1745709eje.262.2021.08.23.07.25.57; Mon, 23 Aug 2021 07:26:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbhHWOWf convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Aug 2021 10:22:35 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:45999 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbhHWOWe (ORCPT ); Mon, 23 Aug 2021 10:22:34 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 16FF140007; Mon, 23 Aug 2021 14:21:49 +0000 (UTC) Date: Mon, 23 Aug 2021 16:21:48 +0200 From: Miquel Raynal To: Daniel Palmer Cc: linux-mtd@lists.infradead.org, richard@nod.at, Linux Kernel Mailing List , linux-arm-kernel Subject: Re: [PATCH v3] mtd: spinand: add support for Foresee FS35ND0*G parts Message-ID: <20210823162148.35a24183@xps13> In-Reply-To: References: <20210811084924.52293-1-daniel@0x0f.com> <20210816101143.2a64d7b9@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, Daniel Palmer wrote on Mon, 23 Aug 2021 23:19:02 +0900: > Hi Miquel, > > > > + /* > > > + * The datasheet says *successful* with 4 bits flipped. > > > + * nandbiterrs always complains that the read reported > > > + * successful but the data is incorrect. > > > + */ > > > + case FS35ND01G_S1Y2_STATUS_ECC_4_BITFLIPS: > > > + return 4; > > > > This is a real issue. Can you use the nandflipbits tool from the > > mtd-utils package (you should take a recent version of the package) and > > try to observe what happens when you insert a 4th bitflip in a section? > > > > I generally believe the tool more than the datasheet :) > > Maybe I'm using it incorrectly but I can't get a 4 bit flipped > situation to happen. > > I erased the paged so it's all 0xFF: > > # flash_erase /dev/mtd0 0x8000000 1 > Erasing 128 Kibyte @ 8000000 -- 100 % complete > # nanddump --bb=dumpbad -s 0x8000000 -l 1 -c -p /dev/mtd0 > ECC failed: 0 > ECC corrected: 6234 > Number of bad blocks: 0 > Number of bbt blocks: 0 > Block size 131072, page size 2048, OOB size 64 > Dumping data starting at 0x08000000 and ending at 0x08000001... > ECC: 3 corrected bitflip(s) at offset 0x08000000 > 0x08000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > > Then used nandflipbits to flip a bunch of bits in the first byte and > then a few other bytes: > > # nanddump --bb=dumpbad -s 0x8000000 -l 1 -c -p /dev/mtd0 > ECC failed: 0 > ECC corrected: 6246 > Number of bad blocks: 0 > Number of bbt blocks: 0 > Block size 131072, page size 2048, OOB size 64 > Dumping data starting at 0x08000000 and ending at 0x08000001... > ECC: 3 corrected bitflip(s) at offset 0x08000000 > 0x08000000: f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000010: eb ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000020: ef ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000060: ef ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > > Anyhow, > I think we should probably return -EBADMSG if the 4 bit flips status > appears as nandbiterrs always complains that the data is wrong. I am not sure to follow, above the software says "3 corrected bf" while I thought the problem was when getting 4 bf, but the dump show many more. Can you show me how it behaves: * erase (like you did) * insert {1, 2, 3, 4, 5} bf and show the dump each time? Thanks, Miquèl