Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1937749pxb; Mon, 23 Aug 2021 08:07:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybG9AT79T6kcyqZ1bLAq7OUhZS7+T5KB3AAGLlPWBsjXF3YpjZ0zAAaqRMaiz3okwWvS2f X-Received: by 2002:a17:906:32ce:: with SMTP id k14mr24506763ejk.503.1629731271686; Mon, 23 Aug 2021 08:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629731271; cv=none; d=google.com; s=arc-20160816; b=rnOS+dC9WYccgqDvdr7eLUcIfaQYBPacEZnjdvdnzOJwQXATbmIIuwpERE2sQrtuhi 7ualqn4DmKZ/gYJ+bLlW0JjMaBSay2GlSOZdXTH7j8OPn/dpE4/jlYmz86cOA5nt4IHV 95nRPuBgnEglV1dUfOuKb8m5YjAZFVjgcre8Yuyt0TDH0jwMJshAR8Ohd9A0XY82M45q BpSatDUwToHdm+MT5huvwmzgfLHvChmxJEAkPoqbYrAPh7fVKi1ZBiDfAvIL6Mf35YuQ IKm+1amXWHR08f4n1KHEf4R9sRJd1Wn+At/EBXARHVKFscP9+qarvmtqmVRkd3UnBqRE xDYA== 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=0MOtdvCu+mnuv6YL19u+zpHJZSi8HeqLbreuzV+0QZ4=; b=SMEea1KMza9Z5cc/kZbDvnZPUpnM/FhNNNJqoKMTJLEa2xOVxVO/k39Cs2hSFAonap pC6jvTM954lbeT+9oSJId41pRV2ypDULXuyd3cmug9c3ZblKSPOcWTqI5XWYWbFJOmBJ J/4S3GAq1Q7t39hsetGsLwL1AgFpO8g8MSb0Evxde6Tg+DNXG84xDYR3QrmcD69wuNZr sUN3j5fhjqXkbQdRcve9H2x4rXFiOHimSOnaje1tuK45bn0aY/7098N39vhztOX7RDvd sHFGymFY2yY+g2VXsHUOXBSodTsyEM2OKC7GdQZ1QoQe8x1TG1hCDyVXCOKRXI8kB9Sf 0otQ== 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 by26si14815408edb.587.2021.08.23.08.07.26; Mon, 23 Aug 2021 08:07:51 -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 S230383AbhHWPEm convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Aug 2021 11:04:42 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:47821 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbhHWPEl (ORCPT ); Mon, 23 Aug 2021 11:04:41 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 2D1E01BF203; Mon, 23 Aug 2021 15:03:55 +0000 (UTC) Date: Mon, 23 Aug 2021 17:03:54 +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: <20210823170354.2dccabd5@xps13> In-Reply-To: References: <20210811084924.52293-1-daniel@0x0f.com> <20210816101143.2a64d7b9@xps13> <20210823162148.35a24183@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:54:20 +0900: > Hi Miquel, > > On Mon, 23 Aug 2021 at 23:21, Miquel Raynal wrote: > > I am not sure to follow, above the software says "3 corrected bf" while > > Due to the status being "between 0 and 3 bitflips" I think it'll > basically report 3 most of the time. > As a refresher we seem to have a status for 0 - 3 flips but ok, 4 bit > flips but ok, and >4 flips no go. > In most cases (0 - 3) the driver is reporting 3. > > > 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? > > Here's a complete log of erasing the page then flipping all the bits > in the first byte. > > # flash_erase /dev/mtd0 0x8000000 1 > Erasing 128 Kibyte @ 8000000 -- 100 % complete > # nanddump --bb=dumpbad -s 0x8000000 -l 1 -c -p /dev/mtd0 | head -n 10 > ECC failed: 0 > ECC corrected: 6249 > 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 |................| > 0x08000070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > # nandflipbits /dev/mtd0 0@0x8000000 > # nanddump --bb=dumpbad -s 0x8000000 -l 1 -c -p /dev/mtd0 | head -n 10 > ECC failed: 0 > ECC corrected: 6252 > 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: fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| How is this result possible? You are dumping with the ECC engine enabled, it reports 3 bf (meaning that it is actually running, at least the software really thinks there is an on-die engine enabled) but the data has not been corrected. I expect the first byte to be 0xFF after correction. Only with -n (raw dump) we should see this. > 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 |................| > 0x08000070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 0x08000090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| Thanks, Miquèl