@@ -2045,7 +2045,8 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip
{
struct cfi_private *cfi = map->fldrv_priv;
struct cfi_pri_intelext *extp = cfi->cmdset_priv;
- int udelay;
+ unsigned int udelay = 0;
+ unsigned int udelay_max = 0;
int ret;
adr += chip->start;
@@ -2071,12 +2072,15 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip
BUG();
/*
- * If Instant Individual Block Locking supported then no need
- * to delay.
+ * If Instant Individual Block Locking is unsupported then use
+ * the tick period as the typical delay and 10 seconds for the timeout.
*/
- udelay = (!extp || !(extp->FeatureSupport & (1 << 5))) ? 1000000/HZ : 0;
+ if (!extp || !(extp->FeatureSupport & (1 << 5))) {
+ udelay = 1000000 / HZ;
+ udelay_max = 10000000;
+ }
- ret = WAIT_TIMEOUT(map, chip, adr, udelay, udelay * 100);
+ ret = WAIT_TIMEOUT(map, chip, adr, udelay, udelay_max);
if (ret) {
map_write(map, CMD(0x70), adr);
chip->state = FL_STATUS;