Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp106685pxb; Mon, 16 Aug 2021 00:46:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5Ni7Y+8k39bJCgzzeh8jvo/Um7wAmVpzrwkX04s0u9iWsO9r9F2OD279YAZMuC9DkGPEs X-Received: by 2002:a17:906:72ce:: with SMTP id m14mr14464792ejl.394.1629099969750; Mon, 16 Aug 2021 00:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629099969; cv=none; d=google.com; s=arc-20160816; b=EYPZFqoSCoOJeiqI9Ss/r4eaBWPjTyRahaSMkGManwWussB/hVkFT4KMnitQ0A0N3m wK+FfbJYMK+ooh0SuaAKdx0ZEHFaBj6e3oaa+KnyOfIzGmO99RLH0rryPoR4l71IqGOU r/B/7KYspzBF0n7Gn0tr20ILkoWYznnKzmttaE6+T8uZkkoNlhK1SeSB7jf5irbE3f58 0QufBvWuKYahLsjsmpJFmsaAPzIYJvYRDJkdBAd/p1bOohskuOHM9lsOgI2MNkIt84Hq yumOXcR5UpwRIIXhWm/rFE/bhKtKfsY3IDknEp17zx7fgMUFTtXWsSVyTu1EV4lMBqa+ qniw== 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=XTVtJMg77WF1yzvmffG4FGC1jON78RF5ulz3B4D+t40=; b=yh+WNc/jC2oyv1cqNqvgr8kIL3nexbuZQHZeWay+7li1jAQn4bBWgSFk3r3zdCpSD6 G/+16RXvZN72zBj3XIzclb5qwru2hPE7AVO/JBlNXnNAAqQSPo139fV88Uw3KQfTE96L i4TaX5UuXR7ZiIPMVpcxMsIBx11/528yngAxhhE8sn/oSQWULDxSIsex1ApDyZORV1s3 K7/y/yUozK4fASVen50dj4FdHQsFcCg22EswP98J07tE08/YM9DDiUmtNoIRcadBL2sQ ogzelVYJoFwR4xwvSkecr+3u0ylbD/fYwAgll9mJ7elBziJ99nVrWrW1rzrnENE0Od2q VLXQ== 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 b18si9216833ejh.638.2021.08.16.00.45.46; Mon, 16 Aug 2021 00:46:09 -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 S234087AbhHPHm7 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Aug 2021 03:42:59 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:33985 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231499AbhHPHm4 (ORCPT ); Mon, 16 Aug 2021 03:42:56 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 1EC241BF203; Mon, 16 Aug 2021 07:42:22 +0000 (UTC) Date: Mon, 16 Aug 2021 09:42:21 +0200 From: Miquel Raynal To: Daniel Palmer Cc: richard@nod.at, linux-mtd@lists.infradead.org, Linux Kernel Mailing List Subject: Re: [RFC PATCH] mtd: spinand: core: Properly fill the OOB area. Message-ID: <20210816094221.28ad02ea@xps13> In-Reply-To: References: <20210617110842.2358461-1-daniel@0x0f.com> <20210806220242.4b83237d@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 Wed, 11 Aug 2021 16:37:55 +0900: > Hi Miquel, > > On Sat, 7 Aug 2021 at 05:02, Miquel Raynal wrote: > > This change looks fine, I'll use spinand->oobbuf instead of databuf + > > offset (will update when applying). > > Thanks for looking at this for me. One thing I was worried about is > why the SPI NAND subsystem worked before this change with winbond etc > parts. I didn't look closely to the history but it is possible that during the ECC engine framework introduction and the split of the on-die ECC code the behavior changed (which, in this case, is a regression). > You probably don't remember now but I sent a patch to include support > for the longsys foresee parts that have the weird quirk of having no > ECC > data in the OOB so it's all usable by the user except for the bad > block marker and the ECC status bits being next to useless. > I found this issue while trying to validate ubi + my ECC status > decoding worked. [0] Yes I remember now! > The SPI NAND subsystem in u-boot worked fine as it could create the > ubi formatting on the flash and that would survive reboots but any > blocks written by Linux would be bad on reboot. > When Linux created the ubi format it would work until a reboot as the > correct data was cached in memory then u-boot would complain because > all of the blocks were marked bad. > > But winbond parts mounted on the same board, same code etc worked just fine. > I guess the OOB is getting fixed somewhere else for other parts. I think the reason is that most ECC codes do not cover the OOB part, hence writing garbage there is not an issue (while with your part, the OOB area was actually fully protected). But it is certainly best to keep this area tidy anyway. > Maybe > it only happens on the longsys parts because there is no ECC in OOB? > > Anyhow I was worried my fix hid some other issue/broke other parts. I think this patch is legit, I will keep it. > > Cheers, > > Daniel > > 0 - https://lore.kernel.org/lkml/20210408174922.55c1149f@xps13/ Thanks, Miquèl