Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp711986imj; Wed, 13 Feb 2019 16:17:42 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia4V4YAQEKo6vSLRwobL4MRFZxo5uTgpaj0gvciZ5NUSEf1fxqbmWojmXxuP5ySVIQrh8hf X-Received: by 2002:aa7:81d0:: with SMTP id c16mr913621pfn.153.1550103462152; Wed, 13 Feb 2019 16:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550103462; cv=none; d=google.com; s=arc-20160816; b=ounBJAfbkt5C2sDd4S7lz5DoEEMjqxyRMCamrU3pfg4WA+fvJ3ygwCiFCafTeTB0MC RZ613+mFSyzH5JXaQmOKXt8yR2s9Lrya0KciYKqFsb0tJuuejEkmemuehxr7f9Ao4T+K RAZfVdHbyxSqrCnFI1ZaxX4geGxeaukMccsQvhPV/K1tSJwwOI2yatEeFtL7rM5+fNRy 9b9eP37lTq2QfxqirQE3jenTSIesJ8WVRvaCz+jqEswkvHUWCBq9R7dIlT6rEf7tWpUF Cq+K9R7DaL7rLhcF0DeU6CvhJJnoNCyXL5uAx/t2/w1eU1lgyXQk2ZmaPfyt1CHxagsg 9v2w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3J6A900lxezlq7J2wC9SwXd8Um18es4VGYD9BMl3WgY=; b=Dy6mIWophBC4jkTrwEWaEIUhVksoYcNdQAh0BfZiSX/NYVZpd1LUw2xf7AmgHWzcn+ eVUjYrMVzqLLjj0JPgBAQgzpRl/4LjEAMmrBvyp9a1M5XuZUVbuKUU8NcqfJUodinokM pctGgifBWVY5M4MfPEZPe74DYxgRGQpAWlFuzhX6LKAWnejz88wJclsMaH7QwsaYutBw kpVxGDS3TN2oRX1tTkIPJwTmxseVcXxDibBUPCHYUcAfSSyAgEaCRsYr59y1B1Wt8Q0d S269u85XrGci3o7oFJBLL0dYeqI1kNG5f6a9pqEgY5rZGUXGUOIA08+itwKtYCHm9u4U I9Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Qd9nJsq3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s73si738576pfs.54.2019.02.13.16.17.26; Wed, 13 Feb 2019 16:17:42 -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=@kernel.org header.s=default header.b=Qd9nJsq3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406174AbfBMSpJ (ORCPT + 99 others); Wed, 13 Feb 2019 13:45:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:43812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394050AbfBMSpH (ORCPT ); Wed, 13 Feb 2019 13:45:07 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 981AE222D2; Wed, 13 Feb 2019 18:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083506; bh=yK1jJ3AlcXZuxSxDjpMD1WJDFLUcILu6u+5s54Ub8cU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qd9nJsq3/UX5d89Gog6l1JftHtuugwkn9OgpUV5HJOjtckMIgZYKtmJNq+EjZ3xaD Na8cYo1KNvshzQn8zdU7uq8FWVbxlJuPYfH64D1CSDGrhv3+9/IYt043ArDruhMvIi IYdPK80w2AvMqCFpvxqJ9RuM4M0XgycfPSrBgNlE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manfred Schlaegl , Martin Kepplinger , Miquel Raynal , Fabio Estevam , Han Xu , Boris Brezillon Subject: [PATCH 4.20 04/50] mtd: rawnand: gpmi: fix MX28 bus master lockup problem Date: Wed, 13 Feb 2019 19:38:09 +0100 Message-Id: <20190213183656.139258050@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213183655.747168774@linuxfoundation.org> References: <20190213183655.747168774@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Martin Kepplinger commit d5d27fd9826b59979b184ec288e4812abac0e988 upstream. 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." Fixes: 6f2a6a52560a ("mtd: nand: gpmi: reset BCH earlier, too, to avoid NAND startup problems") Cc: stable@vger.kernel.org Signed-off-by: Manfred Schlaegl Signed-off-by: Martin Kepplinger Reviewed-by: Miquel Raynal Reviewed-by: Fabio Estevam Acked-by: Han Xu Signed-off-by: Boris Brezillon Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) --- 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 *thi /* * 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_da /* * 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;