kernel: bump 4.19 to 4.19.34
[openwrt/openwrt.git] / target / linux / ath79 / patches-4.19 / 403-mtd_fix_cfi_cmdset_0002_status_check.patch
1 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
2 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
3 @@ -1634,8 +1634,8 @@ static int __xipram do_write_oneword(str
4 break;
5 }
6
7 - if (chip_ready(map, adr))
8 - break;
9 + if (chip_good(map, adr, datum))
10 + goto enable_xip;
11
12 /* Latency issues. Drop the lock, wait a while and retry */
13 UDELAY(map, chip, adr, 1);
14 @@ -1651,6 +1651,8 @@ static int __xipram do_write_oneword(str
15
16 ret = -EIO;
17 }
18 +
19 + enable_xip:
20 xip_enable(map, chip, adr);
21 op_done:
22 if (mode == FL_OTP_WRITE)
23 @@ -2229,7 +2231,6 @@ static int cfi_amdstd_panic_write(struct
24 return 0;
25 }
26
27 -
28 /*
29 * Handle devices with one erase region, that only implement
30 * the chip erase command.
31 @@ -2297,7 +2298,7 @@ static int __xipram do_erase_chip(struct
32 }
33
34 if (chip_good(map, adr, map_word_ff(map)))
35 - break;
36 + goto op_done;
37
38 if (time_after(jiffies, timeo)) {
39 printk(KERN_WARNING "MTD %s(): software timeout\n",
40 @@ -2321,6 +2322,7 @@ static int __xipram do_erase_chip(struct
41 }
42 }
43
44 + op_done:
45 chip->state = FL_READY;
46 xip_enable(map, chip, adr);
47 DISABLE_VPP(map);
48 @@ -2393,7 +2395,7 @@ static int __xipram do_erase_oneblock(st
49 }
50
51 if (chip_good(map, adr, map_word_ff(map)))
52 - break;
53 + goto op_done;
54
55 if (time_after(jiffies, timeo)) {
56 printk(KERN_WARNING "MTD %s(): software timeout\n",
57 @@ -2417,6 +2419,7 @@ static int __xipram do_erase_oneblock(st
58 }
59 }
60
61 + op_done:
62 chip->state = FL_READY;
63 xip_enable(map, chip, adr);
64 DISABLE_VPP(map);