Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10379356rwl; Mon, 2 Jan 2023 01:16:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXsopSgOmMj6DmEMtiombq8PMqKYm8boGc3yCb3GcSDYQ3YUADjLDwUbxooJO03iKkDa+hnY X-Received: by 2002:a05:6a20:7d95:b0:b0:1051:2a96 with SMTP id v21-20020a056a207d9500b000b010512a96mr63465849pzj.57.1672650982295; Mon, 02 Jan 2023 01:16:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672650982; cv=none; d=google.com; s=arc-20160816; b=TlmeHVuSZgCHdnmVdvtt5rbg0J3ZABarIxWcBfuRi0Y9nRzGfZHY5ydtrr+b/xcrmx loamz+ZIOK0xcz7AegN9zi/IjYRVC4Ojout7LWoqVrjjgW9WwBGN1YACMnXPqSU9IMpn oOrlmnY8CGNDFAQz63VuoNcwrEXCIo7w7ghYXIYUPSHx7mqRIv7VdMFiBDO2v/EU6Gzk ESuUtscXuPpZKmAA+tLDF88Kwxr4l5XSLArdLmNWKThWS+oNNXboeEW5ecjLNKtOn8iC FNMCqj40DqLfivaQmaaeUKkYYOwkxxaZgqtsOcADsR4r393u5sl7j90tznqMEHOub/C8 mr3Q== 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:dkim-signature; bh=NXQ+pbiHmlKkDQiTKOKup65uhul5WhrNqTkDGnhL3Ks=; b=vbW8teW60+3J682zTfvHVC1k4JbO8btRH+c/iGQdSJytAjCU6I5O8CNlFRUtbUAp6e AtL2O4kkBKxpP8CEdcxEW24XuOlwQLiltkeOCl3cXVC3Ytqvf0vbd9Tch+2vBEvBqEju tuZFfsRe8M+BHDbejPkP+nvvogb3D3INjMo1T1pUjHmkZv15CSqEc2lPteOnYSMqgmqd 99tlilJXKF/TjypWNRGHpQEuxznoPerADC1aWKi+LyCYTeHarnp68cPioAlAhhbDSudZ dROfkhSIuCuGQeBGbffG5aeOVP+7y/KIOU8mMiBTZZBXGsUGjBrRY26Z8+mnFWXlL22v RRfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=piVyYKp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h128-20020a636c86000000b0043c05df34c0si29800874pgc.411.2023.01.02.01.16.14; Mon, 02 Jan 2023 01:16:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=piVyYKp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231706AbjABJLi (ORCPT + 58 others); Mon, 2 Jan 2023 04:11:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjABJLg (ORCPT ); Mon, 2 Jan 2023 04:11:36 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E38AA10F3 for ; Mon, 2 Jan 2023 01:11:35 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 0DF451BF20D; Mon, 2 Jan 2023 09:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1672650694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NXQ+pbiHmlKkDQiTKOKup65uhul5WhrNqTkDGnhL3Ks=; b=piVyYKp58Y0GOM3O5GKe8o4UOClqfub66InYZ5XpJbqjQ1CFEO2eLu8zEUECeUIELx8HEG Xsxrgsl/3SRu2wFFFiJGKpLlnjQ+V7yUHb51LT4XE+HMbhalqwcE+bWVFxg1IKBxxyuRl8 UJpnmlsWyR58uiGSHpGaPIrghiAvfqyqy+YobwHk2ffW4X5us09LxVMe3aP/SBY5DAWxUd 8A8BsQUgzQOG5v5aXjXogw7Q7TcwRChdXimH4SLEoGmuokyzwJWP3cis2YT1dw0lUU+cQl uNIK2caufx1Ho6doVbvpJ3zATKCR1tU0fc0ThzYEpr5FMvlx1pNrgGYRj6Q2og== Date: Mon, 2 Jan 2023 10:11:32 +0100 From: Miquel Raynal To: Samuel Holland Cc: Richard Weinberger , Vignesh Raghavendra , Chen-Yu Tsai , Jernej Skrabec , Boris Brezillon , Brian Norris , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH 4/7] mtd: rawnand: sunxi: Fix ECC strength maximization Message-ID: <20230102101132.66aa1a1d@xps-13> In-Reply-To: <20221229181526.53766-5-samuel@sholland.org> References: <20221229181526.53766-1-samuel@sholland.org> <20221229181526.53766-5-samuel@sholland.org> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Samuel, samuel@sholland.org wrote on Thu, 29 Dec 2022 12:15:23 -0600: > This is already accounted for in the subtraction for OOB, since the BBM > overlaps the first OOB dword. With this change, the driver picks the > same ECC strength as the vendor driver. >=20 > Fixes: 4796d8655915 ("mtd: nand: sunxi: Support ECC maximization") > Signed-off-by: Samuel Holland > --- >=20 > drivers/mtd/nand/raw/sunxi_nand.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sun= xi_nand.c > index 1bddeb1be66f..1ecf2cee343b 100644 > --- a/drivers/mtd/nand/raw/sunxi_nand.c > +++ b/drivers/mtd/nand/raw/sunxi_nand.c > @@ -1643,8 +1643,7 @@ static int sunxi_nand_hw_ecc_ctrl_init(struct nand_= chip *nand, > ecc->size =3D 1024; > nsectors =3D mtd->writesize / ecc->size; > =20 > - /* Reserve 2 bytes for the BBM */ > - bytes =3D (mtd->oobsize - 2) / nsectors; > + bytes =3D mtd->oobsize / nsectors; I'm sorry but I don't think we can make this work. This change would break all existing users... > =20 > /* 4 non-ECC bytes are added before each ECC bytes section */ > bytes -=3D 4; Thanks, Miqu=C3=A8l