Skip to contentSkip to conversation

arm64: kernel: compiling issue, need 'EXPORT_SYMBOL_GPL(read_current_timer)'

PATCH Superseded Chen Gang 3 participants 17 messages May 20, 2013 – Jun 13, 2013

Subsystems (2)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arm64: kernel: compiling issue, need 'EXPORT_SYMBOL_GPL(read_current_timer)'

Need 'EXPORT_SYMBOL_GPL(read_current_timer)' if build with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/kernel/time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm64/kernel/time.c +1 -0
index a551f88..7fcba80 100644
@@ -73,6 +73,7 @@ int read_current_timer(unsigned long *timer_value)
 	*timer_value = arch_timer_read_counter();
 	return 0;
 }
+EXPORT_SYMBOL_GPL(read_current_timer);
 
 void __init time_init(void)
 {
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 19 lines · Chen Gang

Need 'EXPORT_SYMBOL_GPL(read_current_timer)' if build with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/kernel/time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm64/kernel/time.c +0 -0
index a551f88..7fcba80 100644

arch/arm64/kernel/time.c int read_current_timer(unsigned long *timer_value) · line 79

Quoted 7 lines
arch/arm64/kernel/time.c +1 -0
@@ -73,6 +73,7 @@ int read_current_timer(unsigned long *timer_value)
 	*timer_value = arch_timer_read_counter();
 	return 0;
 }
+EXPORT_SYMBOL_GPL(read_current_timer);
 
 void __init time_init(void)
 {

While this solves the problem, I'm not sure this is the best fix. The real issue is with get_cycles, which is a macro around read_current_timer.

AArch32 exports it because of the number of timer implementations. On arm64, we should be able to just return CNTVCT_EL0.

Catalin, Will, what do you think?

        M.
Signature · 1 line
Fast, cheap, reliable. Pick two.
#2 lore raw
Quoted 32 lines · Marc Zyngier
Quoted 19 lines · Chen Gang

Need 'EXPORT_SYMBOL_GPL(read_current_timer)' if build with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/kernel/time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm64/kernel/time.c +0 -0
index a551f88..7fcba80 100644

arch/arm64/kernel/time.c int read_current_timer(unsigned long *timer_value) · line 79

Quoted 7 lines
arch/arm64/kernel/time.c +1 -0
@@ -73,6 +73,7 @@ int read_current_timer(unsigned long *timer_value)
 	*timer_value = arch_timer_read_counter();
 	return 0;
 }
+EXPORT_SYMBOL_GPL(read_current_timer);
 
 void __init time_init(void)
 {

While this solves the problem, I'm not sure this is the best fix. The real issue is with get_cycles, which is a macro around read_current_timer.

Quoted 4 lines

AArch32 exports it because of the number of timer implementations. On arm64, we should be able to just return CNTVCT_EL0.

Catalin, Will, what do you think?

Should be ok once the arch timer driver has moved exclusively to virtual time. I'm also not sure we even need to implement read_current_timer() -- it's only used for delay-loop calibration, which we don't need for the arch timer.

Will

author
#3 lore raw
Quoted 36 lines · Will Deacon
Quoted 35 lines · Marc Zyngier
Quoted 19 lines · Chen Gang

Need 'EXPORT_SYMBOL_GPL(read_current_timer)' if build with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/kernel/time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm64/kernel/time.c +0 -0
index a551f88..7fcba80 100644

arch/arm64/kernel/time.c int read_current_timer(unsigned long *timer_value) · line 79

Quoted 7 lines
arch/arm64/kernel/time.c +1 -0
@@ -73,6 +73,7 @@ int read_current_timer(unsigned long *timer_value)
 	*timer_value = arch_timer_read_counter();
 	return 0;
 }
+EXPORT_SYMBOL_GPL(read_current_timer);
 
 void __init time_init(void)
 {

While this solves the problem, I'm not sure this is the best fix. The real issue is with get_cycles, which is a macro around read_current_timer.

AArch32 exports it because of the number of timer implementations. On arm64, we should be able to just return CNTVCT_EL0.

Quoted 7 lines
Quoted 1 line

Catalin, Will, what do you think?

Should be ok once the arch timer driver has moved exclusively to virtual time. I'm also not sure we even need to implement read_current_timer() -- it's only used for delay-loop calibration, which we don't need for the arch timer.

For whether we need implement read_current_timer():

many platforms have implemented it (openrisc, arm, sparc, hexagon, avr32, x86). it is called by init/calibrate.c when 'ARCH_HAS_READ_CURRENT_TIMER' is defined. since arm64 can implement it, better to provide it as an architect features to let outside use.

For the implementation of read_current_timer():

it has to face various configurations
(e.g. CONFIG_ARM_ARCH_TIMER, arch_timer_read_zero, arch_counter_get_cntvct, arch_counter_get_cntpct)
so better still use variable instead of.
(excuse me, I do not know what is 'CNTVCT_EL0', is it like a constant number ?)

For the implementation of get_cycles()

if read_current_timer() is provided,
better to let get_cycles() to call it, instead of implement once again.

Thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
#4 lore raw
Quoted 36 lines · Chen Gang
Quoted 35 lines · Will Deacon
Quoted 34 lines · Marc Zyngier
Quoted 20 lines · Chen Gang

Need 'EXPORT_SYMBOL_GPL(read_current_timer)' if build with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/kernel/time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm64/kernel/time.c +0 -0
index a551f88..7fcba80 100644

arch/arm64/kernel/time.c int read_current_timer(unsigned long *timer_value) · line 79

Quoted 7 lines
arch/arm64/kernel/time.c +1 -0
@@ -73,6 +73,7 @@ int read_current_timer(unsigned long *timer_value)
 	*timer_value = arch_timer_read_counter();
 	return 0;
 }
+EXPORT_SYMBOL_GPL(read_current_timer);
 
 void __init time_init(void)
 {

While this solves the problem, I'm not sure this is the best fix. The real
issue is with get_cycles, which is a macro around read_current_timer.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

AArch32 exports it because of the number of timer implementations. On arm64, we should be able to just return CNTVCT_EL0.

Catalin, Will, what do you think?

Should be ok once the arch timer driver has moved exclusively to

virtual

Quoted 1 line
Quoted 1 line

time. I'm also not sure we even need to implement read_current_timer()

--

Quoted 4 lines
Quoted 3 lines

it's only used for delay-loop calibration, which we don't need for the arch timer.

Quoted 8 lines

For whether we need implement read_current_timer():

many platforms have implemented it (openrisc, arm, sparc, hexagon, avr32, x86).
it is called by init/calibrate.c when 'ARCH_HAS_READ_CURRENT_TIMER' is defined.
since arm64 can implement it, better to provide it as an architect features to let outside use.

Nobody disputes the interest of read_current_timer.

Quoted 7 lines

For the implementation of read_current_timer():

it has to face various configurations
(e.g. CONFIG_ARM_ARCH_TIMER, arch_timer_read_zero, arch_counter_get_cntvct, arch_counter_get_cntpct)
so better still use variable instead of.
(excuse me, I do not know what is 'CNTVCT_EL0', is it like a

constant

Quoted 1 line

number ?)

Architected timer is mandatory on arm64, so we can always rely on it it be present. CNTVCT_EL0 is the system register accessing the Virtual Counter, which is basically what read_current_timer() returns.

Quoted 4 lines

For the implementation of get_cycles()

if read_current_timer() is provided,
better to let get_cycles() to call it, instead of implement once

again.

There is certainly some value in reusing existing code, but in this particular case we can simply inline two instructions (isb + mrs cntvct_el0), and I'm not even completely sure about the isb.

        M.
Signature · 1 line
Fast, cheap, reliable. Pick two.
author
#5 lore raw
Quoted 53 lines · Marc Zyngier
Quoted 36 lines · Chen Gang
Quoted 35 lines · Will Deacon
Quoted 34 lines · Marc Zyngier
Quoted 20 lines · Chen Gang

Need 'EXPORT_SYMBOL_GPL(read_current_timer)' if build with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/kernel/time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm64/kernel/time.c +0 -0
index a551f88..7fcba80 100644

arch/arm64/kernel/time.c int read_current_timer(unsigned long *timer_value) · line 79

Quoted 7 lines
arch/arm64/kernel/time.c +1 -0
@@ -73,6 +73,7 @@ int read_current_timer(unsigned long *timer_value)
 	*timer_value = arch_timer_read_counter();
 	return 0;
 }
+EXPORT_SYMBOL_GPL(read_current_timer);
 
 void __init time_init(void)
 {

While this solves the problem, I'm not sure this is the best fix. The real
issue is with get_cycles, which is a macro around read_current_timer.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

AArch32 exports it because of the number of timer implementations. On arm64, we should be able to just return CNTVCT_EL0.

Catalin, Will, what do you think?

Should be ok once the arch timer driver has moved exclusively to

virtual

Quoted 1 line
Quoted 1 line

time. I'm also not sure we even need to implement read_current_timer()

--

Quoted 6 lines
Quoted 3 lines

it's only used for delay-loop calibration, which we don't need for the arch timer.

For whether we need implement read_current_timer():

Quoted 9 lines
Quoted 6 lines

many platforms have implemented it (openrisc, arm, sparc, hexagon, avr32, x86).
it is called by init/calibrate.c when 'ARCH_HAS_READ_CURRENT_TIMER' is defined.
since arm64 can implement it, better to provide it as an architect features to let outside use.

Nobody disputes the interest of read_current_timer.

It is for Will said "I'm also not sure we even need to implement read_current_timer()".

I think we still need it.

Quoted 7 lines
Quoted 7 lines

For the implementation of read_current_timer():

it has to face various configurations
(e.g. CONFIG_ARM_ARCH_TIMER, arch_timer_read_zero, arch_counter_get_cntvct, arch_counter_get_cntpct)
so better still use variable instead of.
(excuse me, I do not know what is 'CNTVCT_EL0', is it like a

Quoted 7 lines

constant

Quoted 1 line

number ?)

Architected timer is mandatory on arm64, so we can always rely on it it be present. CNTVCT_EL0 is the system register accessing the Virtual Counter, which is basically what read_current_timer() returns.

OK, thanks. for CNTVCT_EL0, can we use arch_counter_get_cntvct() which is defined in "arch/arm64/include/asm/arch_timer.h" ?

Quoted 10 lines
Quoted 4 lines

For the implementation of get_cycles()

if read_current_timer() is provided,
better to let get_cycles() to call it, instead of implement once

again.

There is certainly some value in reusing existing code, but in this particular case we can simply inline two instructions (isb + mrs cntvct_el0), and I'm not even completely sure about the isb.

OK, thanks.

So, how about the fix below :)

------------------------diff begin-------------------------------

arch/arm64/include/asm/timex.h +3 -1
index b24a31a..768ba44 100644
@@ -16,11 +16,13 @@
 #ifndef __ASM_TIMEX_H
 #define __ASM_TIMEX_H
 
+#include <asm/arch_timer.h>
+
 /*
  * Use the current timer as a cycle counter since this is what we use for
  * the delay loop.
  */
-#define get_cycles()	({ cycles_t c; read_current_timer(&c); c; })
+#define get_cycles()	arch_counter_get_cntvct()
 
 #include <asm-generic/timex.h>
 
arch/arm64/kernel/time.c +2 -1
index a551f88..6d7ce08 100644
@@ -38,6 +38,7 @@
 
 #include <asm/thread_info.h>
 #include <asm/stacktrace.h>
+#include <asm/arch_timer.h>
 
 #ifdef CONFIG_SMP
 unsigned long profile_pc(struct pt_regs *regs)
@@ -70,7 +71,7 @@ unsigned long long notrace sched_clock(void)
 
 int read_current_timer(unsigned long *timer_value)
 {
-	*timer_value = arch_timer_read_counter();
+	*timer_value = arch_counter_get_cntvct();
 	return 0;
 }
 

------------------------diff end---------------------------------

Signature · 3 lines
Chen Gang

Asianux Corporation
#6 lore raw
Quoted 61 lines · Chen Gang
Quoted 60 lines · Marc Zyngier
Quoted 36 lines · Chen Gang
Quoted 35 lines · Will Deacon
Quoted 34 lines · Marc Zyngier
Quoted 20 lines · Chen Gang

Need 'EXPORT_SYMBOL_GPL(read_current_timer)' if build with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/kernel/time.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm64/kernel/time.c +0 -0
index a551f88..7fcba80 100644

arch/arm64/kernel/time.c int read_current_timer(unsigned long *timer_value) · line 79

Quoted 7 lines
arch/arm64/kernel/time.c +1 -0
@@ -73,6 +73,7 @@ int read_current_timer(unsigned long *timer_value)
 	*timer_value = arch_timer_read_counter();
 	return 0;
 }
+EXPORT_SYMBOL_GPL(read_current_timer);
 
 void __init time_init(void)
 {

While this solves the problem, I'm not sure this is the best fix. The real
issue is with get_cycles, which is a macro around read_current_timer.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

AArch32 exports it because of the number of timer implementations. On arm64, we should be able to just return CNTVCT_EL0.

Catalin, Will, what do you think?

Should be ok once the arch timer driver has moved exclusively to

virtual

Quoted 1 line
Quoted 1 line

time. I'm also not sure we even need to implement read_current_timer()

--

Quoted 12 lines
Quoted 3 lines

it's only used for delay-loop calibration, which we don't need for the arch timer.

For whether we need implement read_current_timer():

many platforms have implemented it (openrisc, arm, sparc, hexagon, avr32, x86).
it is called by init/calibrate.c when 'ARCH_HAS_READ_CURRENT_TIMER' is defined.
since arm64 can implement it, better to provide it as an architect features to let outside use.

Quoted 7 lines
Quoted 2 lines

Nobody disputes the interest of read_current_timer.

It is for Will said "I'm also not sure we even need to implement read_current_timer()".

I think we still need it.

Not really. The only use of read_current_timer is for calibrating the delay loop, and we just do not need this, because we can actually rely on the timer to give us an accurate timing information.

Quoted 10 lines
Quoted 10 lines
Quoted 7 lines

For the implementation of read_current_timer():

it has to face various configurations
(e.g. CONFIG_ARM_ARCH_TIMER, arch_timer_read_zero, arch_counter_get_cntvct, arch_counter_get_cntpct)
so better still use variable instead of.
(excuse me, I do not know what is 'CNTVCT_EL0', is it like a

constant

Quoted 1 line

number ?)

Quoted 7 lines
Quoted 4 lines

Architected timer is mandatory on arm64, so we can always rely on it it be present. CNTVCT_EL0 is the system register accessing the Virtual Counter, which is basically what read_current_timer() returns.

OK, thanks. for CNTVCT_EL0, can we use arch_counter_get_cntvct() which is defined in "arch/arm64/include/asm/arch_timer.h" ?

Yes.

Quoted 50 lines
Quoted 10 lines
Quoted 4 lines

For the implementation of get_cycles()

if read_current_timer() is provided,
better to let get_cycles() to call it, instead of implement once

again.

There is certainly some value in reusing existing code, but in this particular case we can simply inline two instructions (isb + mrs cntvct_el0), and I'm not even completely sure about the isb.

OK, thanks.

So, how about the fix below :)

------------------------diff begin-------------------------------

arch/arm64/include/asm/timex.h +3 -1
index b24a31a..768ba44 100644
@@ -16,11 +16,13 @@
 #ifndef __ASM_TIMEX_H
 #define __ASM_TIMEX_H
 
+#include <asm/arch_timer.h>
+
 /*
  * Use the current timer as a cycle counter since this is what we use for
  * the delay loop.
  */
-#define get_cycles()	({ cycles_t c; read_current_timer(&c); c; })
+#define get_cycles()	arch_counter_get_cntvct()
 
 #include <asm-generic/timex.h>
 
arch/arm64/kernel/time.c +1 -0
index a551f88..6d7ce08 100644
@@ -38,6 +38,7 @@
 
 #include <asm/thread_info.h>
 #include <asm/stacktrace.h>
+#include <asm/arch_timer.h>
 
 #ifdef CONFIG_SMP
 unsigned long profile_pc(struct pt_regs *regs)

arch/arm64/kernel/time.c unsigned long long notrace sched_clock(void)

Quoted 10 lines
arch/arm64/kernel/time.c +1 -2
@@ -70,7 +71,7 @@ unsigned long long notrace sched_clock(void)
 
 int read_current_timer(unsigned long *timer_value)
 {
-	*timer_value = arch_timer_read_counter();
+	*timer_value = arch_counter_get_cntvct();
 	return 0;
 }
 
 
------------------------diff end---------------------------------

I think you should try to implement Will's suggestion and drop read_current_timer (and the ARCH_HAS_READ_CURRENT_TIMER macro) altogether.

It would be a much better fix.

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
author
#7 lore raw
Quoted 4 lines · Marc Zyngier

I think you should try to implement Will's suggestion and drop read_current_timer (and the ARCH_HAS_READ_CURRENT_TIMER macro) altogether.

It would be a much better fix.

OK, thanks. I will send patch v2.

Signature · 3 lines
Chen Gang

Asianux Corporation
#8 lore raw
In reply to Chen Gang
Quoted 7 lines · Chen Gang
Quoted 5 lines · Will Deacon

Should be ok once the arch timer driver has moved exclusively to virtual time. I'm also not sure we even need to implement read_current_timer() -- it's only used for delay-loop calibration, which we don't need for the arch timer.

Quoted 5 lines

For whether we need implement read_current_timer():

many platforms have implemented it (openrisc, arm, sparc, hexagon, avr32, x86). it is called by init/calibrate.c when 'ARCH_HAS_READ_CURRENT_TIMER' is defined. since arm64 can implement it, better to provide it as an architect features to let outside use.

No, that code is not needed on arm64 because we calibrate the delay loop statically using a known timer frequency.

Quoted 6 lines

For the implementation of read_current_timer():

it has to face various configurations
(e.g. CONFIG_ARM_ARCH_TIMER, arch_timer_read_zero, arch_counter_get_cntvct, arch_counter_get_cntpct)
so better still use variable instead of.
(excuse me, I do not know what is 'CNTVCT_EL0', is it like a constant number ?)

cntvct_el0 is a system register, which provides the virtual counter value.

Quoted 4 lines

For the implementation of get_cycles()

if read_current_timer() is provided,
better to let get_cycles() to call it, instead of implement once again.

You can implement it as a macro if you like, I'm just suggesting that we might not need read_current_timer after all.

Will

author
#9 lore raw
Quoted 28 lines · Will Deacon
Quoted 7 lines · Chen Gang
Quoted 5 lines · Will Deacon

Should be ok once the arch timer driver has moved exclusively to virtual time. I'm also not sure we even need to implement read_current_timer() -- it's only used for delay-loop calibration, which we don't need for the arch timer.

Quoted 5 lines

For whether we need implement read_current_timer():

many platforms have implemented it (openrisc, arm, sparc, hexagon, avr32, x86). it is called by init/calibrate.c when 'ARCH_HAS_READ_CURRENT_TIMER' is defined. since arm64 can implement it, better to provide it as an architect features to let outside use.

No, that code is not needed on arm64 because we calibrate the delay loop statically using a known timer frequency.

Quoted 6 lines

For the implementation of read_current_timer():

it has to face various configurations
(e.g. CONFIG_ARM_ARCH_TIMER, arch_timer_read_zero, arch_counter_get_cntvct, arch_counter_get_cntpct)
so better still use variable instead of.
(excuse me, I do not know what is 'CNTVCT_EL0', is it like a constant number ?)

cntvct_el0 is a system register, which provides the virtual counter value.

Quoted 2 lines

For the implementation of get_cycles()

Quoted 9 lines
Quoted 2 lines

if read_current_timer() is provided,
better to let get_cycles() to call it, instead of implement once again.

You can implement it as a macro if you like, I'm just suggesting that we might not need read_current_timer after all.

Will

Thanks, I should try patch v2. :-)

Signature · 3 lines
Chen Gang

Asianux Corporation
author
#10 lore raw

PATCH v2 1/1 arm64: kernel: compiling issue, need delete read_current_timer().

In reply to Will Deacon

Under arm64, we will calibrate the delay loop statically using a known timer frequency, so delete read_current_timer(), or it will cause compiling issue with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/include/asm/timex.h |    6 +++---
 arch/arm64/kernel/time.c       |    6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)
