From patchwork Sun Jan 15 19:53:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 642949 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp250763pvb; Sun, 15 Jan 2023 11:53:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXtuzwecuzczLpytYEhl/Uh6OW55YzQsvc0NPrHpt9zaX4qIKdV2nDRiNo6SF9WeiiFa/7Mn X-Received: by 2002:a05:6830:6997:b0:684:c322:917c with SMTP id cy23-20020a056830699700b00684c322917cmr8172082otb.5.1673812437089; Sun, 15 Jan 2023 11:53:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673812437; cv=none; d=google.com; s=arc-20160816; b=XMEXZzkHfhvYNnAJDbA9e1QqKxUqQg8/E7P8w9KDYaOUzjs2Px4h7ai55epXcnl65W x87ct7xgaFNdQGpnU3WXg/3B3CdXM8iFvaUyzuhbgIXYK18V7LgeqKTJyPSQHUPm4MNR l3vbN5ZWhWofnRyxzR+KGXClvt+S/zO4g7/VNM8+YDSw1bnZFXhr+9iLENyipDGXT0Q6 8zuarWLewy1p/o9xOdda7Db5Xnrp4NjrfgZBs0TYPjfVk7ZSmuDWuRrIUOJcXyYgiXBc V4nu72RUydSaBXlck6y/IjJkM5DEU2mlPVicHlG1OBL18IbhVYTbeK8GxJcMjqTDVGFC B9Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=53LD8C7uZ4AzIV0L31k8fkAtCEon2JlcRQxn1+E8OLc=; b=iXfqXDi5RCAfUxrPQkQbXuoeU5h0sKCv7hxIbO/Q2ehqsLFyx/WMkPf/11x0s1UjdK IEqTUnLetX93PqI+4q5lO+xSoJznMDSruN9VlQq/0UKgz7kwavfKAjni51Ly7Dub2y6v Ux/QRsqy4Rs4Nypr2ek6BhKN78MUgT8PnGMj2zLozDWRcvkrSkt/md4iU5fgpdTpBC0x bzbsfj/NKmMwTD5p5hfh09LatozuDudfVbWOmHqnwezfS/YjThRGuPG/CbqKmzKTGI48 hVlAEbSpCHCH4Hi1dE1BE1cyL13ZtWTfNva9az0KNPxQ/wA8wqBx5ujRwFkHiYgCk2pg JrZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TTm4HqFI; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id t17-20020a9d7f91000000b00683d8a73eb1si21675454otp.120.2023.01.15.11.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 11:53:57 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TTm4HqFI; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 090428555D; Sun, 15 Jan 2023 20:53:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="TTm4HqFI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D6FD18532E; Sun, 15 Jan 2023 20:53:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (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 17149854E0 for ; Sun, 15 Jan 2023 20:53:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=linus.walleij@linaro.org Received: by mail-lf1-x136.google.com with SMTP id br9so4808166lfb.4 for ; Sun, 15 Jan 2023 11:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=53LD8C7uZ4AzIV0L31k8fkAtCEon2JlcRQxn1+E8OLc=; b=TTm4HqFI4hujB1wN5gZdl0pb9JEGH3JADnI5nJ0wSxzsU21nzQw6id7jDN6vh3eU8a odhGiGdRoWCLcf9fmP7oC1vG0z2Q53WGbWZ4b6M/XxF+fttmxukcAZOv4Q1t/V8Ve7ZE EcrwiHv/lKe6g+4etRJeSmbzqyC62X37Ett1UgIAzaFvXuoAYgzz93yR0I5to1zZmDFM 7AiMYJ0fRCGVQZTnj72Itdr6PBDxMYL7jmjbCIvZmTjCwoFdH/2OYDPhdUP+Xn4TUgoc woNqA/cpdVeZhdmTLfQvdGRu7aqgAFR0ssC3J80fUwV9J5FDArBkbemvzOdIA21nPfbu gxXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=53LD8C7uZ4AzIV0L31k8fkAtCEon2JlcRQxn1+E8OLc=; b=3HoYfJjbTRbSdXMVUn7ZWecYOp/s+nc4wMoz/FTI7AvxHNXm4v932f9uPR4xMOhfgg UdZlWOB9e7bd9ORDF74fvJUd7pcZsJrG1cic5KBSsTWFPD0DdPGCUzBqKQBcgsdDR3dT 4jRh8/pDHtjVhkwuTaAY1oxdF8fho5Hp7cfDyhie+e405VYjrUoCtqcfXGY7ehnwpv2I hLUgPRhgha+SzUdr7MwPfYcNvHaQEnIlc1wL3yUN5f02ePTKBMWvqPV8rKUw8uWWibCc aW+yk/FGyhkqPFYQafgJUAprYzh3Byz4dhlEQ4fTcJEPzwoDIfODSoDOz98sRqZSrsf9 2AyQ== X-Gm-Message-State: AFqh2kpMe5GFaJpE7EqW5dUDF5cCqU2Cl6aTM8v5KnMp4GVzzwdKj70o ERqe56gTG1cXBQRPdC8LUrrKSVhGM3NcVXza X-Received: by 2002:a05:6512:3750:b0:4a4:68b7:e736 with SMTP id a16-20020a056512375000b004a468b7e736mr22746789lfs.32.1673812410202; Sun, 15 Jan 2023 11:53:30 -0800 (PST) Received: from localhost.localdomain (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id r12-20020ac252ac000000b004aab0ca795csm4780439lfm.211.2023.01.15.11.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 11:53:29 -0800 (PST) From: Linus Walleij To: u-boot@lists.denx.de, Tom Rini Cc: Anand Gore , William Zhang , Kursad Oney , Joel Peshkin , Philippe Reynes , Kamal Dasu , Florian Fainelli , Miquel Raynal , Linus Walleij Subject: [PATCH 02/14] mtd: rawnand: brcmnand: Fix BCH ECC layout for large page NAND parts Date: Sun, 15 Jan 2023 20:53:00 +0100 Message-Id: <20230115195312.1477845-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230115195312.1477845-1-linus.walleij@linaro.org> References: <20230115195312.1477845-1-linus.walleij@linaro.org> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean From: Kamal Dasu The way oobregion->offset is derived for large page NAND parts is wrong, fixes it. Fixes: ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops") Signed-off-by: Kamal Dasu Reviewed-by: Florian Fainelli Signed-off-by: Miquel Raynal [Ported to U-Boot from the Linux kernel] Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 8ea33e861354..65aab4be87b9 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -968,7 +968,7 @@ static int brcmnand_bch_ooblayout_ecc(struct mtd_info *mtd, int section, if (section >= sectors) return -ERANGE; - oobregion->offset = (section * (sas + 1)) - chip->ecc.bytes; + oobregion->offset = ((section + 1) * sas) - chip->ecc.bytes; oobregion->length = chip->ecc.bytes; return 0;