kernel: bump 4.19 to 4.19.76
[oweals/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 @@ -1640,7 +1640,7 @@ static int __xipram do_write_oneword(str
4                 }
5  
6                 if (chip_good(map, adr, datum))
7 -                       break;
8 +                       goto enable_xip;
9  
10                 /* Latency issues. Drop the lock, wait a while and retry */
11                 UDELAY(map, chip, adr, 1);
12 @@ -1657,6 +1657,8 @@ static int __xipram do_write_oneword(str
13                         goto retry;
14                 }
15         }
16 +
17 + enable_xip:
18         xip_enable(map, chip, adr);
19   op_done:
20         if (mode == FL_OTP_WRITE)
21 @@ -2235,7 +2237,6 @@ static int cfi_amdstd_panic_write(struct
22         return 0;
23  }
24  
25 -
26  /*
27   * Handle devices with one erase region, that only implement
28   * the chip erase command.
29 @@ -2303,7 +2304,7 @@ static int __xipram do_erase_chip(struct
30                 }
31  
32                 if (chip_good(map, adr, map_word_ff(map)))
33 -                       break;
34 +                       goto op_done;
35  
36                 if (time_after(jiffies, timeo)) {
37                         printk(KERN_WARNING "MTD %s(): software timeout\n",
38 @@ -2327,6 +2328,7 @@ static int __xipram do_erase_chip(struct
39                 }
40         }
41  
42 + op_done:
43         chip->state = FL_READY;
44         xip_enable(map, chip, adr);
45         DISABLE_VPP(map);
46 @@ -2399,7 +2401,7 @@ static int __xipram do_erase_oneblock(st
47                 }
48  
49                 if (chip_good(map, adr, map_word_ff(map)))
50 -                       break;
51 +                       goto op_done;
52  
53                 if (time_after(jiffies, timeo)) {
54                         printk(KERN_WARNING "MTD %s(): software timeout\n",
55 @@ -2423,6 +2425,7 @@ static int __xipram do_erase_oneblock(st
56                 }
57         }
58  
59 + op_done:
60         chip->state = FL_READY;
61         xip_enable(map, chip, adr);
62         DISABLE_VPP(map);