arch/arm64/include/asm/timex.h +3 -3
index b24a31a..81a076e 100644
@@ -16,14 +16,14 @@
 #ifndef __ASM_TIMEX_H
 #define __ASM_TIMEX_H
 
+#include <asm/arch_timer.h>
+
 /*
  * Use the current timer as a cycle counter since this is what we use for
  * the delay loop.
  */
-#define get_cycles()	({ cycles_t c; read_current_timer(&c); c; })
+#define get_cycles()	arch_counter_get_cntvct()
 
 #include <asm-generic/timex.h>
 
-#define ARCH_HAS_READ_CURRENT_TIMER
-
 #endif
arch/arm64/kernel/time.c +0 -6
index a551f88..03dc371 100644
@@ -68,12 +68,6 @@ unsigned long long notrace sched_clock(void)
 	return arch_timer_read_counter() * sched_clock_mult;
 }
 
-int read_current_timer(unsigned long *timer_value)
-{
-	*timer_value = arch_timer_read_counter();
-	return 0;
-}
-
 void __init time_init(void)
 {
 	u32 arch_timer_rate;
Signature · 1 line
1.7.7.6
author
#11 lore raw

Re: [PATCH v2] arm64: kernel: compiling issue, need delete read_current_timer().

Hello Maintainers:

Please help check this patch whether OK, when you have time.

Thanks.

Quoted 58 lines · Chen Gang

Under arm64, we will calibrate the delay loop statically using a known timer frequency, so delete read_current_timer(), or it will cause compiling issue with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/include/asm/timex.h |    6 +++---
 arch/arm64/kernel/time.c       |    6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)
arch/arm64/include/asm/timex.h +3 -3
index b24a31a..81a076e 100644
@@ -16,14 +16,14 @@
 #ifndef __ASM_TIMEX_H
 #define __ASM_TIMEX_H
 
+#include <asm/arch_timer.h>
+
 /*
  * Use the current timer as a cycle counter since this is what we use for
  * the delay loop.
  */
-#define get_cycles()	({ cycles_t c; read_current_timer(&c); c; })
+#define get_cycles()	arch_counter_get_cntvct()
 
 #include <asm-generic/timex.h>
 
-#define ARCH_HAS_READ_CURRENT_TIMER
-
 #endif
arch/arm64/kernel/time.c +0 -6
index a551f88..03dc371 100644
@@ -68,12 +68,6 @@ unsigned long long notrace sched_clock(void)
 	return arch_timer_read_counter() * sched_clock_mult;
 }
 
-int read_current_timer(unsigned long *timer_value)
-{
-	*timer_value = arch_timer_read_counter();
-	return 0;
-}
-
 void __init time_init(void)
 {
 	u32 arch_timer_rate;
Signature · 3 lines
Chen Gang

Asianux Corporation
author
#12 lore raw

Re: [PATCH v2] arm64: kernel: compiling issue, need delete read_current_timer().

Hello Maintainers:

Please help check it, when you have time.

Thanks.

Quoted 67 lines · Chen Gang

Hello Maintainers:

Please help check this patch whether OK, when you have time.

Thanks.

Quoted 58 lines · Chen Gang

Under arm64, we will calibrate the delay loop statically using a known timer frequency, so delete read_current_timer(), or it will cause compiling issue with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/include/asm/timex.h |    6 +++---
 arch/arm64/kernel/time.c       |    6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)
arch/arm64/include/asm/timex.h +3 -3
index b24a31a..81a076e 100644
@@ -16,14 +16,14 @@
 #ifndef __ASM_TIMEX_H
 #define __ASM_TIMEX_H
 
+#include <asm/arch_timer.h>
+
 /*
  * Use the current timer as a cycle counter since this is what we use for
  * the delay loop.
  */
-#define get_cycles()	({ cycles_t c; read_current_timer(&c); c; })
+#define get_cycles()	arch_counter_get_cntvct()
 
 #include <asm-generic/timex.h>
 
-#define ARCH_HAS_READ_CURRENT_TIMER
-
 #endif
arch/arm64/kernel/time.c +0 -6
index a551f88..03dc371 100644
@@ -68,12 +68,6 @@ unsigned long long notrace sched_clock(void)
 	return arch_timer_read_counter() * sched_clock_mult;
 }
 
