From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DB0EC433F5 for ; Mon, 17 Jan 2022 18:36:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 385E3837E1; Mon, 17 Jan 2022 19:36:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="jN3TLBwN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F1682837B6; Mon, 17 Jan 2022 19:36:24 +0100 (CET) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 542BD837B1 for ; Mon, 17 Jan 2022 19:36:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x831.google.com with SMTP id q14so19967186qtx.10 for ; Mon, 17 Jan 2022 10:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aSjVbBeUtbEi39LDsIdKEKZDjclPh2zpjFbHNRQ0+yI=; b=jN3TLBwNNHUGbKLGX82dlK4u5lf2BqmtagHtPoZK7i2azSyjAq5dTagFbO4DkdJGYJ drEk7m0DlYAPEqjgaIFlpue/cPj5ncwpqnj4T81pnt/v8qov1kVEbTfy7xcFw8SIrdH6 jn3fNlVrjw4Vvq0BhFFi+VIlYqXDwkbSuoz6c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aSjVbBeUtbEi39LDsIdKEKZDjclPh2zpjFbHNRQ0+yI=; b=XuBMb5GXBeQoc/TMMkuv0HHuIU/ljGX80e1grK6OaFr8nRLcBm1w2EZmiL0Cpnx6Rs gUdR/beViF/ob2XjtQqCdE2Wwxeip4ukCT5M7arZKgon2EHJRIBjbWAYSBKjxVFOvsJe 0DQKkyAOD3OE/GkFx+oVlfmTfLJA6HLyeAGHxrBOcxpW9pg5yKbG6FUtD9HQBUSZv6YS cs7vkmvqEWdZvHTV/F1c3tntG65xjRMy/SnAlUwQ4FmcQTOlopD4aJaUHBabH/0S3Uji 93nbOOHL3cZmiUr4awr6fVGeFsDr/uU/XDZk1WrIeH8kgDZ+TPZRe/iVH8srMp0CR6Ch RQBg== X-Gm-Message-State: AOAM530yYiD79rhl+MdGdNEUgFJ5ytew8GAqLBDOwTTitUJDYVjAV8V4 lHP5CU/KAU3zhWRCfhdzG0goUw== X-Google-Smtp-Source: ABdhPJx29syzxl8X536Z7bryf7comBKryUB1iMf1OLIiM4bztZB6y0Z+zSmx1PqFIeLJLrepdGmuxg== X-Received: by 2002:ac8:5c87:: with SMTP id r7mr4705953qta.599.1642444579894; Mon, 17 Jan 2022 10:36:19 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-8dc3-db57-8e4a-695a.res6.spectrum.com. [2603:6081:7b01:cbda:8dc3:db57:8e4a:695a]) by smtp.gmail.com with ESMTPSA id x10sm9665653qtw.60.2022.01.17.10.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 10:36:19 -0800 (PST) Date: Mon, 17 Jan 2022 13:36:17 -0500 From: Tom Rini To: David Rivshin Cc: u-boot@lists.denx.de Subject: Re: [PATCH] nand: gpmc: Handle bitflips in erased pages when using BCH ECC engine Message-ID: <20220117183617.GT2631111@bill-the-cat> References: <20211118182524.3043611-1-drivshin@awxrd.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="djJN5oi3zFpblwUd" Content-Disposition: inline In-Reply-To: <20211118182524.3043611-1-drivshin@awxrd.com> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --djJN5oi3zFpblwUd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 18, 2021 at 01:25:24PM -0500, David Rivshin wrote: > From: David Rivshin >=20 > In the case of an erased (sub)page both the data and ECC are all 0xFF > bytes. This fails the normal ECC verification, as the computed ECC of > all-0xFF is not also 0xFF. The GPMC NAND driver attempted to detect > erased pages by checking that the ECC bytes are all-0xFF, but this had > two problems: > 1) bitflips in the data were not corrected, so the data looked not-erased > 2) bitflips in the ECC bytes were reported as uncorrectable ECC errors >=20 > The equivalent Linux driver [1] correctly handles this by counting the > number of 0-bits in the combination of data and ECC bytes. If the number > of 0-bits is less than the amount of bits correctable by the selected > ECC algorithm, then it is treated as an erased page with correctable > bitflips. >=20 > Implement similar, though simplified, logic in omap_correct_data_bch(). >=20 > [1] see omap_elm_correct_data() in omap2.c >=20 > Signed-off-by: David Rivshin Applied to u-boot/master, thanks! --=20 Tom --djJN5oi3zFpblwUd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmHltyEACgkQFHw5/5Y0 tyxuFwv+OyYRw2Okth628TGixtD7Fn0ad9+mR7UVaeES3yBczwXnQ3FsI2LEc0oH DvHajtSRE7tSISm0K0e6T8AYfftoOE7gsfftvOiocwkfdb2/o9udq4kNxxsO0EvJ e4rgJms9gva7gzBg6PJnA5HB4Cg4h6FDdSWwtQKAE932kajcHW0PTaWcspeYj2+g rTtFq91PbIJ7h5x4H0VPeSIqdk2VZdeJ12g1NTVJ+XJ8Yn7PkXXl14Nwo7cNeB4M 2vEQc+RJEO87lk6HLo4NmEZ8xRma/Z62/GgmWWPIxEedqfpSZsVd4uwskae/rTP2 15e+TjXQ32/TGJ4QE+MtXoerUoMS3sdub8iN2Vk9v3KhwnYNgSPR+lM6Bi1lfkUt zIFxt3xBFCc8Ulud6CjEd1emoMqrUVb0QJgvvF6LkqMTljnh7sYne5h2Tq80RkDy fKsuc3XZejG8yQnL5ijXixmMl77wDQYzGlQwkYEPadquA2DNjq2IsrvFJAH1FMMv irQTl3QQ =D5pw -----END PGP SIGNATURE----- --djJN5oi3zFpblwUd--