From patchwork Sat Dec 23 13:42:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 10131605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5BC2F6037D for ; Sat, 23 Dec 2017 13:43:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CCB62952D for ; Sat, 23 Dec 2017 13:43:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E3AD2956C; Sat, 23 Dec 2017 13:43:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3D5322952D for ; Sat, 23 Dec 2017 13:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=oav3pxOPWO/MhUl60K0Gv125YysIaAy1OqJmziDHZj4=; b=k9yli6WpGS/IKB Oi0flOOqVVhnsid+6V21cz1oWpueYttyIma1fyCrspCHWfDRvDFcYgxvnYeu1TYWCpXV7ADkz1s8f fsqKT4G2kqdNRncLaUy7PyrbH1WxKIZKk2Zjf74PpyOBEY0B9wRdGeRKJHatrk5BGXt9fuZZCCybL 8EoexYv1sqH+vWYc1SLEL0Xt8HqVG1rqXMLhUSONUkI2oDXaydgRy7vtAjiDrbhG/aZWiSjB2oR2/ MpFqWFsT0PadGtbJLiYV/XtDYYc5wt8WcpKuDC0D4N5hxaaqSeq7gXNxD178TtmjMZxuDMPiBKGJV 2M44V5ycV/EiDojCPGwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eSk5O-0001YF-4R; Sat, 23 Dec 2017 13:43:34 +0000 Received: from smtp04.smtpout.orange.fr ([80.12.242.126] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eSk4f-0001MH-3h for linux-arm-kernel@lists.infradead.org; Sat, 23 Dec 2017 13:42:53 +0000 Received: from belgarion ([86.201.132.185]) by mwinf5d80 with ME id pRiM1w003409fna03RiPp1; Sat, 23 Dec 2017 14:42:35 +0100 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Sat, 23 Dec 2017 14:42:35 +0100 X-ME-IP: 86.201.132.185 From: Robert Jarzmik To: Miquel RAYNAL , Boris Brezillon Subject: Re: [PATCH 00/12] Marvell NAND controller rework with ->exec_op() References: <20171207201814.30411-1-miquel.raynal@free-electrons.com> <20171214070930.0b885f6d@bbrezillon> <877etkecig.fsf@belgarion.home> <20171218092535.2ca1fe13@xps13> <87y3lxccr7.fsf@belgarion.home> <20171220224121.2cb6f690@bbrezillon> <87lghucykr.fsf@belgarion.home> <20171222222441.0fd77df9@bbrezillon> <20171222233730.68d9cb9d@xps13> X-URL: http://belgarath.falguerolles.org/ Date: Sat, 23 Dec 2017 14:42:20 +0100 Message-ID: <87k1xdblxf.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171223_054249_840407_32BF0B23 X-CRM114-Status: GOOD ( 24.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mtd@lists.infradead.org, Brian Norris , David Woodhouse , linux-arm-kernel@lists.infradead.org, Ezequiel Garcia Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Miquel RAYNAL writes: I removed a lot of people from the recipients, as this is a debug session. >> > Now I get a lot of these message which I didn't have before : >> > [ 26.897372] ubi0 warning: ubi_io_read: error -74 (ECC error) >> > while reading 126976 bytes from PEB 242:4096, read only 126976 >> Looks like a mismatch in the ECC config. Can you check the ecc >> strength/step_size in both situation (old driver vs new driver)? > > For that, you might want to add traces in marvell_nand_ecc_init() and > marvell_nand_hw_ecc_ctrl_init(). > >> Could you also dump the NDCR register in both cases? > > NDCR register (as well as NDCBx registers) will appear if you let > > #define DEBUG > > at the beginning of the driver. > > Also, can you please give us the entire dmesg (I mean the boot, not the > flow of UBIFS errors of course). Here it comes in [3]. I suspect the BBT parser here, here is the extract that _might_ be relevant: [ 3.372907] nand: ->exec_op() parser: pattern not found! [ 3.378445] marvell-nfc pxa3xx-nand: ... repeats many times ... [ 3.666571] Bad block table not found for chip 0 [ 3.671368] Scanning device for bad blocks [ 3.675540] nand: nand_do_read_oob: from = 0x00000000, len = 64 [ 3.681688] marvell-nfc pxa3xx-nand: [ 3.681688] NDCR: 0x9d079fff [ 3.681688] NDCB0: 0x000d3000 [ 3.681688] NDCB1: 0x00000000 [ 3.681688] NDCB2: 0x00000000 [ 3.681688] NDCB3: 0x00000000 [ 3.700570] Bad eraseblock 0 at 0x000000000000 My configuration is : - make zylonite_defconfig - apply patch in [1] for arch/arm/mach-pxa - apply patch in [2] for drivers/mtd - run the test (make zylonite_defconfig; make; do_the_test_with_jenkins) That should give you all my setup information, ie. platform_data, ECC and BBT settings (ie. the "MBBbt0" pattern). Cheers. diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 0534949d63f6..d247ef01dc62 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c @@ -378,6 +378,8 @@ static struct mtd_partition zylonite_nand_partitions[] = { static struct pxa3xx_nand_platform_data zylonite_nand_info = { .parts = zylonite_nand_partitions, .nr_parts = ARRAY_SIZE(zylonite_nand_partitions), + .flash_bbt = 1, + .keep_config = 1, }; static void __init zylonite_init_nand(void) [2] Patch for mtd diff --git a/drivers/mtd/nand/marvell_nand.c b/drivers/mtd/nand/marvell_nand.c index c618ccb22a61..957219e7c23d 100644 --- a/drivers/mtd/nand/marvell_nand.c +++ b/drivers/mtd/nand/marvell_nand.c @@ -7,6 +7,8 @@ * SPDX-License-Identifier: GPL-2.0 */ +#define DEBUG 1 + #include #include #include @@ -2480,6 +2482,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc, * in the DT node, this entry will be overwritten in nand_scan_ident(). */ chip->ecc.mode = NAND_ECC_HW; + chip->options |= NAND_BUSWIDTH_AUTO; ret = nand_scan_ident(mtd, marvell_nand->nsels, NULL); if (ret) { diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 469220065b8b..0beed1cd58b3 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -27,6 +27,8 @@ * */ +#define DEBUG 1 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include