Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp8097pxb; Sat, 9 Oct 2021 11:51:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv+n7L3R80s4b8ko/qOvudn8WLGHgAoyYf1p90GehcjLKDcb2BoIDn8awfNb+YQ06QQ8kG X-Received: by 2002:a62:6543:0:b0:44c:61a0:555a with SMTP id z64-20020a626543000000b0044c61a0555amr16687780pfb.14.1633805496347; Sat, 09 Oct 2021 11:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633805496; cv=none; d=google.com; s=arc-20160816; b=qvaK9m0VXFyLKZumcsVhDXQAMnjXk+WpqfQDEctuT5ZjIJj1zssHXLI36oTZoBXwFc IyS6wi5/eOMUfB2o/EZOM2CMWAFRKAwziSeIMjwu1BHoEKAw6A0U5ztyFcvZyM2R81x8 OkEzTyhBU9GOUjhqKQ51ImbGMY9cQFn2bffX61P9s97IFFPMlK3KJv7RWQ/OQN/C6eOI nBIo6BqG71iFBozmBnRMoCM24GHLiOqH3CTZ9dbVKonINj+CsRlrxkz7NzfBfyD9EPN1 tQrFvFno7IUhBv0t6mR+FMYNMBR8fS8kHdjwj8vYqKQisS0Fe/4nY7GmvfOkM3dwV71T ol4Q== 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; bh=l4A0WIh/geRh9rbLRhIPrp9hKwSYct3lPHkcKfUHdM0=; b=yJHp67fkVemLOYR09BnooE9sTTtkMqbZtnZEUwRGB+p3O5GoN90Rcc7zwbWONlEvUx looq6mXP5ufnVVR++1u22pqxp/klonh0E6M/86STw1fuI+d9OHNqhSp9hcT/8EbZ/7Ne qHSJk/9uqEBXC8o/6irh8uANdYg/e6cMxz10eYi5S6Pts/1Dn9jZoF56Y8L57Xm08UxU eiuxQiYLkzeHSQh6EfCrEQgasLbOs6Ev62dDlKKsycOhLkHT2qogPgKgXDgynSpyCTT4 GpdBMKgICvJjJgAPT12fuLCkiYdeF5bph9/xtabgpTXqom64PQeiF0wKAtSKwKK/cAIf NkLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q13si3966414plk.34.2021.10.09.11.51.12; Sat, 09 Oct 2021 11:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbhJISwI (ORCPT + 99 others); Sat, 9 Oct 2021 14:52:08 -0400 Received: from aposti.net ([89.234.176.197]:46692 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhJISwH (ORCPT ); Sat, 9 Oct 2021 14:52:07 -0400 From: Paul Cercueil To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Harvey Hunt Cc: list@opendingux.net, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil , stable@vger.kernel.org Subject: [PATCH 1/3] mtd: rawnand/davinci: Don't calculate ECC when reading page Date: Sat, 9 Oct 2021 20:49:50 +0200 Message-Id: <20211009184952.24591-2-paul@crapouillou.net> In-Reply-To: <20211009184952.24591-1-paul@crapouillou.net> References: <20211009184952.24591-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function nand_davinci_read_page_hwecc_oob_first() does read the ECC data from the OOB area. Therefore it does not need to calculate the ECC as it is already available. Cc: # v5.2 Fixes: a0ac778eb82c ("mtd: rawnand: ingenic: Add support for the JZ4740") Signed-off-by: Paul Cercueil --- drivers/mtd/nand/raw/davinci_nand.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c index 118da9944e3b..89de24d3bb7a 100644 --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c @@ -394,7 +394,6 @@ static int nand_davinci_read_page_hwecc_oob_first(struct nand_chip *chip, int eccsteps = chip->ecc.steps; uint8_t *p = buf; uint8_t *ecc_code = chip->ecc.code_buf; - uint8_t *ecc_calc = chip->ecc.calc_buf; unsigned int max_bitflips = 0; /* Read the OOB area first */ @@ -420,8 +419,6 @@ static int nand_davinci_read_page_hwecc_oob_first(struct nand_chip *chip, if (ret) return ret; - chip->ecc.calculate(chip, p, &ecc_calc[i]); - stat = chip->ecc.correct(chip, p, &ecc_code[i], NULL); if (stat == -EBADMSG && (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { -- 2.33.0