Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3651891pxb; Mon, 24 Jan 2022 14:29:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqgKtG6Aze3aE380os3m8A14iwk+GI46JETkzo8nE7EFw+RUp2pQ6ukyJYtieOf20MTUAb X-Received: by 2002:a17:902:dac6:b0:14b:51c2:5d8b with SMTP id q6-20020a170902dac600b0014b51c25d8bmr6293100plx.78.1643063342187; Mon, 24 Jan 2022 14:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063342; cv=none; d=google.com; s=arc-20160816; b=0ip193+08gi0ypx2NhZsk3sasMsMY6gbcoL8smN2dKD+6qjUnGuchH84CSmPBAz4nx rk0oK8eGx6NQMq0O/WIRFT1r5i4Oxn06LlVYzKxtdtaI8GXzt66eCTu4QaPOpCzndRoW qJ354M19H7kMczr8GOj/e3Eq+VtMWeo5KgBLnbH/fKV83+X6XFol1YT5oX3dYHVUSnmM +lT/L30sAg3W/CwbGY5y9Oe1mEshhFKoAagfhRsWXnvtBC+sLHHQwOn3sOlLM6XK8hAS GLu5sMfOKyv7GN6i79mgckDCEsft+ngYOaYpdH9Tk90m5J8SC84kBUo0qC8LiPAPY97J nybw== 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=FMSho4EYLNDl0x4iMJCSzgOOPY4VuheMcL1Ex8mwKD0=; b=XVTawS6/wvttig7gYPPqnP1izXmnRV+f1sx8c/S2W4ty9lBxllcLP5/U0nG0FMTNSh 0ox6ZLbZwaN9O5GX3KbNIE+XL/VA/w/25r2vFeoF/Ur6M3dxMdeodQnmrHWm7C7xHkUK dfUljPrw1sudASP2qfoBZU4Ol119MM9tME7C6y89qj2cQB11NCrsEQmqmnpgXvzy46wT 5AfNOPnV9WgbnWDE5AcbYivP962dQTb8yoxOj7ME880Nydv+CYNSEHFYc+k3eKwV0qpa 5F3It/lSt3B+BACkjqxQS8jKgoRWP6t7ccVNCWGLesLMAx8hgKxIjwveWRu7udAU/alb s4kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SRT59O+H; 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 n6si16692204plh.1.2022.01.24.14.28.49; Mon, 24 Jan 2022 14:29:02 -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=SRT59O+H; 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 S1345230AbiAXWQo (ORCPT + 99 others); Mon, 24 Jan 2022 17:16:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390879AbiAXVM6 (ORCPT ); Mon, 24 Jan 2022 16:12:58 -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 80549C06E002; Mon, 24 Jan 2022 12:10:27 -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 48107B811F9; Mon, 24 Jan 2022 20:10:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EECDC340E5; Mon, 24 Jan 2022 20:10:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055025; bh=zzKbzuFubpHHemI4OYJIDmPJ6QVU/JspdXhTqkh54ZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SRT59O+HW2rYu92XRhkzAR8MOLEETkFCHsaKioSykMF2CJnAMF6I7F8GZrCqF1AQC jFl3rlHXlg7Q5dWTOG8aVzSy17x++u/GJlnYyax1LWDOaJyFOMp8qYXHmrevmvPm18 1De1OMsbhcWzbEHngCsWc47E+Y1rvxW3QrYYsDfA= 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.15 017/846] mtd: rawnand: davinci: Avoid duplicated page read Date: Mon, 24 Jan 2022 19:32:14 +0100 Message-Id: <20220124184101.509750050@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 9c9d709965385de5a99f84b14bd5860e1541729e upstream. The function nand_davinci_read_page_hwecc_oob_first() first reads the OOB data, extracts the ECC information, programs the ECC hardware before reading the actual data in a loop. Right after the OOB data was read, it called nand_read_page_op() to reset the read cursor to the beginning of the page. This caused the first page to be read twice: in that call, and later in the loop. Address that issue by changing the call to nand_read_page_op() to nand_change_read_column_op(), which will only reset the read cursor. 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-2-paul@crapouillou.net Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/davinci_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c @@ -401,7 +401,8 @@ static int nand_davinci_read_page_hwecc_ if (ret) return ret; - ret = nand_read_page_op(chip, page, 0, NULL, 0); + /* Move read cursor to start of page */ + ret = nand_change_read_column_op(chip, 0, NULL, 0, false); if (ret) return ret;