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

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: Matt Redfearn <matt.redfearn@imgtec.com>
Reviewed-by: Paul 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: Ralf Baechle <ralf@linux-mips.org>

authored by

Matt Redfearn and committed by
Ralf Baechle
90b084b1 85e540be

+5 -5
+5 -5
arch/mips/kernel/pm-cps.c
··· 315 315 } 316 316 317 317 /* Barrier ensuring previous cache invalidates are complete */ 318 - uasm_i_sync(pp, stype_memory); 318 + uasm_i_sync(pp, STYPE_SYNC); 319 319 uasm_i_ehb(pp); 320 320 321 321 /* Check whether the pipeline stalled due to the FSB being full */ ··· 467 467 Index_Writeback_Inv_D, lbl_flushdcache); 468 468 469 469 /* Barrier ensuring previous cache invalidates are complete */ 470 - uasm_i_sync(&p, stype_memory); 470 + uasm_i_sync(&p, STYPE_SYNC); 471 471 uasm_i_ehb(&p); 472 472 473 473 /* ··· 480 480 uasm_i_lw(&p, t0, 0, r_pcohctl); 481 481 482 482 /* Barrier to ensure write to coherence control is complete */ 483 - uasm_i_sync(&p, stype_intervention); 483 + uasm_i_sync(&p, STYPE_SYNC); 484 484 uasm_i_ehb(&p); 485 485 486 486 /* Disable coherence */ ··· 526 526 } 527 527 528 528 /* Barrier to ensure write to CPC command is complete */ 529 - uasm_i_sync(&p, stype_memory); 529 + uasm_i_sync(&p, STYPE_SYNC); 530 530 uasm_i_ehb(&p); 531 531 } 532 532 ··· 561 561 uasm_i_lw(&p, t0, 0, r_pcohctl); 562 562 563 563 /* Barrier to ensure write to coherence control is complete */ 564 - uasm_i_sync(&p, stype_memory); 564 + uasm_i_sync(&p, STYPE_SYNC); 565 565 uasm_i_ehb(&p); 566 566 567 567 if (coupled_coherence && (state == CPS_PM_NC_WAIT)) {