Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4794469imu; Tue, 29 Jan 2019 07:38:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN66q0/BsuZzxskqGnseSQg0pCs3YuZaDt3aH+Gm62+nJY+rwYidRwGaHx8po6cEXNKDp6/h X-Received: by 2002:a62:160d:: with SMTP id 13mr26485728pfw.203.1548776284970; Tue, 29 Jan 2019 07:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548776284; cv=none; d=google.com; s=arc-20160816; b=vdMxf7IlC1KkNpe3vtrBq5wsMNY01v6qWoWvfPvk4FysitqQi3hpud6VcERyHlIlPV T/sFSN/eKgonoXWnlSyK0LqQ+fqOH3nb92VUWdr2OQ+Sn25uNsLr5RJy2lI/XedKRJTH H65HjT+K0LsRF9RP0aglE1x5xyaoHbYSwX0kBGLxzrul+qaSOM7vegilVD2h0J2WE+s5 fVetqevPBUgRXjPEn4RZFxcow9dfx5wrJt8MJPhjyfo9JVHaGO7CTFlQhk1VVdMyaQTz CMCWoySSg5KqQiVIjQS7Tuf9T/BmS66HTCfhwVqB9NuqkmkErhiFYth1uiLixAYu8lU2 5E4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Oau3SnqeQP3H6OmHfQzCyJdheZa4CM3SkLtMmETd0eY=; b=UsvCv6qjsXf2qS3i3EYTLjPUBY9hHsFN4YbLGOgjGIkeXMub9zzSOpkd6hr6+a9YIe 2835lqZPfUn0QVNDF1CsTHA6OXGcg+js5Ds2Q2ndsW/c2zaqqTK+QcQRf4pQ7sHoR1OZ PIvhH71h6n2a2wshWQXGw5dlmJvJ2B5QhBmoYqT1+7BZo1uLnX+9ql1Fzik83LKbWyQw tmoRJkPwgU542/DQg4+gyxwnnVaSkeD+xNa+gdtp3cYCbgRk+K79LbGSdTaK+1mPuJeE qpCigwHLwZGQdhvvQrG+7j/Vt1HiLPe0xnXOsxtrh6iESJmZBXr7mYg/GbAuyzuIKg07 4dOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=PFJf6mm0; 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=NONE sp=NONE dis=NONE) header.from=posteo.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si15669566pld.331.2019.01.29.07.37.48; Tue, 29 Jan 2019 07:38:04 -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=@posteo.de header.s=2017 header.b=PFJf6mm0; 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=NONE sp=NONE dis=NONE) header.from=posteo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728201AbfA2PhS (ORCPT + 99 others); Tue, 29 Jan 2019 10:37:18 -0500 Received: from mout01.posteo.de ([185.67.36.65]:41667 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727042AbfA2PhS (ORCPT ); Tue, 29 Jan 2019 10:37:18 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 94569160064 for ; Tue, 29 Jan 2019 16:37:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1548776233; bh=QjXLibLmjk+oqmf8FmsAQxfwBGSD24Lymh6zHDlUTI0=; h=From:To:Cc:Subject:Date:From; b=PFJf6mm0q8nlh4WxOYIQzLS95Tp/F6XdpPeeEINIOGL/YWY6WF5fbVvajUapheB1W h/HYIRlsfFnDzQgTPMdcKkNgXsSb10K96AmzEC0g6/O5KV3qXsWCfPGQLBV1yMDOuc B3Xzmt9WAkOc05GsxHISz1ENEdSQJ/SFLTC8kliWO+91E99wDl2xKF/if8mpdoCwid q/QqMJXNBvMpblu3sr9jNSzUblED5S+az8tn6efyKT/jNuzVvgqhsKiyeE7kcCMwTk 7WuOiuO4IgmNrLzTEuqJbrAGervIkIjZgisFREK+rUii+LCM/6ULSU5spTb/ydzZ5/ PCVf9lT5s7Z8g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 43prGJ191Vz6tmR; Tue, 29 Jan 2019 16:37:12 +0100 (CET) From: Martin Kepplinger To: han.xu@nxp.com, bbrezillon@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Martin Kepplinger , Manfred Schlaegl Subject: [PATCH] mtd: rawnand: gpmi: fix MX28 bus master lockup problem Date: Tue, 29 Jan 2019 16:37:00 +0100 Message-Id: <20190129153700.18717-1-martink@posteo.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Kepplinger Disable BCH soft reset according to MX23 erratum #2847 ("BCH soft reset may cause bus master lock up") for MX28 too. It has the same problem. Observed problem: once per 100,000+ MX28 reboots NAND read failed on DMA timeout errors: [ 1.770823] UBI: attaching mtd3 to ubi0 [ 2.768088] gpmi_nand: DMA timeout, last DMA :1 [ 3.958087] gpmi_nand: BCH timeout, last DMA :1 [ 4.156033] gpmi_nand: Error in ECC-based read: -110 [ 4.161136] UBI warning: ubi_io_read: error -110 while reading 64 bytes from PEB 0:0, read only 0 bytes, retry [ 4.171283] step 1 error [ 4.173846] gpmi_nand: Chip: 0, Error -1 Without BCH soft reset we successfully executed 1,000,000 MX28 reboots. I have a quote from NXP regarding this problem, from July 18th 2016: "As the i.MX23 and i.MX28 are of the same generation, they share many characteristics. Unfortunately, also the erratas may be shared. In case of the documented erratas and the workarounds, you can also apply the workaround solution of one device on the other one. This have been reported, but I’m afraid that there are not an estimated date for updating the Errata documents. Please accept our apologies for any inconveniences this may cause." Signed-off-by: Manfred Schlaegl Signed-off-by: Martin Kepplinger --- This is something we have in our tree for years and is running on production systems and I hope that this helps others too. thanks martin drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c index bd4cfac6b5aa..a4768df5083f 100644 --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c @@ -155,9 +155,10 @@ int gpmi_init(struct gpmi_nand_data *this) /* * Reset BCH here, too. We got failures otherwise :( - * See later BCH reset for explanation of MX23 handling + * See later BCH reset for explanation of MX23 and MX28 handling */ - ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this)); + ret = gpmi_reset_block(r->bch_regs, + GPMI_IS_MX23(this) || GPMI_IS_MX28(this)); if (ret) goto err_out; @@ -263,12 +264,10 @@ int bch_set_geometry(struct gpmi_nand_data *this) /* * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this * chip, otherwise it will lock up. So we skip resetting BCH on the MX23. - * On the other hand, the MX28 needs the reset, because one case has been - * seen where the BCH produced ECC errors constantly after 10000 - * consecutive reboots. The latter case has not been seen on the MX23 - * yet, still we don't know if it could happen there as well. + * and MX28. */ - ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this)); + ret = gpmi_reset_block(r->bch_regs, + GPMI_IS_MX23(this) || GPMI_IS_MX28(this)); if (ret) goto err_out; -- 2.20.1