Skip to contentSkip to conversation

powernv: cpufreq driver build fail for non-SMP

next Superseded Paul Gortmaker 3 participants 4 messages Apr 15, 2014 – Apr 16, 2014

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 cpufreq, powernv: Fix build failure on UP

Quoted 10 lines · Paul Gortmaker

Hi all,

This new driver is causing build fails on linux-next for non-SMP.

http://kisskb.ellerman.id.au/kisskb/buildresult/10911507/

I didn't bisect since there are only two commits in total. :)

Looks like some header foo where <linux/smp.h> is not getting <asm/smp.h>

Hi Paul,

Thanks a lot for reporting the build failure. Please find the fix below.

Regards,
Srivatsa S. Bhat

---------------------------------------------------------------------------

From: Srivatsa S. Bhat <[email protected]>
Subject: [PATCH] cpufreq, powernv: Fix build failure on UP

Paul Gortmaker reported the following build failure of the powernv cpufreq driver on UP configs:

drivers/cpufreq/powernv-cpufreq.c:241:2: error: implicit declaration of function 'cpu_sibling_mask' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/cpufreq/powernv-cpufreq.o] Error 1 make[2]: *** [drivers/cpufreq] Error 2
make[1]: *** [drivers] Error 2
make: *** [sub-make] Error 2

The trouble here is that cpu_sibling_mask is defined only in <asm/smp.h>, and <linux/smp.h> includes <asm/smp.h> only in SMP builds.

So fix this build failure by explicitly including <asm/smp.h> in the driver, so that we get the definition of cpu_sibling_mask even in UP configurations.

---

 drivers/cpufreq/powernv-cpufreq.c |    1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/powernv-cpufreq.c +1 -0
index 9edccc6..ed1c7e5 100644
@@ -29,6 +29,7 @@
 
 #include <asm/cputhreads.h>
 #include <asm/reg.h>
+#include <asm/smp.h>
 
 #define POWERNV_MAX_PSTATES	256
 
maintainer Acked-by on v1 1/1
#2 lore raw

Re: [PATCH] cpufreq, powernv: Fix build failure on UP

Quoted 32 lines · Srivatsa S. Bhat

From: Srivatsa S. Bhat <[email protected]>
Subject: [PATCH] cpufreq, powernv: Fix build failure on UP

Paul Gortmaker reported the following build failure of the powernv cpufreq driver on UP configs:

drivers/cpufreq/powernv-cpufreq.c:241:2: error: implicit declaration of function 'cpu_sibling_mask' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/cpufreq/powernv-cpufreq.o] Error 1 make[2]: *** [drivers/cpufreq] Error 2
make[1]: *** [drivers] Error 2
make: *** [sub-make] Error 2

The trouble here is that cpu_sibling_mask is defined only in <asm/smp.h>, and <linux/smp.h> includes <asm/smp.h> only in SMP builds.

So fix this build failure by explicitly including <asm/smp.h> in the driver, so that we get the definition of cpu_sibling_mask even in UP configurations.

---

 drivers/cpufreq/powernv-cpufreq.c |    1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/powernv-cpufreq.c +0 -0
index 9edccc6..ed1c7e5 100644

drivers/cpufreq/powernv-cpufreq.c line 31

Quoted 3 lines
drivers/cpufreq/powernv-cpufreq.c +0 -0
@@ -29,6 +29,7 @@
 
 #include <asm/cputhreads.h>
 #include <asm/reg.h>

Probably a comment here ?, so that people don't try to remove it in future.

/* Required for cpu_sibling_mask() in UP configurations */

drivers/cpufreq/powernv-cpufreq.c line 34

Quoted 3 lines
drivers/cpufreq/powernv-cpufreq.c +1 -0
+#include <asm/smp.h>
 
 #define POWERNV_MAX_PSTATES    256
#3 lore raw

Re: [PATCH] cpufreq, powernv: Fix build failure on UP

Quoted 35 lines · Viresh Kumar
Quoted 33 lines · Srivatsa S. Bhat

From: Srivatsa S. Bhat <[email protected]>
Subject: [PATCH] cpufreq, powernv: Fix build failure on UP

Paul Gortmaker reported the following build failure of the powernv cpufreq driver on UP configs:

drivers/cpufreq/powernv-cpufreq.c:241:2: error: implicit declaration of function 'cpu_sibling_mask' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/cpufreq/powernv-cpufreq.o] Error 1 make[2]: *** [drivers/cpufreq] Error 2
make[1]: *** [drivers] Error 2
make: *** [sub-make] Error 2

The trouble here is that cpu_sibling_mask is defined only in <asm/smp.h>, and <linux/smp.h> includes <asm/smp.h> only in SMP builds.

So fix this build failure by explicitly including <asm/smp.h> in the driver, so that we get the definition of cpu_sibling_mask even in UP configurations.

---

 drivers/cpufreq/powernv-cpufreq.c |    1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/powernv-cpufreq.c +0 -0
index 9edccc6..ed1c7e5 100644
@@ -29,6 +29,7 @@
 
Quoted 5 lines

drivers/cpufreq/powernv-cpufreq.c line 31

Quoted 2 lines
drivers/cpufreq/powernv-cpufreq.c +0 -0
 #include <asm/cputhreads.h>
 #include <asm/reg.h>

Probably a comment here ?, so that people don't try to remove it in future.

Sure, that sounds like a good idea.

Quoted 7 lines

/* Required for cpu_sibling_mask() in UP configurations */

drivers/cpufreq/powernv-cpufreq.c line 34

Quoted 3 lines
drivers/cpufreq/powernv-cpufreq.c +1 -0
+#include <asm/smp.h>
 
 #define POWERNV_MAX_PSTATES    256

Thank you!

Regards,
Srivatsa S. Bhat