Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp809934rwp; Thu, 13 Jul 2023 01:03:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmhN9Mb7OMBDn7+RhNh0ZyI6Q3k74hGM1qhBgUBtRz/A7XSaXwnnqNE5gQfa5vImP90ubw X-Received: by 2002:a05:6358:918e:b0:12b:e47a:8191 with SMTP id j14-20020a056358918e00b0012be47a8191mr230075rwa.16.1689235427231; Thu, 13 Jul 2023 01:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689235427; cv=none; d=google.com; s=arc-20160816; b=o4nFqikYRewYQyj2CF2lBVi9HgG+arVVEq0Tw95kY/S54bcnWkjh7kwjm8bEmOUJ2i /xE1QUgS4FZbRqRPCfGfAesamKFhOjddGFkM7gcOtnU0LG7lOpIskmDOEF+inW6MT97P yHVRFwoCHWrdXemZGaV3rBuwXFMOODvks0IeYFK+UpI6UU84gc6KAubRz7pw/UiWJJTz oTsMJ3bmUHxRVuFqkmMnWdVk152Y5JxrM5C6We8KKrVTf2/1Y3kVA9qf+xeCO1cw912y m77NqYFNsB1swkmhEbsNXkBuFmRRk0Mn5O+ek7H0Jd00r/1ul5fLn9cxkBPPn/EzMYc+ q+Zg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XgxUjxWYaES9J/u7KyH5WhMtdN6ljfnBaRxicp8S6UY=; fh=0fHZr+7yLcuh6qFPfrCosMSmGOViBh+vQFcHVaDy68k=; b=X6FyKgTT4pOywB26TTZERn7Sd6zZmYvlzW3y3ATG/wzv+cVu7rYmXA9Yme3KHb/Chu DKSWXkHHFTj3LYRSyF2kPExpRbzSkc+OcxBOQSnH9Qor4eCREFJSYOCjXSXx6xEHPxlU wnfdbW0jfRkFszIO1/4iq2ftBK9z8tCXnHm0R+2huQy8+9v2SGFYronbGh5s6lgXZmpf gmxw4gOO3o7vMU6hv3BdKIEvinVuvyhMFCwyR+Oq5bo3D6s5pXzZi1Fk5JN0Txg1AnA3 RPHIfQXUGLunSHFFnfHIZWjYzLpHJh79JLzPmmZKdrenpw5Gt/R+/GDJ2Or18JpO8r1y +sjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lz+a+PkG; 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 e24-20020a656798000000b005533cf1fdbfsi4816097pgr.629.2023.07.13.01.03.32; Thu, 13 Jul 2023 01:03:47 -0700 (PDT) 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=lz+a+PkG; 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 S233721AbjGMH7L (ORCPT + 99 others); Thu, 13 Jul 2023 03:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233418AbjGMH6f (ORCPT ); Thu, 13 Jul 2023 03:58:35 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED369211F for ; Thu, 13 Jul 2023 00:58:33 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8B1142000F; Thu, 13 Jul 2023 07:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1689235112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XgxUjxWYaES9J/u7KyH5WhMtdN6ljfnBaRxicp8S6UY=; b=lz+a+PkGSLThvtWT9tWmOR0dk/jDrDCdJO+LZfme7Ee+yf38vGGi3+Y55nxcLFgzStjCRA SAgU4ErCTN8XUEPG44r7QN4p7af0fmP38ErI4NqU42mj/ySFPWmQ0vC8BXrbMpBAaEeut9 2V4iNfjtjKoaLyIbJX6kPk/pere5nmRkN33T0SgockNaVlauTLy96mSA2E1c8unhFlec1Q nJUiHrdoV62slBXN6lCqxKCKxvT3IxkXW2d4QrjNtHo9pZjMttopytAIFlniz7KdOPfU0g zN0qhg6Hq4t/uL2rp9C/1F/qQKEiT2sv5IfauOMw0uOOKF7gRZLnZ86u0teraA== From: Miquel Raynal To: William Zhang , Broadcom Kernel List , Linux MTD List Cc: Miquel Raynal , f.fainelli@gmail.com, rafal@milecki.pl, kursad.oney@broadcom.com, joel.peshkin@broadcom.com, computersforpeace@gmail.com, anand.gore@broadcom.com, dregan@mail.com, kamal.dasu@broadcom.com, tomer.yacoby@broadcom.com, dan.beygelman@broadcom.com, Frieder Schrempf , linux-kernel@vger.kernel.org, Vignesh Raghavendra , Richard Weinberger , Boris Brezillon , Kamal Dasu Subject: Re: [PATCH v4 5/5] mtd: rawnand: brcmnand: Fix mtd oobsize Date: Thu, 13 Jul 2023 09:58:30 +0200 Message-Id: <20230713075830.486450-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230706182909.79151-6-william.zhang@broadcom.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'60177390fa061c62d156f4a546e3efd90df3c183' Content-Transfer-Encoding: 8bit X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On Thu, 2023-07-06 at 18:29:09 UTC, William Zhang wrote: > brcmnand controller can only access the flash spare area up to certain > bytes based on the ECC level. It can be less than the actual flash spare > area size. For example, for many NAND chip supporting ECC BCH-8, it has > 226 bytes spare area. But controller can only uses 218 bytes. So brcmand > driver overrides the mtd oobsize with the controller's accessible spare > area size. When the nand base driver utilizes the nand_device object, it > resets the oobsize back to the actual flash spare aprea size from > nand_memory_organization structure and controller may not able to access > all the oob area as mtd advises. > > This change fixes the issue by overriding the oobsize in the > nand_memory_organization structure to the controller's accessible spare > area size. > > Fixes: a7ab085d7c16 ("mtd: rawnand: Initialize the nand_device object") > Signed-off-by: William Zhang Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel