Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2725483pxj; Mon, 31 May 2021 09:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPOk8BUY0siS4usHTQ5nu0IeVen6znNtePT00RVJM91BwacUQd2kXxWgEV1RA75Yr+F0Ij X-Received: by 2002:a02:aa85:: with SMTP id u5mr21813910jai.75.1622477437956; Mon, 31 May 2021 09:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622477437; cv=none; d=google.com; s=arc-20160816; b=YQ3Rxm54o2yHW7WnmaNZ9AuGvujAGxlHrAHoB5wwH11S3X5167uToQlBcJuvYvdoP/ PjrVeLVs3Vq1imbcftZklievlMjYo8OnUcjobqbFtvP3/mqGhZfobVQYKOujqoJm17YJ 6+r1hvWaGMNwM1lZCIh9awl6TONQF9zRh4LpoZtVd5KR2cH3mm2GJd5wJwcv7VOr/InJ mbS9TgC3cfO6N2I+L0+Sgfm1lzUOvhtlmfgf3LLO2lnx4npkczGiCEB1Q/wgrVwIfUsF RtDGILYHU1JzhvCyl386FUNKv9+Z3gr0fYbpFlJEGaoi6glEaEkCxN3JHsCzTmdx3pyq NQ9Q== 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=xUFJz/DiZh3nDyZIClocjx0c8zfPy7B1lS66a41Iaxo=; b=VCbWi9WaCGFyCpN/LbssEfrDa1jG3jCSn8Es3TMNbAfkGRW5+hkDzyZtMVu2hoLeil kawjR7qSIp6RmUqfnvkxI/+uwpNaO4DtfXPBa6YJVxGCiJO5N5uRerygGDrWYb7wOplL HRPN7UFGdjSXrHGxMtZ2bbJJVHsObScEBOnDrk8hxsEZuWy/bX2hR1VICTgKcXJoZtP3 +97BXZOTdt40eybqjieZF4JU92+gPZNF6MkUCbXm3t05ONRK7BTEBAhNTIe6Q8hddASz +yatQpdhZxCHoKqc7gPoKXW18MUvuEEBaOwLGjpdvZdL8kisFsDKLSbPsRakZ1PEmQQ1 RwiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kQ3BuRyp; 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 l23si12926452jas.94.2021.05.31.09.10.24; Mon, 31 May 2021 09:10:37 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kQ3BuRyp; 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 S234098AbhEaQJp (ORCPT + 99 others); Mon, 31 May 2021 12:09:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:60974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232374AbhEaOhT (ORCPT ); Mon, 31 May 2021 10:37:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 549E961C51; Mon, 31 May 2021 13:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469083; bh=Yij9AYDeavoAhzFiZR7co5W/gtlRzghlzkpTvWbeV3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQ3BuRypTzzuUwgK5Fk0EDtjOqmILxPWyDQQSqwv57dWI4Km0Dnujsz6Kve2X3AtL kCbi1yZSKTCIIIjX6DdKVNESfo3EDm++VpjcHIT/cUx02XDZzNp+BzF6RaTqc1iXYn vDaxxLSw6saYxyZvU5YS1VKYcasL1pipBfX59dcs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal Subject: [PATCH 5.12 018/296] mtd: rawnand: tmio: Fix external use of SW Hamming ECC helper Date: Mon, 31 May 2021 15:11:13 +0200 Message-Id: <20210531130704.375707167@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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: Miquel Raynal commit 6a4c5ada577467a5f79e06f2c5e69c09983c22fb upstream. Since the Hamming software ECC engine has been updated to become a proper and independent ECC engine, it is now mandatory to either initialize the engine before using any one of his functions or use one of the bare helpers which only perform the calculations. As there is no actual need for a proper ECC initialization, let's just use the bare helper instead of the rawnand one. Fixes: 90ccf0a0192f ("mtd: nand: ecc-hamming: Rename the exported functions") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210413161840.345208-7-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/tmio_nand.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/mtd/nand/raw/tmio_nand.c +++ b/drivers/mtd/nand/raw/tmio_nand.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -292,11 +293,12 @@ static int tmio_nand_correct_data(struct int r0, r1; /* assume ecc.size = 512 and ecc.bytes = 6 */ - r0 = rawnand_sw_hamming_correct(chip, buf, read_ecc, calc_ecc); + r0 = ecc_sw_hamming_correct(buf, read_ecc, calc_ecc, + chip->ecc.size, false); if (r0 < 0) return r0; - r1 = rawnand_sw_hamming_correct(chip, buf + 256, read_ecc + 3, - calc_ecc + 3); + r1 = ecc_sw_hamming_correct(buf + 256, read_ecc + 3, calc_ecc + 3, + chip->ecc.size, false); if (r1 < 0) return r1; return r0 + r1;