-int read_current_timer(unsigned long *timer_value)
-{
-	*timer_value = arch_timer_read_counter();
-	return 0;
-}
-
 void __init time_init(void)
 {
 	u32 arch_timer_rate;
Signature · 3 lines
Chen Gang

Asianux Corporation
#13 lore raw

Re: [PATCH v2] arm64: kernel: compiling issue, need delete read_current_timer().

Quoted 3 lines · Chen Gang

Hello Maintainers:

Please help check it, when you have time.

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Under arm64, we will calibrate the delay loop statically using a known timer frequency, so delete read_current_timer(), or it will cause compiling issue with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
---
 arch/arm64/include/asm/timex.h |    6 +++---
 arch/arm64/kernel/time.c       |    6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)

Looks ok to me. We'll take it for a spin and apply it if it doesn't catch fire.

Will

author
#14 lore raw

Re: [PATCH v2] arm64: kernel: compiling issue, need delete read_current_timer().

Quoted 6 lines · Will Deacon
Quoted 3 lines · Chen Gang
Quoted 3 lines

Hello Maintainers:

Please help check it, when you have time.

[...]

OK, thanks.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Under arm64, we will calibrate the delay loop statically using a known timer frequency, so delete read_current_timer(), or it will cause compiling issue with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
---
 arch/arm64/include/asm/timex.h |    6 +++---
 arch/arm64/kernel/time.c       |    6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)

Looks ok to me. We'll take it for a spin and apply it if it doesn't catch fire.

Really need a carefully checking.

Thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
Acked-by
#15 lore raw

Re: [PATCH v2] arm64: kernel: compiling issue, need delete read_current_timer().

In reply to Chen Gang
Quoted 62 lines · Chen Gang

Hello Maintainers:

Please help check it, when you have time.

Thanks.

Quoted 55 lines · Chen Gang

Hello Maintainers:

Please help check this patch whether OK, when you have time.

Thanks.

Quoted 48 lines · Chen Gang

Under arm64, we will calibrate the delay loop statically using a known timer frequency, so delete read_current_timer(), or it will cause compiling issue with allmodconfig.

The related error:
ERROR: "read_current_timer" [lib/rbtree_test.ko] undefined!
ERROR: "read_current_timer" [lib/interval_tree_test.ko] undefined!
ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!

---
 arch/arm64/include/asm/timex.h |    6 +++---
 arch/arm64/kernel/time.c       |    6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)
arch/arm64/include/asm/timex.h +3 -3
index b24a31a..81a076e 100644
@@ -16,14 +16,14 @@
 #ifndef __ASM_TIMEX_H
 #define __ASM_TIMEX_H
 
+#include <asm/arch_timer.h>
+
 /*
  * Use the current timer as a cycle counter since this is what we use for
  * the delay loop.
  */
-#define get_cycles()	({ cycles_t c; read_current_timer(&c); c; })
+#define get_cycles()	arch_counter_get_cntvct()
 
 #include <asm-generic/timex.h>
 
-#define ARCH_HAS_READ_CURRENT_TIMER
-
 #endif
arch/arm64/kernel/time.c +0 -0
index a551f88..03dc371 100644
@@ -68,12 +68,6 @@ unsigned long long notrace sched_clock(void)
 	return arch_timer_read_counter() * sched_clock_mult;
 }
 
Quoted 9 lines
Quoted 9 lines

arch/arm64/kernel/time.c unsigned long long notrace sched_clock(void) · line 73

Quoted 9 lines
arch/arm64/kernel/time.c +0 -6
-int read_current_timer(unsigned long *timer_value)
-{
-	*timer_value = arch_timer_read_counter();
-	return 0;
-}
-
 void __init time_init(void)
 {
 	u32 arch_timer_rate;

Sorry for the delay replying. This looks good to me.

FWIW:

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
author
#16 lore raw

Re: [PATCH v2] arm64: kernel: compiling issue, need delete read_current_timer().

Quoted 4 lines · Marc Zyngier

Sorry for the delay replying. This looks good to me.

FWIW:

Thanks, also sorry for my delay replying.

Signature · 3 lines
Chen Gang

Asianux Corporation