Skip to contentSkip to conversation

cpufreq: qcom-cpufreq-hw: Fix 'make allmodconfig' build

PATCH In review Valdis Klētnieks 3 participants 6 messages Aug 22, 2021 – Aug 25, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: qcom-cpufreq-hw: Fix 'make allmodconfig' build

Commit 86afc1df661a adds a reference to a symbol that doesn't have an EXPORT_SYMBOL, which fails if qcom-cpufreq-hw is built as a module.

ERROR: modpost: "topology_set_thermal_pressure" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!

Add the missing EXPORT_SYMBOL.

Fixes 86afc1df661a ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support")

---

drivers/base/arch_topology.c +1 -0
index 921312a8d957..fbc39ca67124 100644
@@ -165,6 +165,7 @@ void topology_set_thermal_pressure(const struct cpumask *cpus,
 	for_each_cpu(cpu, cpus)
 		WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
 }
+EXPORT_SYMBOL(topology_set_thermal_pressure);
 
 static ssize_t cpu_capacity_show(struct device *dev,
 				 struct device_attribute *attr,
#1 lore raw
Quoted 16 lines · Valdis Klētnieks

Commit 86afc1df661a adds a reference to a symbol that doesn't have an EXPORT_SYMBOL, which fails if qcom-cpufreq-hw is built as a module.

ERROR: modpost: "topology_set_thermal_pressure" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!

Add the missing EXPORT_SYMBOL.

Fixes 86afc1df661a ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support")

---

drivers/base/arch_topology.c +0 -0
index 921312a8d957..fbc39ca67124 100644

drivers/base/arch_topology.c void topology_set_thermal_pressure(const struct cpumask *cpus, · line 171

Quoted 7 lines
drivers/base/arch_topology.c +1 -0
@@ -165,6 +165,7 @@ void topology_set_thermal_pressure(const struct cpumask *cpus,
  	for_each_cpu(cpu, cpus)
  		WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
  }
+EXPORT_SYMBOL(topology_set_thermal_pressure);
 
  static ssize_t cpu_capacity_show(struct device *dev,
  				 struct device_attribute *attr,

Hi Valdis,

This fixes one build error for me but I am still seeing another one:

ERROR: modpost: "cpu_scale" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!

thanks.

Signature · 1 line
~Randy
#2 lore raw
Quoted 3 lines · Randy Dunlap

This fixes one build error for me but I am still seeing another one:

ERROR: modpost: "cpu_scale" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!

That's a different patch, am working on fixing that one now..

#3 lore raw

Hi,

Quoted 10 lines · On Sun, 22 Aug 2021 17:14:04 -0400 "Valdis Klētnieks"…

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

Quoted 3 lines · Randy Dunlap

This fixes one build error for me but I am still seeing another one:

ERROR: modpost: "cpu_scale" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!

That's a different patch, am working on fixing that one now..

I didn't take a deep look here, so I unsure if this is an appropriate fix, but I was able to work-around this issue for my use case with below change.

```
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -149,6 +149,7 @@ void topology_set_freq_scale(const struct cpumask *cpus, unsigned long cur_freq,
 }

 DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE;
+EXPORT_PER_CPU_SYMBOL_GPL(cpu_scale);

 void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity)
 {
```

Thanks,
SJ

#4 lore raw
Quoted 10 lines · SeongJae Park
Quoted 3 lines
Quoted 1 line

ERROR: modpost: "cpu_scale" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!

That's a different patch, am working on fixing that one now..

I didn't take a deep look here, so I unsure if this is an appropriate fix, but I was able to work-around this issue for my use case with below change.

DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE;
+EXPORT_PER_CPU_SYMBOL_GPL(cpu_scale);

Aha. That's the part I wasn't finding. Would you like to submit your patch, or shall I send it in with a "Suggested-by" for you?

#5 lore raw

From: SeongJae Park <[email protected]>

Quoted 10 lines · On Tue, 24 Aug 2021 22:16:04 -0400 "Valdis Klētnieks"…
Quoted 7 lines · SeongJae Park
Quoted 3 lines
Quoted 1 line

ERROR: modpost: "cpu_scale" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!

That's a different patch, am working on fixing that one now..

I didn't take a deep look here, so I unsure if this is an appropriate fix, but I was able to work-around this issue for my use case with below change.

Quoted 5 lines
Quoted 2 lines

DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE;
+EXPORT_PER_CPU_SYMBOL_GPL(cpu_scale);

Aha. That's the part I wasn't finding. Would you like to submit your patch, or shall I send it in with a "Suggested-by" for you?

I'd prefer 'Suggested-by', as I didn't take a deep look here.

Thanks,
SJ