mtd: chips: cfi_cmdset_0001: Match ENABLE_VPP()/DISABLE_VPP() calls
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>
This commit is contained in:
Родитель
0c78e93b44
Коммит
85e5b2f298
|
@ -1017,8 +1017,6 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
|
||||||
case FL_READY:
|
case FL_READY:
|
||||||
case FL_STATUS:
|
case FL_STATUS:
|
||||||
case FL_JEDEC_QUERY:
|
case FL_JEDEC_QUERY:
|
||||||
/* We should really make set_vpp() count, rather than doing this */
|
|
||||||
DISABLE_VPP(map);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printk(KERN_ERR "%s: put_chip() called with oldstate %d!!\n", map->name, chip->oldstate);
|
printk(KERN_ERR "%s: put_chip() called with oldstate %d!!\n", map->name, chip->oldstate);
|
||||||
|
@ -1552,7 +1550,8 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
|
||||||
}
|
}
|
||||||
|
|
||||||
xip_enable(map, chip, adr);
|
xip_enable(map, chip, adr);
|
||||||
out: put_chip(map, chip, adr);
|
out: DISABLE_VPP(map);
|
||||||
|
put_chip(map, chip, adr);
|
||||||
mutex_unlock(&chip->mutex);
|
mutex_unlock(&chip->mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1791,7 +1790,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
|
||||||
}
|
}
|
||||||
|
|
||||||
xip_enable(map, chip, cmd_adr);
|
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);
|
mutex_unlock(&chip->mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1928,6 +1928,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
} else if (chipstatus & 0x20 && retries--) {
|
} else if (chipstatus & 0x20 && retries--) {
|
||||||
printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus);
|
printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus);
|
||||||
|
DISABLE_VPP(map);
|
||||||
put_chip(map, chip, adr);
|
put_chip(map, chip, adr);
|
||||||
mutex_unlock(&chip->mutex);
|
mutex_unlock(&chip->mutex);
|
||||||
goto retry;
|
goto retry;
|
||||||
|
@ -1940,7 +1941,8 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
||||||
}
|
}
|
||||||
|
|
||||||
xip_enable(map, chip, adr);
|
xip_enable(map, chip, adr);
|
||||||
out: put_chip(map, chip, adr);
|
out: DISABLE_VPP(map);
|
||||||
|
put_chip(map, chip, adr);
|
||||||
mutex_unlock(&chip->mutex);
|
mutex_unlock(&chip->mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2082,7 +2084,8 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip
|
||||||
}
|
}
|
||||||
|
|
||||||
xip_enable(map, chip, adr);
|
xip_enable(map, chip, adr);
|
||||||
out: put_chip(map, chip, adr);
|
out: DISABLE_VPP(map);
|
||||||
|
put_chip(map, chip, adr);
|
||||||
mutex_unlock(&chip->mutex);
|
mutex_unlock(&chip->mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче