Commit 90b084b1 authored by Matt Redfearn's avatar Matt Redfearn Committed by Ralf Baechle

MIPS: pm-cps: Use MIPS standard completion barrier

SYNC type 0 is defined in the MIPS architecture as a completion barrier
where all loads/stores in the pipeline before the sync instruction must
complete before any loads/stores subsequent to the sync instruction.

In places where we require loads / stores be globally completed, use the
standard completion sync stype.
Signed-off-by: default avatarMatt Redfearn <matt.redfearn@imgtec.com>
Reviewed-by: default avatarPaul Burton <paul.burton@imgtec.com>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14224/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 85e540be
...@@ -315,7 +315,7 @@ static int __init cps_gen_flush_fsb(u32 **pp, struct uasm_label **pl, ...@@ -315,7 +315,7 @@ static int __init cps_gen_flush_fsb(u32 **pp, struct uasm_label **pl,
} }
/* Barrier ensuring previous cache invalidates are complete */ /* Barrier ensuring previous cache invalidates are complete */
uasm_i_sync(pp, stype_memory); uasm_i_sync(pp, STYPE_SYNC);
uasm_i_ehb(pp); uasm_i_ehb(pp);
/* Check whether the pipeline stalled due to the FSB being full */ /* Check whether the pipeline stalled due to the FSB being full */
...@@ -467,7 +467,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state) ...@@ -467,7 +467,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state)
Index_Writeback_Inv_D, lbl_flushdcache); Index_Writeback_Inv_D, lbl_flushdcache);
/* Barrier ensuring previous cache invalidates are complete */ /* Barrier ensuring previous cache invalidates are complete */
uasm_i_sync(&p, stype_memory); uasm_i_sync(&p, STYPE_SYNC);
uasm_i_ehb(&p); uasm_i_ehb(&p);
/* /*
...@@ -480,7 +480,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state) ...@@ -480,7 +480,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state)
uasm_i_lw(&p, t0, 0, r_pcohctl); uasm_i_lw(&p, t0, 0, r_pcohctl);
/* Barrier to ensure write to coherence control is complete */ /* Barrier to ensure write to coherence control is complete */
uasm_i_sync(&p, stype_intervention); uasm_i_sync(&p, STYPE_SYNC);
uasm_i_ehb(&p); uasm_i_ehb(&p);
/* Disable coherence */ /* Disable coherence */
...@@ -526,7 +526,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state) ...@@ -526,7 +526,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state)
} }
/* Barrier to ensure write to CPC command is complete */ /* Barrier to ensure write to CPC command is complete */
uasm_i_sync(&p, stype_memory); uasm_i_sync(&p, STYPE_SYNC);
uasm_i_ehb(&p); uasm_i_ehb(&p);
} }
...@@ -561,7 +561,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state) ...@@ -561,7 +561,7 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state)
uasm_i_lw(&p, t0, 0, r_pcohctl); uasm_i_lw(&p, t0, 0, r_pcohctl);
/* Barrier to ensure write to coherence control is complete */ /* Barrier to ensure write to coherence control is complete */
uasm_i_sync(&p, stype_memory); uasm_i_sync(&p, STYPE_SYNC);
uasm_i_ehb(&p); uasm_i_ehb(&p);
if (coupled_coherence && (state == CPS_PM_NC_WAIT)) { if (coupled_coherence && (state == CPS_PM_NC_WAIT)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment