From patchwork Wed Mar 7 14:11:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Parsons X-Patchwork-Id: 145283 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 76DE1B6EF3 for ; Thu, 8 Mar 2012 01:13:12 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1S5Hb4-0000CL-Sq; Wed, 07 Mar 2012 14:12:06 +0000 Received: from nm16-vm0.bullet.mail.ird.yahoo.com ([77.238.189.192]) by merlin.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1S5HaH-00006i-Ut for linux-mtd@lists.infradead.org; Wed, 07 Mar 2012 14:11:19 +0000 Received: from [77.238.189.56] by nm16.bullet.mail.ird.yahoo.com with NNFMP; 07 Mar 2012 14:11:16 -0000 Received: from [212.82.108.253] by tm9.bullet.mail.ird.yahoo.com with NNFMP; 07 Mar 2012 14:11:16 -0000 Received: from [127.0.0.1] by omp1018.mail.ird.yahoo.com with NNFMP; 07 Mar 2012 14:11:16 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 879602.93564.bm@omp1018.mail.ird.yahoo.com Received: (qmail 90494 invoked by uid 60001); 7 Mar 2012 14:11:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1331129476; bh=bQmEF5bDnJiokwlwyZGfN+YPZA3Xg/syTgPr72hadYY=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VjlFEbS0AL6QVVNUeacG60DkbAol2+TSfL+D5YgHzyYbWvrvDSGkubBscPrXEHA41WtozKnDJt7fVOVla2AOdbhQbJr6UOtTYohb5NoEbnBJuqjJRAFybA+FudBuCwdh9jjwK1+5l3+cR7pyztFzWYCWHM58QpStuysIYMj3sJU= 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=cSTpSAqwuzT1DzESTfDjT5xS5w7p/BFU46XlCIBlzS4I1kyvB+5QlqKr5rDeEWqNezBFmLb8jEf/eOk0F9jM9zqgjEcp3OLCGv0NqIk1xWE/rs6YCxLZvFlhiqaUeKSeELzX01wShXylglYBfNN+4KFawbdbY6lqgvPYWopmono=; X-YMail-OSG: TiiKloYVM1lXw92mWfDYgm1ei_CXo4hB98tWpmtGrpy74qt 4AAaOHnpsOs20JQEJtTcIt3THs67X7kiNuEMlzoXcfyKn7asyKMG7MwwjI_O 1Z8NroTOwneZ_ytN82UN3NUkj6FGVtzHyHBVEnHzQiziSyz_gfgR6YHPjJy4 .4hrSurj45QLde8Gp5_.tywe8I.oF063FdMWVpg4L.fD1wQ4OnJ_Yfkk93Qs tiPjNbUa.2jnkicHg7Ks4C3YVy2WQU6kRep1LyRZ7MM.aD994wps1KlxIapL wktoJCJB9pJWr0qvscrUS_yKDASW_mlAATJkq.68ebiVrDrMu2nt2fYtxT6U otUEl0X3BKUu6lHEQTlIoN9iRm9rKz3NtIaMslEVqlsLuvAEF9reza18V1HE 68O2NVRUElEnl0zOF_ir3PNa4h_TGx4mrG5C7khlnvbynlT5Rg1wsCldYdVy rLwZX1EQ- Received: from [31.185.155.94] by web29011.mail.ird.yahoo.com via HTTP; Wed, 07 Mar 2012 14:11:16 GMT X-Mailer: YahooMailClassic/15.0.5 YahooMailWebService/0.8.116.338427 Message-ID: <1331129476.90478.YahooMailClassic@web29011.mail.ird.yahoo.com> Date: Wed, 7 Mar 2012 14:11:16 +0000 (GMT) From: Paul Parsons Subject: [PATCH 2/6] mtd: chips: cfi_cmdset_0002: 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 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.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [77.238.189.192 listed in list.dnswl.org] -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_0002.c linux-3.3-rc6/drivers/mtd/chips/cfi_cmdset_0002.c --- clean-3.3-rc6/drivers/mtd/chips/cfi_cmdset_0002.c 2012-03-04 01:08:09.000000000 +0000 +++ linux-3.3-rc6/drivers/mtd/chips/cfi_cmdset_0002.c 2012-03-06 16:38:29.787134295 +0000 @@ -770,8 +770,6 @@ static void put_chip(struct map_info *ma case FL_READY: case FL_STATUS: - /* We should really make set_vpp() count, rather than doing this */ - DISABLE_VPP(map); break; default: printk(KERN_ERR "MTD: put_chip() called with oldstate %d!!\n", chip->oldstate); @@ -1234,6 +1232,7 @@ static int __xipram do_write_oneword(str xip_enable(map, chip, adr); op_done: chip->state = FL_READY; + DISABLE_VPP(map); put_chip(map, chip, adr); mutex_unlock(&chip->mutex); @@ -1476,6 +1475,7 @@ static int __xipram do_write_buffer(stru ret = -EIO; op_done: chip->state = FL_READY; + DISABLE_VPP(map); put_chip(map, chip, adr); mutex_unlock(&chip->mutex); @@ -1649,6 +1649,7 @@ static int __xipram do_erase_chip(struct chip->state = FL_READY; xip_enable(map, chip, adr); + DISABLE_VPP(map); put_chip(map, chip, adr); mutex_unlock(&chip->mutex); @@ -1739,6 +1740,7 @@ static int __xipram do_erase_oneblock(st } chip->state = FL_READY; + DISABLE_VPP(map); put_chip(map, chip, adr); mutex_unlock(&chip->mutex); return ret;