diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2015-01-26 04:40:34 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-02-16 04:55:26 -0500 |
commit | 461d1597ffad7a826f8aaa63ab0727c37b632e34 (patch) | |
tree | 2a04779169ef83fb9df1de6c8bdc41163cbd8243 | |
parent | d79d853df126553f9a185151e310f6dc74205ae5 (diff) |
MIPS: asm: pgtable: Add c0 hazards on HTW start/stop sequences
When we use htw_{start,stop}() outside of htw_reset(), we need
to ensure that c0 changes have been propagated properly before
we attempt to continue with subsequence memory operations.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: <stable@vger.kernel.org> # 3.17+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9114/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/pgtable.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index 62a6ba383d4f..45d7fd5e1466 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h | |||
@@ -99,16 +99,20 @@ extern void paging_init(void); | |||
99 | 99 | ||
100 | #define htw_stop() \ | 100 | #define htw_stop() \ |
101 | do { \ | 101 | do { \ |
102 | if (cpu_has_htw) \ | 102 | if (cpu_has_htw) { \ |
103 | write_c0_pwctl(read_c0_pwctl() & \ | 103 | write_c0_pwctl(read_c0_pwctl() & \ |
104 | ~(1 << MIPS_PWCTL_PWEN_SHIFT)); \ | 104 | ~(1 << MIPS_PWCTL_PWEN_SHIFT)); \ |
105 | back_to_back_c0_hazard(); \ | ||
106 | } \ | ||
105 | } while(0) | 107 | } while(0) |
106 | 108 | ||
107 | #define htw_start() \ | 109 | #define htw_start() \ |
108 | do { \ | 110 | do { \ |
109 | if (cpu_has_htw) \ | 111 | if (cpu_has_htw) { \ |
110 | write_c0_pwctl(read_c0_pwctl() | \ | 112 | write_c0_pwctl(read_c0_pwctl() | \ |
111 | (1 << MIPS_PWCTL_PWEN_SHIFT)); \ | 113 | (1 << MIPS_PWCTL_PWEN_SHIFT)); \ |
114 | back_to_back_c0_hazard(); \ | ||
115 | } \ | ||
112 | } while(0) | 116 | } while(0) |
113 | 117 | ||
114 | 118 | ||
@@ -116,9 +120,7 @@ do { \ | |||
116 | do { \ | 120 | do { \ |
117 | if (cpu_has_htw) { \ | 121 | if (cpu_has_htw) { \ |
118 | htw_stop(); \ | 122 | htw_stop(); \ |
119 | back_to_back_c0_hazard(); \ | ||
120 | htw_start(); \ | 123 | htw_start(); \ |
121 | back_to_back_c0_hazard(); \ | ||
122 | } \ | 124 | } \ |
123 | } while(0) | 125 | } while(0) |
124 | 126 | ||