From patchwork Wed Mar 7 14:10:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Parsons X-Patchwork-Id: 145284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 54789B6EF3 for ; Thu, 8 Mar 2012 01:13:18 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1S5Hb1-0000BY-04; Wed, 07 Mar 2012 14:12:03 +0000 Received: from nm13.bullet.mail.ird.yahoo.com ([77.238.189.66]) by merlin.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1S5HZb-0008SH-15 for linux-mtd@lists.infradead.org; Wed, 07 Mar 2012 14:10:36 +0000 Received: from [77.238.189.232] by nm13.bullet.mail.ird.yahoo.com with NNFMP; 07 Mar 2012 14:10:33 -0000 Received: from [212.82.108.242] by tm13.bullet.mail.ird.yahoo.com with NNFMP; 07 Mar 2012 14:10:33 -0000 Received: from [127.0.0.1] by omp1007.mail.ird.yahoo.com with NNFMP; 07 Mar 2012 14:10:33 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 533128.83281.bm@omp1007.mail.ird.yahoo.com Received: (qmail 87221 invoked by uid 60001); 7 Mar 2012 14:10:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1331129433; bh=2gj/SG6ZWW7IvsWhLX/tzP4bp1goSo4u2qwmqPo9Mlg=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=oz/dDQ8HjgYQPZoqwItRFx/ghtJMVlk4HVXSCQLGYJlvtGhAROzZ/r56i4hmLx1ZG9fCZ3dlT449qT/5tASZGtPjTfat2Bq+rKD5ES5QEdVKHALb6LtmbnJP6qkgJzT6bQJk45vBAXRiZmr5Vo71gX+7DX14egCDjuySOeS/L8U= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Sk5ouLC+WtCNRUuoiOzULq5RtuWdfDBpjDeptc1Zbf+s2vfwtJg4qt+XA/GHBgXM/DGimhi+t/qUxoGohkJ/ya9SwW+J077SJLy9gcAlg65pFPrtl+wjSnj9pyvBrsgxTw2R68q487DPIfiHgmKTR2Nw5yJjubH3fZf30uWqJkU=; X-YMail-OSG: lOYHAHUVM1k1q8GFTFy6RaQX8phUnhbRQOoN5XZcTpLSYx. rizryctDCdfezkUneX_g_eib5YH67b91dGs0VWrHQdPh__px9dduqyLFGcjj q0xePeQ6.tnAuHaempIEj8rfWIzFWcCy9LEPSGvkzZJnVqmvsXsv36qiMCBK DzX3jzkixSjAITOy6b9sWurRMVV31_uqXpR9mxOKDb75UP41UF8MV5tqcK55 l.4QyP0PnCup7WHJI_1w3bom9FlguXe6dbwAf6qdT0miyUkq3cgXrTORtXsv RyrtzNy46sIOeAgdGkrCSIgtxGAnim5FpwdaA1pL3h7LuRM6FWFol9nN7yVv c4qwkEWTTUuFQts21_08O2NOPOLoYl2BXyWMgPJh6qmluqkapXtfHol8HbUq wf7bOvfxemIPVvZOZkS42yWwQzzNtkO1EsC.Y9nlE89XWL4lKlCNT0_UDamz WGNoVAHo- Received: from [31.185.155.94] by web29017.mail.ird.yahoo.com via HTTP; Wed, 07 Mar 2012 14:10:33 GMT X-Mailer: YahooMailClassic/15.0.5 YahooMailWebService/0.8.116.338427 Message-ID: <1331129433.70688.YahooMailClassic@web29017.mail.ird.yahoo.com> Date: Wed, 7 Mar 2012 14:10:33 +0000 (GMT) From: Paul Parsons Subject: [PATCH 1/6] mtd: chips: cfi_cmdset_0001: Match ENABLE_VPP()/DISABLE_VPP() calls To: linux-mtd@lists.infradead.org MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [77.238.189.66 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lost.distance[at]yahoo.com) -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: dwmw2@infradead.org, joakim.tjernlund@transmode.se, philipp.zabel@gmail.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 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 This patch is part of a set which fixes unnecessary flash erase and write errors resulting from the MTD CFI driver turning off vpp while an erase is in progress. This patch ensures that only those flash operations which call ENABLE_VPP() can then call DISABLE_VPP(). Other operations should never call DISABLE_VPP(). Signed-off-by: Paul Parsons diff -uprN clean-3.3-rc6/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.3-rc6/drivers/mtd/chips/cfi_cmdset_0001.c --- clean-3.3-rc6/drivers/mtd/chips/cfi_cmdset_0001.c 2012-03-04 01:08:09.000000000 +0000 +++ linux-3.3-rc6/drivers/mtd/chips/cfi_cmdset_0001.c 2012-03-06 16:38:29.787134295 +0000 @@ -1017,8 +1017,6 @@ static void put_chip(struct map_info *ma case FL_READY: case FL_STATUS: case FL_JEDEC_QUERY: - /* We should really make set_vpp() count, rather than doing this */ - DISABLE_VPP(map); break; default: printk(KERN_ERR "%s: put_chip() called with oldstate %d!!\n", map->name, chip->oldstate); @@ -1551,7 +1549,8 @@ static int __xipram do_write_oneword(str } xip_enable(map, chip, adr); - out: put_chip(map, chip, adr); + out: DISABLE_VPP(map); + put_chip(map, chip, adr); mutex_unlock(&chip->mutex); return ret; } @@ -1794,7 +1793,8 @@ static int __xipram do_write_buffer(stru } xip_enable(map, chip, cmd_adr); - out: put_chip(map, chip, cmd_adr); + out: DISABLE_VPP(map); + put_chip(map, chip, cmd_adr); mutex_unlock(&chip->mutex); return ret; } @@ -1932,6 +1932,7 @@ static int __xipram do_erase_oneblock(st ret = -EIO; } else if (chipstatus & 0x20 && retries--) { printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus); + DISABLE_VPP(map); put_chip(map, chip, adr); mutex_unlock(&chip->mutex); goto retry; @@ -1944,7 +1945,8 @@ static int __xipram do_erase_oneblock(st } xip_enable(map, chip, adr); - out: put_chip(map, chip, adr); + out: DISABLE_VPP(map); + put_chip(map, chip, adr); mutex_unlock(&chip->mutex); return ret; } @@ -2086,7 +2088,8 @@ static int __xipram do_xxlock_oneblock(s } xip_enable(map, chip, adr); -out: put_chip(map, chip, adr); + out: DISABLE_VPP(map); + put_chip(map, chip, adr); mutex_unlock(&chip->mutex); return ret; }