summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/pgtable.h
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2015-01-26 09:40:34 +0000
committerRalf Baechle <ralf@linux-mips.org>2015-02-16 10:55:26 +0100
commit461d1597ffad7a826f8aaa63ab0727c37b632e34 (patch)
tree2a04779169ef83fb9df1de6c8bdc41163cbd8243 /arch/mips/include/asm/pgtable.h
parentd79d853df126553f9a185151e310f6dc74205ae5 (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>
Diffstat (limited to 'arch/mips/include/asm/pgtable.h')
-rw-r--r--arch/mips/include/asm/pgtable.h10
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);
#define htw_stop() \
do { \
- if (cpu_has_htw) \
+ if (cpu_has_htw) { \
write_c0_pwctl(read_c0_pwctl() & \
~(1 << MIPS_PWCTL_PWEN_SHIFT)); \
+ back_to_back_c0_hazard(); \
+ } \
} while(0)
#define htw_start() \
do { \
- if (cpu_has_htw) \
+ if (cpu_has_htw) { \
write_c0_pwctl(read_c0_pwctl() | \
(1 << MIPS_PWCTL_PWEN_SHIFT)); \
+ back_to_back_c0_hazard(); \
+ } \
} while(0)
@@ -116,9 +120,7 @@ do { \
do { \
if (cpu_has_htw) { \
htw_stop(); \
- back_to_back_c0_hazard(); \
htw_start(); \
- back_to_back_c0_hazard(); \
} \
} while(0)