Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3691128pxb; Mon, 24 Jan 2022 15:29:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhQ7BbmFkD2DFDXzwe6OquQmoNBsaoeOS3W39qosN7LCI/gGbjg+rV/09Zx5jRgmDyncMq X-Received: by 2002:a17:90a:630c:: with SMTP id e12mr647637pjj.59.1643066961841; Mon, 24 Jan 2022 15:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066961; cv=none; d=google.com; s=arc-20160816; b=hsv8371ywrbWE3pStkxpxRaTAau0ItWV+JvcJc+C159PNwQAohafETPwE1ceHC/4ag RQqAOj6d7fGoUzYPdA234l/YeE1tGyl0z6hGuJEdPp8+/4stWUnjWIlllw8YxBu0RFBs SYAOVbHIJ+ZSGoj+7ctgsh2Mf0nGvoykBo/WiK1iK6qm20bhadsn6mqacAIju4OJAwnD 3Lhig/GB2IScu7qwoLwtpKryozb6R80FVLc5la29zP8xUd+naUOsNr09FbSfTzvh/CZV yrKIgemCG1qdHpPc4xu8hM1MIibnClwLVufol+69yop6JiWYywTUGjz+NbyZ2ybpvTEH 08mQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+Yg/ksYPvjVmN7wlt47mVjHE5F0UyGLcRL7FW0kdnTM=; b=pfQS1BRJ8Bj8k9VfmOnZeRe6W/96TSRanKWH9PzdbHZkqCPioL4xYpnHbZTkEuexpJ pl+DhP4imO8nk4JGGPlmMqxILfMnX149LnVn344htDCQAkXmEesByqMZPLO0/nlNTkiU LwK4q3alRHNw5IFFEo3nLJKma7nSf6UwkM/jpytS1LTl5HpRYO+Cths9Iu7RVYozilRl cpbddXp7mkM67WYvMaEpbh3rktjDZslygdq1VFgDrIITI7byTe/DYVL3NFirHCj/Y43Z WiBDep2XL313xS/urKJQ/9sizpHynK6lBDk1dGUE0sy0n2ifFa9t4H09adeGTamIeGWs jzqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eCU78RdK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rj13si656438pjb.33.2022.01.24.15.29.08; Mon, 24 Jan 2022 15:29:21 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eCU78RdK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1849333AbiAXXZd (ORCPT + 99 others); Mon, 24 Jan 2022 18:25:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1587703AbiAXW33 (ORCPT ); Mon, 24 Jan 2022 17:29:29 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D3B4C047CC3; Mon, 24 Jan 2022 12:55:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 44C14B811FB; Mon, 24 Jan 2022 20:55:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9503C340E5; Mon, 24 Jan 2022 20:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057702; bh=iC3yFsiXLxji/n8wtnpCQ/0JmVUjZqt5fHAV9bJWQ+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eCU78RdKvjiIRBxebQxGAVLHAkbv2982DFtSc8vRExjS7llT+4BLK3HuKCzQ0vYe9 A5RzkSo51bhX7VHgfJQTgv1Uhh9Xc6rz6prizUMOXICJXkob3KCSeocrJQm3nh1RRw o96wYBntg9MPZZVFa+dYV1yWcx/MavocIaaBWBIM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Cercueil , Miquel Raynal Subject: [PATCH 5.16 0018/1039] mtd: rawnand: davinci: Dont calculate ECC when reading page Date: Mon, 24 Jan 2022 19:30:07 +0100 Message-Id: <20220124184125.754692636@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Cercueil commit 71e89591502d737c10db2bd4d8fcfaa352552afb upstream. 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 Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211016132228.40254-1-paul@crapouillou.net Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/davinci_nand.c | 3 --- 1 file changed, 3 deletions(-) --- 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_ 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_ 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)) {