]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: chips: cfi_cmdset_0002: Match ENABLE_VPP()/DISABLE_VPP() calls
authorPaul Parsons <lost.distance@yahoo.com>
Wed, 7 Mar 2012 14:11:16 +0000 (14:11 +0000)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:36:02 +0000 (08:36 +0200)
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 <lost.distance@yahoo.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/mtd/chips/cfi_cmdset_0002.c

index 4a52274046142d21892631b94d291afac3789ea3..9b7ff5579d2e71a56fe37e90c499f35902923cdc 100644 (file)
@@ -774,8 +774,6 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
 
        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);
@@ -1238,6 +1236,7 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
        xip_enable(map, chip, adr);
  op_done:
        chip->state = FL_READY;
+       DISABLE_VPP(map);
        put_chip(map, chip, adr);
        mutex_unlock(&chip->mutex);
 
@@ -1480,6 +1479,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
        ret = -EIO;
  op_done:
        chip->state = FL_READY;
+       DISABLE_VPP(map);
        put_chip(map, chip, adr);
        mutex_unlock(&chip->mutex);
 
@@ -1889,6 +1889,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
 
        chip->state = FL_READY;
        xip_enable(map, chip, adr);
+       DISABLE_VPP(map);
        put_chip(map, chip, adr);
        mutex_unlock(&chip->mutex);
 
@@ -1979,6 +1980,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
        }
 
        chip->state = FL_READY;
+       DISABLE_VPP(map);
        put_chip(map, chip, adr);
        mutex_unlock(&chip->mutex);
        return ret;