Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1398884pxf; Fri, 26 Mar 2021 07:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPpJGUkpXSjepbflCLF8vRBTLhs9iyK4sT4OEoab3Mx5UG0GaCBxvkuqDHI3xXzjBWlIqU X-Received: by 2002:a05:6402:22bb:: with SMTP id cx27mr15190742edb.148.1616767892964; Fri, 26 Mar 2021 07:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616767892; cv=none; d=google.com; s=arc-20160816; b=v5RvXYqLG0Iz43naPP1UD+EbWQgdN0FpsyYPdMl/amP3BN/IixCCE8TUvOcWTHNchJ kqmbKYToC91vMhuzzEq8QerrSiKRDmKlhcpOQro5gJntzhClpCtPp/8Jd4tNswmqx9Ms jEkRKsUNFOcytXYtGOeChs2gPywjri5jTpQV9wLhQywPDZ4Y+ag2GlJ7B7R7ZJlAe+aQ 78qjOYkCbgUde5OWztKc0+QPMEJufOxP/74Lq+ocJOb5PZd/UjT/Weg+idytBAl+VLsI lqV5i/Oe5isH9l11SC7nGLLZgXGU9/osd8cOFPesZch69ztdEYI841nbk5kLceOaMlLv kI0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZzjZseiEUmTZfFHAmjQMrOVkpZ6x0+tzMj08xpQ6yq0=; b=kSv+FEgiiLLplKh1qlnpXYPuFJIiRv0A6qdYNh8O2ZqXhmXFvf1zpzgOlfF5ZSaWDR w1KfvCRYnFOotC7Z6AfXZIfEVmuuAwfXAC+atJnogCTnmdqmBa1KHhZ5OAz1T+ClI1wI ZwG16c2XdzDO9FpJTlkUJUt/htNE+yihN1STHIIwJaY34N9kgGb+FSpxBGSIT8PKsVap KId4WJW5toNnX/CMfIJO4El+Nid7JGeUuIrGwBrm20lB2wL3dMjKZXaqfujuuaiFOmUi bVKFDrVU88tHjPpVuV5uYulddxpf49vrl6pf9eSu27f9stIhSAmlsRodfaCUT9etPl3N ws2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@0x0f.com header.s=google header.b=KVheVgeJ; 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 s17si7107069edx.88.2021.03.26.07.11.10; Fri, 26 Mar 2021 07:11:32 -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; dkim=pass header.i=@0x0f.com header.s=google header.b=KVheVgeJ; 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 S230209AbhCZOKM (ORCPT + 99 others); Fri, 26 Mar 2021 10:10:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbhCZOJl (ORCPT ); Fri, 26 Mar 2021 10:09:41 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 611D3C0613AA for ; Fri, 26 Mar 2021 07:09:40 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id 7so5283640qka.7 for ; Fri, 26 Mar 2021 07:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZzjZseiEUmTZfFHAmjQMrOVkpZ6x0+tzMj08xpQ6yq0=; b=KVheVgeJgZecx/FFd5VWNdrlusRUfZqjFCSCFNU+yEWLfZDDkzrUQw4D5mfROjl+cJ VAtacQfxoWUP4cQIHd4CH8zpMIlRrg0p/ciswCFtEFfHL3Ftcp5vad+NiXJ/dWBLJU0k 9DVjbh+S2Oa/rBKWybpZ2Ec+hCvJ9U2M46q/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZzjZseiEUmTZfFHAmjQMrOVkpZ6x0+tzMj08xpQ6yq0=; b=Bw+hSCmmx3uTykyRG0PliOCRIxXiySYpxbpBqbZVztISGQarC9IpMKJHiArlMKYGCG UUhR+/8IUUQ0l9vm9xe+7yi7VeK+L+Y5nkqXEWV4xB62uyvBspDS4kYueDxNMTW3Dp13 6CqmyPH0lbl2cbObhOirjqh1aTQOKeCuaX1OxNEByYET6RQld5ln+vbn7QBrjoA0z08H A0Zhv0GW4Vzrog6TliYjw2w3wl7k9Gkp7dhObO0QXs7InZifX9meOKyFAJv/ativcE0p LeQzP9AVdffhfv3ZiqMKOR33Enqc0v+eu2Gp8x8GrM4Cmyj7CDiLGRSp6/XembBXcwrw 1TFw== X-Gm-Message-State: AOAM530xAg753zN9wIVhNaeQ4BM7XDfs9+mKB8ag53H1f5pH2tJLrqdA PSblEUijJefM9Dmp8qAtCOVjLlErgIwi58GE7ZQNAg== X-Received: by 2002:ae9:f70a:: with SMTP id s10mr13328039qkg.468.1616767779533; Fri, 26 Mar 2021 07:09:39 -0700 (PDT) MIME-Version: 1.0 References: <20210213095724.3411058-1-daniel@0x0f.com> <20210215112409.1a755bf0@xps13> <20210215121653.4edd86c4@xps13> <20210322193213.18520b9a@xps13> <20210323113233.3523d66b@xps13> <20210323150603.6b942a60@xps13> In-Reply-To: <20210323150603.6b942a60@xps13> From: Daniel Palmer Date: Fri, 26 Mar 2021 23:09:28 +0900 Message-ID: Subject: Re: [PATCH v2] mtd: spinand: add support for Foresee FS35ND01G-S1Y2 To: Miquel Raynal Cc: linux-mtd@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miquel, Sorry for the constant pestering on this.. On Tue, 23 Mar 2021 at 23:06, Miquel Raynal wrote: > > # nandbiterrs -i /dev/mtd1 > > incremental biterrors test > > Successfully corrected 0 bit errors per subpage > > Inserted biterror @ 0/5 > > Read reported 4 corrected bit errors > > ECC failure, invalid data despite read success > > This is not a valid behavior. There is something wrong with the way ECC > status is read/retrieved. The read should indeed report 4 corrected bit > errors, but then the data should be valid. Here it means that the > introduced error appears corrected but in fact is not. > We need to understand what status are available and write the > appropriate vendor code. I looked at the datasheet again and the encoding for ecc status seems a bit funky. The chip seems to have only two bits for ECC status with this encoding: 0 - Read success with 0-3 flipped bits. 1 - Read success with 4 flipped bits. 2 - Uncorrectable. 3 - Reserved. This looks almost the same as the Winbond chips with 0 and 1 being successes but with no totally error free status. Anyhow, if 4 bits were corrected is returned for 1 then nandbiterrs reports "ECC failure, invalid data despite read success". If I return 3 bit errors for 0 and -EBADMSG for anything else nandbiterrs doesn't complain anymore but is this right?: # nandbiterrs -i /dev/mtd1 incremental biterrors test Read reported 3 corrected bit errors Successfully corrected 0 bit errors per subpage biterror @ 0/5 Failed to recover 1 bitflips Read error after 1 bit errors per page When running nandbiterrs the status is always 0 before injecting the error and then sometimes 1 and sometimes 2 after the error is injected. Thanks, Daniel