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

MIPS: pm-cps: Update comments on barrier instructions

This code makes large use of barriers, which had quite vague
descriptions. Update the comments to make the choice of barrier and
reason for it more clear.

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: Kees Cook <keescook@chromium.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14220/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Matt Redfearn and committed by
Ralf Baechle
f6b43d93 b97d0b90

+8 -8
+8 -8
arch/mips/kernel/pm-cps.c
··· 315 315 i * line_size * line_stride, t0); 316 316 } 317 317 318 - /* Completion barrier */ 318 + /* Barrier ensuring previous cache invalidates are complete */ 319 319 uasm_i_sync(pp, stype_memory); 320 320 uasm_i_ehb(pp); 321 321 ··· 414 414 uasm_il_beqz(&p, &r, t2, lbl_incready); 415 415 uasm_i_addiu(&p, t1, t1, 1); 416 416 417 - /* Ordering barrier */ 417 + /* Barrier ensuring all CPUs see the updated r_nc_count value */ 418 418 uasm_i_sync(&p, stype_ordering); 419 419 420 420 /* ··· 467 467 cps_gen_cache_routine(&p, &l, &r, &cpu_data[cpu].dcache, 468 468 Index_Writeback_Inv_D, lbl_flushdcache); 469 469 470 - /* Completion barrier */ 470 + /* Barrier ensuring previous cache invalidates are complete */ 471 471 uasm_i_sync(&p, stype_memory); 472 472 uasm_i_ehb(&p); 473 473 ··· 480 480 uasm_i_sw(&p, t0, 0, r_pcohctl); 481 481 uasm_i_lw(&p, t0, 0, r_pcohctl); 482 482 483 - /* Sync to ensure previous interventions are complete */ 483 + /* Barrier to ensure write to coherence control is complete */ 484 484 uasm_i_sync(&p, stype_intervention); 485 485 uasm_i_ehb(&p); 486 486 ··· 526 526 goto gen_done; 527 527 } 528 528 529 - /* Completion barrier */ 529 + /* Barrier to ensure write to CPC command is complete */ 530 530 uasm_i_sync(&p, stype_memory); 531 531 uasm_i_ehb(&p); 532 532 } ··· 561 561 uasm_i_sw(&p, t0, 0, r_pcohctl); 562 562 uasm_i_lw(&p, t0, 0, r_pcohctl); 563 563 564 - /* Completion barrier */ 564 + /* Barrier to ensure write to coherence control is complete */ 565 565 uasm_i_sync(&p, stype_memory); 566 566 uasm_i_ehb(&p); 567 567 ··· 575 575 uasm_il_beqz(&p, &r, t2, lbl_decready); 576 576 uasm_i_andi(&p, v0, t1, (1 << fls(smp_num_siblings)) - 1); 577 577 578 - /* Ordering barrier */ 578 + /* Barrier ensuring all CPUs see the updated r_nc_count value */ 579 579 uasm_i_sync(&p, stype_ordering); 580 580 } 581 581 ··· 597 597 */ 598 598 uasm_build_label(&l, p, lbl_secondary_cont); 599 599 600 - /* Ordering barrier */ 600 + /* Barrier ensuring all CPUs see the updated r_nc_count value */ 601 601 uasm_i_sync(&p, stype_ordering); 602 602 } 603 603