RISC-V: Define get_cycles64() regardless of M-mode
authorPalmer Dabbelt <palmerdabbelt@google.com>
Wed, 25 Nov 2020 19:57:03 +0000 (11:57 -0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Fri, 11 Dec 2020 01:39:43 +0000 (17:39 -0800)
The timer driver uses get_cycles64() unconditionally to obtain the current
time.  A recent refactoring lost the common definition for some configs, which
is now the only one we need.

Fixes: d5be89a8d118 ("RISC-V: Resurrect the MMIO timer implementation for M-mode systems")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/timex.h

index ab104905d4dbb318b587781506cc2565d5b37daa..81de51e6aa32b3e6690bad5bb7ed6ebe206029cd 100644 (file)
@@ -60,6 +60,8 @@ static inline u32 get_cycles_hi(void)
 }
 #define get_cycles_hi get_cycles_hi
 
+#endif /* !CONFIG_RISCV_M_MODE */
+
 #ifdef CONFIG_64BIT
 static inline u64 get_cycles64(void)
 {
@@ -79,8 +81,6 @@ static inline u64 get_cycles64(void)
 }
 #endif /* CONFIG_64BIT */
 
-#endif /* !CONFIG_RISCV_M_MODE */
-
 #define ARCH_HAS_READ_CURRENT_TIMER
 static inline int read_current_timer(unsigned long *timer_val)
 {