Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4164851pxb; Mon, 21 Feb 2022 13:44:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH0ZnKYFgTuxUcnhz3ziVnrdFezwKkkg/wrSiRyzC88q52zujBZte8paOmSber7BhmrX5j X-Received: by 2002:a17:906:85b:b0:69d:eb3:8a7c with SMTP id f27-20020a170906085b00b0069d0eb38a7cmr17304906ejd.427.1645479887752; Mon, 21 Feb 2022 13:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645479887; cv=none; d=google.com; s=arc-20160816; b=WjaBzk16c6e3ZoxKq9LKST0B3gP5Tuft7saDRzE47eUHJZwno5CuM0uVHFmMV68xF+ 6/O7yrJOUcpBh13RvoDc/V7nszhXKnC0jiBm4rNtEIgcgYf5D2r/v/iaizW4c5jfsyw1 74itECx82QM+d3JmjWBoX4HdkkNHFYK1cLSS0+SFGlSC6l7q5kToeAf2kSXWWBr9ItKh KkvcDTlCGt3mVv/o/N5hLSWcFylP9JKFtkOA1d1pHJcD/hLp3PmzQM/Xf9L0hE3q5FLe C3CqWWB7/FDgP+VK+wtANcQ3e3UZEJhdVTMx9YljgV9ucJM4jZuuObWW1yT1N3JTT9vk ygXA== 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=WgNmfGolYyLc1x3IbU6dn2226SIhlcQlUwv/48EbWus=; b=jVqh4vAVtny0V57t2U31iwUZULyRMgbmcN3tp/wegKaGpTbK2FXstorhJ2MGRBLXxz zgnfdyO24P1CiJsGJ2C9NA+GqNNaHpFBML8uLbQroF2BZcsJNg7ds3NO8Z53KztzWO9o CgL+bLgyXrXjVVdJA2sQZ68/pzzaccOG/i4dY558Hdn77rsfJhTGKicbPgPBAMy26edj Uv/I/2XhZ6o/vhDlO89HwzXzhFVEMWujRzvg7EJNwGzhlTt7Cq7bpMH/w4uM3eOsaQmL v/qhYRFPEKr6MqTvY3VFfB1n/+K1/LRvSdOpvQd29dUmHvrG9ga3HlZm8VuQAF8q590d dZwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aRHd217s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z23si4586966ejx.877.2022.02.21.13.44.25; Mon, 21 Feb 2022 13:44:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aRHd217s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1348339AbiBUJLN (ORCPT + 99 others); Mon, 21 Feb 2022 04:11:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347680AbiBUJHg (ORCPT ); Mon, 21 Feb 2022 04:07:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AD1831354; Mon, 21 Feb 2022 01:00:01 -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 E02D1B80EA1; Mon, 21 Feb 2022 08:59:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E540C36AE5; Mon, 21 Feb 2022 08:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433998; bh=GCoGdk0Q4rkLsfz/uoPBeUGIW2nqAhB/f6dpFFN4IXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aRHd217szHcvuP5pBkNpamGFppH2kGhMT/P3uFNTWVRAS0VwLSyFBNDcDOzlLJ4Tx Zi/ApmClRVflEzOM8+Xh5tHQdcjmviatZk65rNt6iDkBOoS1wTG8XBw+vBN3wRcnEq 04+36m20uG1WiZ2GbQsQtLqOSyYNJo0CIvJHWxO0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, david regan , Florian Fainelli , Miquel Raynal Subject: [PATCH 5.4 58/80] mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status Date: Mon, 21 Feb 2022 09:49:38 +0100 Message-Id: <20220221084917.482949953@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: david regan commit 36415a7964711822e63695ea67fede63979054d9 upstream. The brcmnand driver contains a bug in which if a page (example 2k byte) is read from the parallel/ONFI NAND and within that page a subpage (512 byte) has correctable errors which is followed by a subpage with uncorrectable errors, the page read will return the wrong status of correctable (as opposed to the actual status of uncorrectable.) The bug is in function brcmnand_read_by_pio where there is a check for uncorrectable bits which will be preempted if a previous status for correctable bits is detected. The fix is to stop checking for bad bits only if we already have a bad bits status. Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: david regan Reviewed-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/trinity-478e0c09-9134-40e8-8f8c-31c371225eda-1643237024774@3c-app-mailcom-lxa02 Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -1756,7 +1756,7 @@ static int brcmnand_read_by_pio(struct m mtd->oobsize / trans, host->hwcfg.sector_size_1k); - if (!ret) { + if (ret != -EBADMSG) { *err_addr = brcmnand_get_uncorrecc_addr(ctrl); if (*err_addr)