Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6443178yba; Wed, 1 May 2019 12:23:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKsYy1NX7ibbbCGArBtf2OecGiWTgwXSBBg8oxpJtJVkyxmSQaXxROvjh1dfaRHpanTazX X-Received: by 2002:a17:902:a503:: with SMTP id s3mr73872611plq.16.1556738627348; Wed, 01 May 2019 12:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556738627; cv=none; d=google.com; s=arc-20160816; b=CAsZf8QYrn/qdhdY40DnznfUXeseXa7H2L2RadrU8EUOX0jMLw6GoIHw41Wayyqi2X wbZ8Tn0pLgtYRpmFp1RuPsYwlXIIZFi0ZPCvfoS3LpFWUjV8REdo42h27fDY6s2iICKr ZxZ7gaIKzb9pqAUctd/0jG3CpE76SjcEPLDyCcSItjwcFamipqY98TGPt9tDM4210HfE gDan8sdNnRDFXh5v5fEdrVm0al0fC/6UftfB0x2JOOQI118rLdH6bdaXfoOw1qHztSNr jv4VdinVAEtpfGPl71fLU0Lzw4OPPPp0rA8BrR/MRV8Qdyt8Plr6Wn+GfjUCmZDEBetN 0xHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=T7DidsTvqZaeVynddvHxxBbAAEvCO8/AfOY7nE2AqW8=; b=zgIzoWXPwMc5gQXGnJi51LuQy0QlEFkuyjblTXOT0WqscYJQ36ugXuMtnOW7MLMoDs i+YU34Imv+59osCk024DyE3pHRQqO61Cp5jjjuAPn8LK0lB4mmEEgIujh6AgHdMwMNEc PNgI9aIbH82ocKC3vgF69FOJj7x7TIri33y55rAiPk+jBZ1ct2mOb3/TYPuV9d5WuyLq OU+jsi4gDS1RMluswqmzW9uIhXeJNS0cxlP9pDS4008+BZ4niKMdCWXjCdWvQHk8nkBT ItPaEXA+/genVee87NU9OVIRegnQt9z5X0/LMDAXV6SxD5PSaMvRtKwsd2qDI6T2tcXU PHyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KHu23Ma6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si13071871pfo.49.2019.05.01.12.23.31; Wed, 01 May 2019 12:23:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KHu23Ma6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbfEATWk (ORCPT + 99 others); Wed, 1 May 2019 15:22:40 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40213 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfEATWk (ORCPT ); Wed, 1 May 2019 15:22:40 -0400 Received: by mail-ed1-f66.google.com with SMTP id e56so128004ede.7 for ; Wed, 01 May 2019 12:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=T7DidsTvqZaeVynddvHxxBbAAEvCO8/AfOY7nE2AqW8=; b=KHu23Ma6nMbPVzQb2iomiVuHbgOJlZeyOzYz7talegjesg/G2vqf5OjeHTAmg4eOE0 IE+g5ARBtPYe/hV8jYk5sqOifHKJ7YWWHQnxK/XAy0C2Sb2pE90Itd2NzyV5MGGK8ABS Jv/HChG970YtLduHqoDISBOiwMWWrO+ixat8GlM2m/GPBxUOCx0C4Er3cAWpJXIIPPhT KP5SDDDpnH25A9ZbKiPQK+qkMvrElZA25R0kUqHKFtKO/TV2+THHICcn1NSRnANQpgmF RQA51mRYKhpOx1hTiy+JhPhNpsZYkqqDaBBxm/J3go71JPj6yd2BrgULUEhwvqDh7GAG 45Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=T7DidsTvqZaeVynddvHxxBbAAEvCO8/AfOY7nE2AqW8=; b=dMBD2gVoKlos/nkZjYdndZnlieYt1D+0Oh2yqhV9GHTfakfbNhv50IkCXZqcpiOAXr MFB3UTzWcavLNFKRXWtNbSk9HkBjNXtF7OvGud2ThM/XlLYOW068Fel+Ls707fOlIe+L foqSi6VwW5kA2/GXVJh3Ub2r1eO6qAgPen1FxxtV4fkoTjNtK1EbyHtSNp2jZydawvZI wbiuYgduysR3AZVIvXpXP0JTVegWPgf3gTk8owQ7HaP1yeM2UcV3tar93aVRLSE+Rsbi 3afjT35ObPGzF8an6jq395tgLAWeLdhpo6vkqT2m3l7Jhk17D81Z0BJpeuo1blOQ4sN6 jIZw== X-Gm-Message-State: APjAAAV81qhhoDErlcge5HX5C208uaxg+WADEM6LrH6n5SISKBuycUgk hg38tUYi6/Kmf0pVSxJkJDJCXbnV X-Received: by 2002:a50:e79c:: with SMTP id b28mr9954998edn.277.1556738558952; Wed, 01 May 2019 12:22:38 -0700 (PDT) Received: from mail.broadcom.com ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id g6sm11144033edd.48.2019.05.01.12.22.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 12:22:38 -0700 (PDT) From: Kamal Dasu To: linux-mtd@lists.infradead.org Cc: bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, Kamal Dasu , Brian Norris , Boris Brezillon , Miquel Raynal , Richard Weinberger , David Woodhouse , Marek Vasut Subject: [PATCH v2] mtd: rawnand: brcmnand: fix bch ecc layout for large page nand Date: Wed, 1 May 2019 15:22:14 -0400 Message-Id: <1556738544-29857-1-git-send-email-kdasu.kdev@gmail.com> X-Mailer: git-send-email 1.9.0.138.g2de3478 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The oobregion->offset for large page nand parts was wrong, change fixes this error in calculation. Fixes: ef5eeea6e911 ("mtd: nand: brcm: switch to mtd_ooblayout_ops") Signed-off-by: Kamal Dasu --- 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 482c6f0..3eefea7 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -939,7 +939,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; -- 1.9.0.138.g2de3478