Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val

From: Kefeng Wang
Date: Tue May 19 2020 - 08:40:00 EST



On 2020/5/19 4:23, Daniel Lezcano wrote:
Hi Kefeng,

On 18/05/2020 17:40, Kefeng Wang wrote:
On 2020/5/18 22:09, Daniel Lezcano wrote:
On 13/05/2020 23:14, Palmer Dabbelt wrote:
On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@xxxxxxxxxx
wrote:
ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
---
ÂÂdrivers/clocksource/timer-riscv.c | 1 +
ÂÂ1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/timer-riscv.c
b/drivers/clocksource/timer-riscv.c
index c4f15c4068c0..071b8c144027 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -19,6 +19,7 @@

ÂÂu64 __iomem *riscv_time_cmp;
ÂÂu64 __iomem *riscv_time_val;
+EXPORT_SYMBOL(riscv_time_val);

ÂÂstatic inline void mmio_set_timer(u64 val)
ÂÂ{
Reviewed-by: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>
Acked-by: Palmer Dabbelt <palmerdabbelt@xxxxxxxxxx>

Adding the clocksource maintainers. Let me know if you want this
through my
tree, I'm assuming you want it through your tree.
How can we end up by an export symbol here ?!
Hi Danile,
s/Danile/Daniel/
Sorry for typing error.

Found this build error when CONFIG_RISCV_M_MODE=y and CONFIG_RISCV_SBI
is not,

see patch "4f9bbcefa142 riscv: add support for MMIO access to the timer
registers"
Thanks for the pointer.

The question still remains, how do we end up with this EXPORT_SYMBOL?

There is something wrong if the fix is an EXPORT_SYMBOL for a global
variable.

Not very clear, there are some global variable( eg, acpi_disabled, memstart_addr in arm64,) is exported by EXPORT_SYMBOL, do you mean that export riscv_time_val is wrong way?