Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

blackfin: cleanup anomaly workarounds

cleanup ANOMALY_05000312 and ANOMALY_05000244

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>

Bob Liu 0db07a90 ff4db3b1

+19 -23
+19 -23
arch/blackfin/include/asm/blackfin.h
··· 17 17 static inline void SSYNC(void) 18 18 { 19 19 int _tmp; 20 - if (ANOMALY_05000312) 20 + if (ANOMALY_05000312 || ANOMALY_05000244) 21 21 __asm__ __volatile__( 22 22 "cli %0;" 23 + "nop;" 23 24 "nop;" 24 25 "nop;" 25 26 "ssync;" 26 27 "sti %0;" 27 28 : "=d" (_tmp) 28 - ); 29 - else if (ANOMALY_05000244) 30 - __asm__ __volatile__( 31 - "nop;" 32 - "nop;" 33 - "nop;" 34 - "ssync;" 35 29 ); 36 30 else 37 31 __asm__ __volatile__("ssync;"); ··· 35 41 static inline void CSYNC(void) 36 42 { 37 43 int _tmp; 38 - if (ANOMALY_05000312) 44 + if (ANOMALY_05000312 || ANOMALY_05000244) 39 45 __asm__ __volatile__( 40 46 "cli %0;" 47 + "nop;" 41 48 "nop;" 42 49 "nop;" 43 50 "csync;" 44 51 "sti %0;" 45 52 : "=d" (_tmp) 46 - ); 47 - else if (ANOMALY_05000244) 48 - __asm__ __volatile__( 49 - "nop;" 50 - "nop;" 51 - "nop;" 52 - "csync;" 53 53 ); 54 54 else 55 55 __asm__ __volatile__("csync;"); ··· 61 73 #define ssync(x) SSYNC(x) 62 74 #define csync(x) CSYNC(x) 63 75 64 - #if ANOMALY_05000312 65 - #define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch; 66 - #define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch; 76 + #if ANOMALY_05000312 || ANOMALY_05000244 77 + #define SSYNC(scratch) \ 78 + do { \ 79 + cli scratch; \ 80 + nop; nop; nop; \ 81 + SSYNC; \ 82 + sti scratch; \ 83 + } while (0) 67 84 68 - #elif ANOMALY_05000244 69 - #define SSYNC(scratch) nop; nop; nop; SSYNC; 70 - #define CSYNC(scratch) nop; nop; nop; CSYNC; 85 + #define CSYNC(scratch) \ 86 + do { \ 87 + cli scratch; \ 88 + nop; nop; nop; \ 89 + CSYNC; \ 90 + sti scratch; \ 91 + } while (0) 71 92 72 93 #else 73 94 #define SSYNC(scratch) SSYNC; 74 95 #define CSYNC(scratch) CSYNC; 75 - 76 96 #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */ 77 97 78 98 #endif /* __ASSEMBLY__ */