From patchwork Thu Dec 2 13:23:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 73966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EC1CDB708B for ; Fri, 3 Dec 2010 00:28:45 +1100 (EST) Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PO98V-00064V-IZ; Thu, 02 Dec 2010 13:23:47 +0000 Received: from mail-out.m-online.net ([212.18.0.9]) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PO98S-00064B-JX for linux-mtd@lists.infradead.org; Thu, 02 Dec 2010 13:23:45 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id CAF3F1C00265; Thu, 2 Dec 2010 14:23:41 +0100 (CET) X-Auth-Info: dpmbAJNdFfP7zk+SiXQJn54tD3TNCjNGRrW7zdliKzM= Received: from wker (p4FE3E0CB.dip.t-dialin.net [79.227.224.203]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 95A9C1C00171; Thu, 2 Dec 2010 14:23:41 +0100 (CET) Date: Thu, 2 Dec 2010 14:23:51 +0100 From: Anatolij Gustschin To: dedekind1@gmail.com Subject: Re: UBIFS partition on NOR flash not mountable after power cut test Message-ID: <20101202142351.197abbde@wker> In-Reply-To: <1291292325.2526.23.camel@localhost> References: <20101129195014.19224240@wker> <20101201130534.5b95ce83@wker> <20101201164447.2215bc58@wker> <1291264926.14534.32.camel@koala> <20101202105729.04c25fc1@wker> <1291292325.2526.23.camel@localhost> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101202_082345_013311_1080047A X-CRM114-Status: GOOD ( 17.39 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [212.18.0.9 listed in list.dnswl.org] Cc: linux-mtd@lists.infradead.org, Detlev Zundel X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Thu, 02 Dec 2010 14:18:45 +0200 Artem Bityutskiy wrote: > On Thu, 2010-12-02 at 10:57 +0100, Anatolij Gustschin wrote: > > UBIFS DBG (pid 1290): no_more_nodes: unexpected bad common header at 37:157472 > > UBIFS error (pid 1290): ubifs_recover_leb: bad node > > UBIFS error (pid 1290): ubifs_scanned_corruption: corruption at LEB 37:157472 > > UBIFS error (pid 1290): ubifs_scanned_corruption: first 8192 bytes from LEB 37:157472 > > 00000000: 31181006 270758c8 0c331500 00000000 ffffffff ffffffff ff4fffff f3428020 1...'.X..3...............O...B. > > But this looks exactly like you have 64-bit write-buffer, but UBIFS > c->min_io_unit is not 64, but it should be 64. Or you need a NOR hack to > force 8-bytes write-buffer. This looks exactly like I have a 16 byte write buffer. The first 16 bytes of the common header node have been written correctly but the remaining 8 bytes of the common header and then the 8 bytes of the data are corrupt. > > Are you sure you did not miss your NOR write-buffer hacks? I'm sure that the kernel running this test uses the modification in the CFI code as follows: bigger buffer. I'll check the actual size used in the CFI driver at runtime. Thanks, Anatolij diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index e63e674..9eb47b8 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -213,6 +213,12 @@ static int __xipram cfi_chip_setup(struct map_info *map, cfi->cfiq->InterfaceDesc = le16_to_cpu(cfi->cfiq->InterfaceDesc); cfi->cfiq->MaxBufWriteSize = le16_to_cpu(cfi->cfiq->MaxBufWriteSize); + /*printk("NOTE: change CFI MaxBufWriteSize from 2^%d to 2^%d\n",*/ + /*cfi->cfiq->MaxBufWriteSize, 3);*/ + if (cfi->cfiq->MaxBufWriteSize) { + cfi->cfiq->MaxBufWriteSize = 3; + } + But I'm not sure whether the CFI driver is really using 8 byte write buffer since the error pattern indicates the usage of a