Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10784991rwl; Mon, 2 Jan 2023 08:07:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXswcFsJ4Kpvf/Qr14CUVk11FuShxgTrmLKBhA2K1I+Q7N4Ibn71VjshZpo+j9UqsXmeXkze X-Received: by 2002:a17:906:380e:b0:7c0:be5d:59a9 with SMTP id v14-20020a170906380e00b007c0be5d59a9mr38929104ejc.20.1672675635509; Mon, 02 Jan 2023 08:07:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672675635; cv=none; d=google.com; s=arc-20160816; b=DcjygLl++YBM6DxWeNDQMUuPkg+SQnCjwPkX6nIPoO2e8jWStJC2W7thpQaWGS9zJp sya3lD5Pi0u0IfJmEtRV6DyorYZZxaYNxsq6oEeWTx9S1lnPOdovIkuQwya2S6y7ZKW1 e4WwiAwlStXdlTHQ2cmEDxNqKCZEgaiUM407KIFn6REWs8fBAp+9LplSZ/CZ0HJaqQ4J 8LyuENYViu1WHzDzmHdIyLWCgUu+geS3yNkdsLW5rT0IszMPEIUYDaFW55ip6us5Gizn pBhHSZ4FhIefRB+RUfmHDf4WBPYtIgqYuhcCKuaMBC71tcf839V98/fxLBjqCAHiu8MT vtTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:feedback-id:dkim-signature:dkim-signature; bh=2+4+wGrW59MyWwPd3wsJUrFMY8syiAgC2hBl1Lb19qY=; b=eGXizi2h4n3h719QHwh27BelX6qYQXxk8Iw2JvecoPfXbMovfv1aI/D/EliEgYePVv JnlAjsttMyVnun1XCRdoaZqc9N41J2o/aUlSqUNxg0SD7xnxG3V4/gVq02g7qsNwrz1r ov9F4bAwz84P2iflm5UX8VNTLwNnQdlJ91GRTLaTye3K+0tvDcKkhXFeFnavYwjMsHNk PqRSSzTzXjNImU7jGRZoMv1l+UEbS3aFDPqgySdqWJfrErUh2675wgRlkX0vqyQBv6cR dAdY8SbF1UHO0I0xdx6T1Al3XLCTfU7hV06HpTbULYSyNKC4fB6Zd23zCj7jaCjuN2p/ dAUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=CZismstW; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=szq9xQqC; 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=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw1-20020a1709066a0100b007dbea9fb8dasi24773392ejc.641.2023.01.02.08.07.00; Mon, 02 Jan 2023 08:07:15 -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=@sholland.org header.s=fm3 header.b=CZismstW; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=szq9xQqC; 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=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236440AbjABP7e (ORCPT + 62 others); Mon, 2 Jan 2023 10:59:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjABP7c (ORCPT ); Mon, 2 Jan 2023 10:59:32 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AFC5A471 for ; Mon, 2 Jan 2023 07:59:31 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 04F445C00EA; Mon, 2 Jan 2023 10:59:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 02 Jan 2023 10:59:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1672675171; x= 1672761571; bh=2+4+wGrW59MyWwPd3wsJUrFMY8syiAgC2hBl1Lb19qY=; b=C ZismstWwRLv9F0oVlb1eOYQ60+wnig+4Qw78XhLVH1rvv1Zs9mm1mEv+iVLx+6id Z0Yf4Sd5UrLNAgwwS0P18BW0uAgFmL99EiubaHoVlVjXrv8xrFDh3xnAYBFAmost RY4exPMUHgc8HOtWkmu6hAHO6HhnE1RWTqBN53EmqAIqPALN9Kr5GcqGOzVyNidf /RJU4t8nQ9BFmNhpOHa/OTAonarpbCFw4JPuxY0c2ut7Ba1BjO05PElc7MaubLum 3naQy5RtatAFrQENwy6wA6eCfvVGirePh4L+OODbKORAS+nz+cz9m41QuMBgDBcS 9/qrNg23tvjH92JoodejQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1672675171; x= 1672761571; bh=2+4+wGrW59MyWwPd3wsJUrFMY8syiAgC2hBl1Lb19qY=; b=s zq9xQqCibpSOx5F4kL3RuqG2RNBmOzS0RBkdh1stgqg5O6SetUezK9L9tdXBi2TM Zcp6pFi63a0ajV2V/lFpSqKHpN7qwHB5VmOPjl6Ua0+mrB5nIw5mjIiOSoLG5/1Y 6gOpVXNNNjdieeTVvYC40SOBnQlKGrTpxKK9J2dhhmNXDZNwCJhk5I8AyvrOHt9o j3pW9UG02YN5IrfAmpCVl6olVeS5hGOfY3DTDybDvVcrjQ9gBGsDuJ5COQvnb5Xd vmuWyfk+5mTEVCPAc6jBUx9CqmM7Aj1XCGOehMXyx/pOfwSWnZ1Y0dRJ4urXaf1i LhJ09g5TMIJRi9UTl4jPw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjedvgdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfvvehfhffujggtgfesthekredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepgeeikeeufedvvdeuteeivdeiffdtgfdtfeejgfetfeefgeffgfdv ffehjedvueeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Jan 2023 10:59:29 -0500 (EST) Message-ID: <4207d4eb-31d5-31c0-1a7f-67ec00b63f58@sholland.org> Date: Mon, 2 Jan 2023 09:59:29 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Content-Language: en-US To: Miquel Raynal 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 References: <20221229181526.53766-1-samuel@sholland.org> <20221229181526.53766-5-samuel@sholland.org> <20230102101132.66aa1a1d@xps-13> From: Samuel Holland Subject: Re: [PATCH 4/7] mtd: rawnand: sunxi: Fix ECC strength maximization In-Reply-To: <20230102101132.66aa1a1d@xps-13> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 Miquèl, On 1/2/23 03:11, Miquel Raynal wrote: > 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. >> >> Fixes: 4796d8655915 ("mtd: nand: sunxi: Support ECC maximization") >> Signed-off-by: Samuel Holland >> --- >> >> drivers/mtd/nand/raw/sunxi_nand.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_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 = 1024; >> nsectors = mtd->writesize / ecc->size; >> >> - /* Reserve 2 bytes for the BBM */ >> - bytes = (mtd->oobsize - 2) / nsectors; >> + bytes = mtd->oobsize / nsectors; > > I'm sorry but I don't think we can make this work. This change would > break all existing users... OK, it is not too much of an issue because I can manually specify the ECC parameters in the devicetree. Do you think it makes sense to fix this when adding new hardware variants/compatible strings? Regards, Samuel