Received: by 10.223.176.5 with SMTP id f5csp813663wra; Sat, 3 Feb 2018 10:54:01 -0800 (PST) X-Google-Smtp-Source: AH8x227EuGMtZCc/fdaf1gTT99VPPpALwRhd6GN7a9ULJPLKqJQcbA+dVGuuMHT8j7TTF1ztvxgN X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr38008957pld.263.1517684041100; Sat, 03 Feb 2018 10:54:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517684041; cv=none; d=google.com; s=arc-20160816; b=t6BAe3f3mDPy/6z5tiRz2kfogcFVjcNuPb0ct9do4A71312FxcTEBJ7pDUY2n4C5uA fZoTcE7idHqmUHd1sDLbhXGC+ntPwbTmDieWfwWLhf3A0Ppfivthy+B6aWkHd2spevBh uzApa43j0s0WlyOlZWknftaxjHRIlyzANjpNjcUkSVcAdrmZMaYmQ6Gs3Eqk7OXYN/4T Qp7BjmCPI61k+srPC/dddCkkiMLcBejb3rELVTyjIk9X6Bc8m9HW6ZlhueCur2zK5x1i bQMIYA1PVBAp1h2TKCV2YQ+nxM7o/RWFDy+zRIIXMV35xmG/PsjWgGZhRwfSbNIWoAUe Mwbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2L7eWAHPIZH3qHV6q+ReekqBXiIOjT4iG6MI4JglfiA=; b=dKDBg2Bybkln5jw1G885a/0WAZq4d9XYUwi17Tv2Gm6I21D2ThtsRHtz95u19xH1BI 8U1kMV8SBpciMoCRxJa+0bUTjQvL+BZVWYbh7f+5sZnDB1IAfIP1jw3ziDQbr6omVecD qkmmw8oSlhE1ArDPBLrs/t345+5pxepdtQf/w+V0iqO4Dw0cTJd7KMz5WtsUFa7asGLO G2nyEo2cvLgmzs1Bn5IWDPPmldaI2OF/uQSN0iNsquZAYYtyDMC7z9LmEpIxMN5tiNN1 +JdRvtDLy2/5FTedOlS7euhgwXNOVSWaa8WHZ0KPDutDKu870kwtyCF0K68/lKfrpUQE R4Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e8pQSkqm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1-v6si2245168plg.56.2018.02.03.10.53.46; Sat, 03 Feb 2018 10:54:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e8pQSkqm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754740AbeBCSwn (ORCPT + 99 others); Sat, 3 Feb 2018 13:52:43 -0500 Received: from mail-co1nam03on0122.outbound.protection.outlook.com ([104.47.40.122]:24267 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752701AbeBCSBM (ORCPT ); Sat, 3 Feb 2018 13:01:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2L7eWAHPIZH3qHV6q+ReekqBXiIOjT4iG6MI4JglfiA=; b=e8pQSkqmzM8rs+vFhaOLk+PvrWfWYAIFZmbTzxMG237pNs3ce6J0RcyHFckDx33iJYdiZ2PRdwcBN2mk2LmJwJvTlpACCUudG+CpnaaN5eXIxkL+C15zq+w/XCttsHrw+J8vIZggliY+AZ1H5n5BuTTsS8gWXkidjlrAp3R8ltA= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1043.namprd21.prod.outlook.com (52.132.24.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:00:35 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:00:35 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Albert Hsieh , Richard Weinberger , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 014/110] mtd: nand: brcmnand: Zero bitflip is not an error Thread-Topic: [PATCH AUTOSEL for 4.14 014/110] mtd: nand: brcmnand: Zero bitflip is not an error Thread-Index: AQHTnRji0i6T04ZYnE+SRgL4oNGqzg== Date: Sat, 3 Feb 2018 18:00:33 +0000 Message-ID: <20180203180015.29073-14-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1043;6:wR6ZYK+RlpIpjidrrkdNTM+sOsusjTtIrZhQ0e77Dh3vejsVPyACZ2TnrWoKHUoE4SR/a/pppR9Gadzx1jgPI62xTRA8MtB3cPPcv0mkyjl8VHIjPu/XhjrKzGZe4+/dg74XePj8hz4WgL5+EbT/KBLIgFtb7gLP0ru8LFETgkX0mZZBBWtBOy3oL32VLXU2Cu23rNvizAddDWMunPeJLkCkUo8jkgqe8WuMbOUV/VCShNYMdrUWuQfgYcZ9HgvxswQrSvua0HELTcF7WsJbsmWA9RmiqxRFo/fybPbyPutXR8twL3gY/2Ufh+7OXVtXgRjda0tklwarOFMvr2NCqIl5O/8udpO/drGDinBxXxUlpPIB/+uOkUFym5DlU1aZ;5:NjsYapUgVjIUJY+1OIRdc8kbvgXWAFJeGAHqKj8M929ZEmGP9eMiNezYfpFWed8JHP800SE31HKT46JZphD1iWBTu35TQtSw0/31TwyBxd9kwbXiitqTiEessNYe1Fmp/RCv4cg4uq8Iy+qWUijDyTpAbLgD0gYh5JFUrUh5LCY=;24:FjwT+9ZWm1EoynGa/rH/XMQFL88f9BfZdfYiUngmfO6aTKKuyBFjweMXmYqUoO0Bs6eNVWpsivYz4m5W0TUZIqPCWkvQrT0wNmzp03OpWao=;7:TMYXdicO9OvjfrSfaiuCvyDjTkeLZoe8WS551F8SKTDj4VL9Ja0bY4OWUAcvoddTUHa2U3SyQf1FawBl+38vwb4NrOkyvm9aLWWFrVLIWmSm8TL+pF/4GM56FdRkKEgWfE+FlKXUAGzzoSohGdv69Fj0hwNSPCcJjk0DVato6QvHqvoYrHwqf7DiVUeXQu4ixzLRFenMCz5zbTj66QZOIQyD+j2Q9kkQJkatQgPyQwc5o4ZsAbzyd3760x+hVLdP x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 47c8b628-713b-4d43-7c56-08d56b3006b1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1043; x-ms-traffictypediagnostic: BL0PR2101MB1043: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(58145275503218); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1043;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1043; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(376002)(39860400002)(366004)(346002)(396003)(189003)(199004)(59450400001)(10290500003)(186003)(6486002)(14454004)(1076002)(102836004)(6506007)(76176011)(26005)(6346003)(66066001)(10090500001)(5250100002)(36756003)(6512007)(2501003)(110136005)(99286004)(54906003)(478600001)(53936002)(72206003)(6436002)(316002)(305945005)(7736002)(2950100002)(2906002)(5660300001)(4326008)(106356001)(575784001)(86362001)(97736004)(25786009)(22452003)(2900100001)(3846002)(107886003)(8676002)(8936002)(6116002)(3280700002)(105586002)(81156014)(81166006)(3660700001)(86612001)(68736007)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1043;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: dDNMxE4Y74/g9xu0tIL7UyeKxpygfjgkvEVt+3/uhE3+5aw7q0ii9faL8LcZBsrKaG7fV5VgYCfzt0C21An/bQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47c8b628-713b-4d43-7c56-08d56b3006b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:33.2377 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1043 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Albert Hsieh [ Upstream commit e44b9a9c135727f3410e029910275f40681dc8bc ] A negative return value of brcmstb_nand_verify_erased_page() indicates a real bitflip error of an erased page, and other return values (>=3D 0) show the corrected bitflip number. Zero return value means no bitflip, but the current driver code treats it as an error, and eventually leads to falsely reported ECC error. Fixes: 02b88eea9f9c ("mtd: brcmnand: Add check for erased page bitflip") Signed-off-by: Albert Hsieh Acked-by: Boris Brezillon Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- drivers/mtd/nand/brcmnand/brcmnand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmna= nd/brcmnand.c index e0eb51d8c012..dd56a671ea42 100644 --- a/drivers/mtd/nand/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/brcmnand/brcmnand.c @@ -1763,7 +1763,7 @@ try_dmaread: err =3D brcmstb_nand_verify_erased_page(mtd, chip, buf, addr); /* erased page bitflips corrected */ - if (err > 0) + if (err >=3D 0) return err; } =20 --=20 2.11.0