From patchwork Mon Feb 7 17:08:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bigler X-Patchwork-Id: 82120 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5E4DBB711E for ; Tue, 8 Feb 2011 04:11:09 +1100 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1PmUaK-00046m-E1; Mon, 07 Feb 2011 17:09:08 +0000 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 1PmUaJ-0001vB-0i; Mon, 07 Feb 2011 17:09:07 +0000 Received: from mail.ch.keymile.com ([193.17.201.103]) by canuck.infradead.org with smtp (Exim 4.72 #1 (Red Hat Linux)) id 1PmUaE-0001ur-8r for linux-mtd@lists.infradead.org; Mon, 07 Feb 2011 17:09:03 +0000 Received: from SRVCHBER1212.ch.keymile.net ([172.31.32.9]) by eSafe SMTP Relay 1296642120; Mon, 07 Feb 2011 17:59:20 +0100 Received: from chber1-10404x.ch.keymile.net ([172.31.31.33]) by SRVCHBER1212.ch.keymile.net with Microsoft SMTPSVC(6.0.3790.4675); Mon, 7 Feb 2011 18:08:55 +0100 Message-ID: <4D502727.5010208@keymile.com> Date: Mon, 07 Feb 2011 18:08:55 +0100 From: Stefan Bigler User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Michael Cashwell Subject: Re: Numonyx NOR and chip->mutex bug? References: <16826B66-31FE-41AD-A6EF-E668A45AF1FE@prograde.net> <6FC0E416-EEBD-453F-AAB9-88BB6D90BFAB@prograde.net> <4D4AD9ED.8060104@keymile.com> <4D4B37D4.4050204@keymile.com> <4D4BDD48.6040600@keymile.com> <541E19B8-D428-4F59-B6BB-A3BD8F455AE4@prograde.net> <0488D3BA-7BA3-4E98-B289-3F3D1DB485D4@prograde.net> <3FD201B7-C633-4D5D-A5D5-42952E6FFC28@prograde.net> In-Reply-To: <3FD201B7-C633-4D5D-A5D5-42952E6FFC28@prograde.net> X-OriginalArrivalTime: 07 Feb 2011 17:08:55.0535 (UTC) FILETIME=[B3BC8FF0:01CBC6E9] X-ESAFE-STATUS: Mail allowed X-ESAFE-DETAILS: X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110207_120902_612327_070B657D X-CRM114-Status: GOOD ( 19.12 ) 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 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Holger brunck , linux-mtd@lists.infradead.org, Joakim Tjernlund X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: stefan.bigler@keymile.com 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 Hi Mike I attached a patch for you adding some printk, with those already the creation of the first ubivolume goes wrong. Is this also the case in your setup? Regards Stefan Subject: [PATCH 2/2] MTD: cfi_cmdset_0001 driver add tracing This tracing force in my case a race condition. When I create a ubivolume. Signed-off-by: Stefan Bigler --- drivers/mtd/chips/cfi_cmdset_0001.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) * appears to make some (28F320) flash devices switch to @@ -1012,6 +1016,10 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad do. */ map_write(map, CMD(0xd0), adr); map_write(map, CMD(0x70), adr); + + printk("[%10u][%04ld] erase resumed 2b adr=0x%08lx\n", + jiffies_to_usecs(jiffies)/1000, sys_gettid(), adr); + chip->oldstate = FL_READY; chip->state = FL_ERASING; break; @@ -1884,6 +1892,10 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, retry: mutex_lock(&chip->mutex); ret = get_chip(map, chip, adr, FL_ERASING); + + printk("[%10u][%04ld] do_erase_oneblock start adr=0x%08lx len=0x%x\n", + jiffies_to_usecs(jiffies)/1000, sys_gettid(), adr, len); + if (ret) { mutex_unlock(&chip->mutex); return ret; @@ -1953,6 +1965,9 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, xip_enable(map, chip, adr); out: put_chip(map, chip, adr); + printk("[%10u][%04ld] do_erase_oneblock end adr=0x%08lx len=0x%x \n", + jiffies_to_usecs(jiffies)/1000, sys_gettid(), adr, len); + mutex_unlock(&chip->mutex); return ret; } diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index d3b2cd3..ea59726 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -37,6 +37,8 @@ #include #include +#include + /* #define CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE */ /* #define CMDSET0001_DISABLE_WRITE_SUSPEND */ @@ -799,6 +801,8 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long /* Erase suspend */ map_write(map, CMD(0xB0), adr); + printk("[%10u][%04ld] erase suspend 1 adr=0x%08lx\n", + jiffies_to_usecs(jiffies)/1000, sys_gettid(), adr); /* If the flash has finished erasing, then 'erase suspend'