Skip to contentSkip to conversation

LoongArch: Remove MIPS comment about cycle counter

PATCH In review Jason A. Donenfeld 3 participants 3 messages Jun 4, 2022 LoongArch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LoongArch: Remove MIPS comment about cycle counter

This comment block was taken originally from the MIPS architecture code, where indeed there are particular assumptions one can make regarding SMP and !SMP and cycle counters. On LoongArch, however, the rdtime family of functions is always available. As Xuerui wrote:

The rdtime family of instructions is in fact guaranteed to be available on LoongArch; LoongArch's subsets all contain them, even the 32-bit "Primary" subset intended for university teaching -- they provide the rdtimeh.w and rdtimel.w pair of instructions that access the same 64-bit counter.

So this commit simply removes the incorrect comment block.

Fixes b738c106f735 ("LoongArch: Add other common headers")
---
 arch/loongarch/include/asm/timex.h | 7 -------
 1 file changed, 7 deletions(-)
arch/loongarch/include/asm/timex.h +0 -7
index d3ed99a4fdbd..fb41e9e7a222 100644
@@ -12,13 +12,6 @@
 #include <asm/cpu.h>
 #include <asm/cpu-features.h>
 
-/*
- * Standard way to access the cycle counter.
- * Currently only used on SMP for scheduling.
- *
- * We know that all SMP capable CPUs have cycle counters.
- */
-
 typedef unsigned long cycles_t;
 
 #define get_cycles get_cycles
Signature · 1 line
2.35.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Jason A. Donenfeld

This comment block was taken originally from the MIPS architecture code, where indeed there are particular assumptions one can make regarding SMP and !SMP and cycle counters. On LoongArch, however, the rdtime family of functions is always available. As Xuerui wrote:

The rdtime family of instructions is in fact guaranteed to be available on LoongArch; LoongArch's subsets all contain them, even the 32-bit "Primary" subset intended for university teaching -- they provide the rdtimeh.w and rdtimel.w pair of instructions that access the same 64-bit counter.

So this commit simply removes the incorrect comment block.

Fixes b738c106f735 ("LoongArch: Add other common headers")
---
  arch/loongarch/include/asm/timex.h | 7 -------
  1 file changed, 7 deletions(-)
arch/loongarch/include/asm/timex.h +0 -0
index d3ed99a4fdbd..fb41e9e7a222 100644
@@ -12,13 +12,6 @@
  #include <asm/cpu.h>
  #include <asm/cpu-features.h>
 

arch/loongarch/include/asm/timex.h line 17

Quoted 10 lines
arch/loongarch/include/asm/timex.h +0 -7
-/*
- * Standard way to access the cycle counter.
- * Currently only used on SMP for scheduling.
- *
- * We know that all SMP capable CPUs have cycle counters.
- */
-
  typedef unsigned long cycles_t;
 
  #define get_cycles get_cycles

Just as previously discussed. Thanks for the quick fixup!

maintainer
#2 lore raw

Hi, Xuerui and Jason,

Thank you very much, this will be applied later in the loongarch-fixes branch.

Huacai

Quoted 44 lines · WANG Xuerui
Quoted 28 lines · Jason A. Donenfeld

This comment block was taken originally from the MIPS architecture code, where indeed there are particular assumptions one can make regarding SMP and !SMP and cycle counters. On LoongArch, however, the rdtime family of functions is always available. As Xuerui wrote:

The rdtime family of instructions is in fact guaranteed to be available on LoongArch; LoongArch's subsets all contain them, even the 32-bit "Primary" subset intended for university teaching -- they provide the rdtimeh.w and rdtimel.w pair of instructions that access the same 64-bit counter.

So this commit simply removes the incorrect comment block.

Fixes b738c106f735 ("LoongArch: Add other common headers")
---
  arch/loongarch/include/asm/timex.h | 7 -------
  1 file changed, 7 deletions(-)
arch/loongarch/include/asm/timex.h +0 -0
index d3ed99a4fdbd..fb41e9e7a222 100644
@@ -12,13 +12,6 @@
  #include <asm/cpu.h>
  #include <asm/cpu-features.h>
 

arch/loongarch/include/asm/timex.h line 17

Quoted 10 lines
arch/loongarch/include/asm/timex.h +0 -7
-/*
- * Standard way to access the cycle counter.
- * Currently only used on SMP for scheduling.
- *
- * We know that all SMP capable CPUs have cycle counters.
- */
-
  typedef unsigned long cycles_t;
 
  #define get_cycles get_cycles

Just as previously discussed. Thanks for the quick fixup!