surprise :p
[openwrt.git] / target / linux / ar71xx / patches / 902-mips_clocksource_init_war.patch
1 --- a/include/asm-mips/hazards.h
2 +++ b/include/asm-mips/hazards.h
3 @@ -64,7 +64,7 @@
4         _ehb
5         )
6  ASMMACRO(back_to_back_c0_hazard,
7 -        _ehb
8 +        _ssnop; _ssnop; _ssnop; _ehb
9         )
10  /*
11   * gcc has a tradition of misscompiling the previous construct using the
12 --- a/arch/mips/kernel/cevt-r4k.c
13 +++ b/arch/mips/kernel/cevt-r4k.c
14 @@ -187,7 +187,7 @@
15          */
16         if (c0_compare_int_pending()) {
17                 write_c0_compare(read_c0_count());
18 -               irq_disable_hazard();
19 +               back_to_back_c0_hazard();               
20                 if (c0_compare_int_pending())
21                         return 0;
22         }
23 @@ -196,7 +196,7 @@
24                 cnt = read_c0_count();
25                 cnt += delta;
26                 write_c0_compare(cnt);
27 -               irq_disable_hazard();
28 +               back_to_back_c0_hazard();               
29                 if ((int)(read_c0_count() - cnt) < 0)
30                     break;
31                 /* increase delta if the timer was already expired */
32 @@ -205,11 +205,12 @@
33         while ((int)(read_c0_count() - cnt) <= 0)
34                 ;       /* Wait for expiry  */
35  
36 +       back_to_back_c0_hazard();
37         if (!c0_compare_int_pending())
38                 return 0;
39  
40         write_c0_compare(read_c0_count());
41 -       irq_disable_hazard();
42 +       back_to_back_c0_hazard();               
43         if (c0_compare_int_pending())
44                 return 0;
45