edac, highbank: remove dependency on ARCH_HIGHBANK
PATCH 1/1 edac, highbank: remove dependency on ARCH_HIGHBANK
From: Rob Herring <[email protected]>
In order to enable on arm64 and improve the build coverage, remove the dependency on ARCH_HIGHBANK.
--- drivers/edac/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/Kconfig +2 -2
@@ -328,14 +328,14 @@ config EDAC_TILE config EDAC_HIGHBANK_MC tristate "Highbank Memory Controller" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDAC help Support for error detection and correction on the Calxeda Highbank memory controller. config EDAC_HIGHBANK_L2 tristate "Highbank L2 Cache" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDAC help Support for error detection and correction on the Calxeda Highbank memory controller.
Signature · 1 line
1.8.1.2
Borislav Petkov
maintainerQuoted 18 lines · Rob Herring
From: Rob Herring <[email protected]>
In order to enable on arm64 and improve the build coverage, remove the dependency on
ARCH_HIGHBANK.Signed-off-by Rob Herring <[email protected]>Cc Doug Thompson <[email protected]>Cc Robert Richter <[email protected]>--- drivers/edac/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/edac/Kconfig +0
-0
drivers/edac/Kconfig config EDAC_TILE · line 331
Quoted 5 lines
drivers/edac/Kconfig +1
-1@@ -328,14 +328,14 @@ config EDAC_TILE config EDAC_HIGHBANK_MC tristate "Highbank Memory Controller" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDAC
Please, no, this'll get enabled on other arches where this driver is simply N/A. It should only depend on the ARM arches it supports.
Signature · 2 lines
Regards/Gruss, Boris.
Quoted 20 lines · Borislav Petkov
Quoted 19 lines · Rob Herring
From: Rob Herring <[email protected]>
In order to enable on arm64 and improve the build coverage, remove the dependency on
ARCH_HIGHBANK.Signed-off-by Rob Herring <[email protected]>Cc Doug Thompson <[email protected]>Cc Robert Richter <[email protected]>--- drivers/edac/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/edac/Kconfig +0
-0@@ -328,14 +328,14 @@ config EDAC_TILE
Quoted 7 lines
drivers/edac/Kconfig config EDAC_TILE · line 331
Quoted 4 lines
drivers/edac/Kconfig +1
-1config EDAC_HIGHBANK_MC tristate "Highbank Memory Controller" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDACPlease, no, this'll get enabled on other arches where this driver is simply N/A. It should only depend on the ARM arches it supports.
Other maintainers disagree because it reduces build coverage. Having done some cross arch clean-up, I have to agree with that position. Iterating builds over different arches is bad enough, but iterating over all configs for each arch is a pain. It would be nice to have a uniform policy here.
Rob
Borislav Petkov
maintainerQuoted 1 line · Rob Herring
Other maintainers disagree because it reduces build coverage.
What possible build coverage are we talking about when building highbank on x86, for example? And what does a build failure in that configuration tell you if it builds and boots fine on your hardware?
Quoted 3 lines
Having done some cross arch clean-up, I have to agree with that position. Iterating builds over different arches is bad enough, but iterating over all configs for each arch is a pain.
So make highbank depend only on the arches for which it is supposed to work but not for *all* arches. Look at how the other edac drivers do it, x86 ones depend on X86, tile on tile, etc, etc. Why should highbank be special?
Quoted 1 line
It would be nice to have a uniform policy here.
Simple: drivers should be selectable/buildable only on the arches they're supposed to run on.
Signature · 2 lines
Regards/Gruss, Boris.
Quoted 6 lines · Borislav Petkov
Quoted 1 line · Rob Herring
Other maintainers disagree because it reduces build coverage.
What possible build coverage are we talking about when building highbank on x86, for example? And what does a build failure in that configuration tell you if it builds and boots fine on your hardware?
Using some interface which is arch specific and should not be used in a driver. We used to have tons of mach dependencies in "ARM" drivers that took a lot of effort to clean-up. Requiring all drivers to build on allyesconfigs would have prevented that. The same thing applies at the architecture level. Of course there are exceptions, but if we only limit the exceptions then they are easy to find.
Quoted 9 lines
Quoted 3 lines
Having done some cross arch clean-up, I have to agree with that position. Iterating builds over different arches is bad enough, but iterating over all configs for each arch is a pain.
So make highbank depend only on the arches for which it is supposed to work but not for *all* arches. Look at how the other edac drivers do it, x86 ones depend on X86, tile on tile, etc, etc. Why should highbank be special?
Quoted 4 lines
Quoted 1 line
It would be nice to have a uniform policy here.
Simple: drivers should be selectable/buildable only on the arches they're supposed to run on.
Like I said, not all maintainers agree. David M rejected patches from me restricting our network driver to ARM.
Rob
Borislav Petkov
maintainerQuoted 2 lines · Rob Herring
Using some interface which is arch specific and should not be used in a driver.
Well, sorry, but this is not something which justifies enabling building of compilation units on arches for which they don't apply. Rather, this should be caught during review.
I find it highly unfair to waste cycles building stuff on an arch for which the drivers aren't meant for. And it doesn't make any sense anyway
- I'd like all*config to get finished at some point soonish and not build the whole world.
And, btw, highbank triggers the following on AMD64:
CC [M] drivers/edac/edac_pci.o CC [M] drivers/edac/highbank_mc_edac.o CC [M] drivers/edac/highbank_l2_edac.o
drivers/edac/highbank_mc_edac.c: In function ‘highbank_mc_probe’:drivers/edac/highbank_mc_edac.c:210:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
dimm->nr_pages = (~0UL >> PAGE_SHIFT) + 1;
^
which is clearly a bug since ->nr_pages becomes 0.
BUT(!), this bug doesn't make any sense on x86 since highbank won't load there and yours is a 32-bit arm. (it'll probably make some sense on arm64 assuming the native long type is 8 bytes there).
And people would start reporting those bugs and we're going to start asking on which arch are you compiling just to realize that a bug like that doesn't make any sense on an N/A arch.
Oh, and then other edac drivers would simply fail building:
CC [M] drivers/edac/octeon_edac-pc.odrivers/edac/octeon_edac-pc.c:21:29: fatal error: asm/octeon/cvmx.h: No such file or directory
#include <asm/octeon/cvmx.h>
^compilation terminated.
make[1]: *** [drivers/edac/octeon_edac-pc.o] Error 1
simply because x86/include doesn't have that header.
So let's not waste any more time with this topic. I think there are a numerous other ways for achieving build coverage which make *way* *more* sense than this.
Signature · 2 lines
Regards/Gruss, Boris.
Quoted 15 lines · Borislav Petkov
Quoted 2 lines · Rob Herring
Using some interface which is arch specific and should not be used in a driver.
Well, sorry, but this is not something which justifies enabling building of compilation units on arches for which they don't apply. Rather, this should be caught during review.
I find it highly unfair to waste cycles building stuff on an arch for which the drivers aren't meant for. And it doesn't make any sense anyway
- I'd like all*config to get finished at some point soonish and not build the whole world.And, btw, highbank triggers the following on AMD64:
Quoted 7 lines
CC [M] drivers/edac/edac_pci.o CC [M] drivers/edac/highbank_mc_edac.o CC [M] drivers/edac/highbank_l2_edac.o
drivers/edac/highbank_mc_edac.c: In function ‘highbank_mc_probe’:drivers/edac/highbank_mc_edac.c:210:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
dimm->nr_pages= (~0UL >>PAGE_SHIFT) + 1;
^
See, we are benefiting already. I already found this thanks to the 0-day builder (which doesn't build arm64). This is a 64-bit vs. 32-bit bug and I need this driver enabled for arm64, so this needs to be fixed.
Quoted 12 lines
which is clearly a bug since ->nr_pages becomes 0.
BUT(!), this bug doesn't make any sense on x86 since highbank won't load there and yours is a 32-bit arm. (it'll probably make some sense on arm64 assuming the native long type is 8 bytes there).
And people would start reporting those bugs and we're going to start asking on which arch are you compiling just to realize that a bug like that doesn't make any sense on an N/A arch.
Oh, and then other edac drivers would simply fail building:
Quoted 8 lines
CC [M]
drivers/edac/octeon_edac-pc.odrivers/edac/octeon_edac-pc.c:21:29: fatal error:asm/octeon/cvmx.h: No such file or directory#include <asm/octeon/cvmx.h> ^compilation terminated.
make[1]: *** [drivers/edac/octeon_edac-pc.o] Error 1simply because x86/include doesn't have that header.
Exactly the mess of arch or mach headers in drivers I referred to.
Quoted 3 lines
So let's not waste any more time with this topic. I think there are a numerous other ways for achieving build coverage which make *way* *more* sense than this.
Borislav Petkov
maintainerQuoted 1 line · Rob Herring
See, we are benefiting already.
You can catch this when building on arm64, i.e. basically one of the target architectures for which the driver is meant for.
Signature · 2 lines
Regards/Gruss, Boris.
Quoted 5 lines · Borislav Petkov
Quoted 1 line · Rob Herring
See, we are benefiting already.
You can catch this when building on arm64, i.e. basically one of the target architectures for which the driver is meant for.
Can't we just take
depends on EDAC_MM_EDAC && (ARCH_MULTI_V7 || ARM64)
as a first step to increase build coverage?
There is also COMPILE_TEST that could be used which is exactly what we want here: "Compile also drivers which will not load":
depends on EDAC_MM_EDAC && (ARCH_MULTI_V7 || ARM64 || COMPILE_TEST)
This should enable it with allmodconfig.
-Robert
Borislav Petkov
maintainerQuoted 5 lines · Robert Richter
Can't we just take
depends on
EDAC_MM_EDAC&& (ARCH_MULTI_V7|| ARM64)as a first step to increase build coverage?
Yep, that's basically what I was suggesting.
Quoted 6 lines
There is also
COMPILE_TESTthat could be used which is exactly what we want here: "Compile also drivers which will not load":depends on
EDAC_MM_EDAC&& (ARCH_MULTI_V7|| ARM64 ||COMPILE_TEST)This should enable it with allmodconfig.
You could do this but the first is already coverage enough IMO and, as I said previously, compiling this thing on other architectures could raise bugs/issues which are not necessarily such on arm/arm64, for example.
Signature · 2 lines
Regards/Gruss, Boris.
Quoted 7 lines · Borislav Petkov
Quoted 3 lines
depends on
EDAC_MM_EDAC&& (ARCH_MULTI_V7|| ARM64 ||COMPILE_TEST)This should enable it with allmodconfig.
You could do this but the first is already coverage enough IMO and, as I said previously, compiling this thing on other architectures could raise bugs/issues which are not necessarily such on arm/arm64, for example.
The config option was introduced for this, enable it to be built on all archs but have an option to disable it on archs where it is not supposed to run on. I rather prefer COMPILE_TEST. Could we agree on this?
Thanks,
-Robert
Borislav Petkov
maintainerQuoted 4 lines · Robert Richter
The config option was introduced for this, enable it to be built on all archs but have an option to disable it on archs where it is not supposed to run on. I rather prefer
COMPILE_TEST. Could we agree on this?
Sure.
Signature · 5 lines
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--Quoted 9 lines · Rob Herring
From: Rob Herring <[email protected]>
In order to enable on arm64 and improve the build coverage, remove the dependency on
ARCH_HIGHBANK.Signed-off-by Rob Herring <[email protected]>Cc Doug Thompson <[email protected]>Cc Robert Richter <[email protected]>
Rob, I will apply your patch with the changes we discussed if this is ok for you.
-Robert
Quoted 28 lines
--- drivers/edac/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/edac/Kconfig +2
-2@@ -328,14 +328,14 @@ config EDAC_TILE config EDAC_HIGHBANK_MC tristate "Highbank Memory Controller" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDAC help Support for error detection and correction on the Calxeda Highbank memory controller. config EDAC_HIGHBANK_L2 tristate "Highbank L2 Cache" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDAC help Support for error detection and correction on the Calxeda Highbank memory controller.Signature · 1 line
1.8.1.2
Quoted 6 lines · Robert Richter
Quoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
In order to enable on arm64 and improve the build coverage, remove the dependency on
ARCH_HIGHBANK.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Rob Herring <[email protected]>Cc Doug Thompson <[email protected]>Cc Robert Richter <[email protected]>Rob, I will apply your patch with the changes we discussed if this is ok for you.
Thanks. It should be (ARM || ARM64 || COMPILE_TEST) rather than ARM_MULTI_V7. The L2 ECC driver can be ARM only.
Rob
Quoted 31 lines
-Robert
Quoted 28 lines
--- drivers/edac/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/edac/Kconfig +2
-2@@ -328,14 +328,14 @@ config EDAC_TILE config EDAC_HIGHBANK_MC tristate "Highbank Memory Controller" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDAC help Support for error detection and correction on the Calxeda Highbank memory controller. config EDAC_HIGHBANK_L2 tristate "Highbank L2 Cache" - depends on EDAC_MM_EDAC && ARCH_HIGHBANK + depends on EDAC_MM_EDAC help Support for error detection and correction on the Calxeda Highbank memory controller.Signature · 1 line
1.8.1.2