2020-05-22 22:05:06

by Anders Roxell

[permalink] [raw]
Subject: [PATCH] power: reset: vexpress: fix build issue

An allmodconfig kernel makes CONFIG_VEXPRESS_CONFIG a module and
CONFIG_POWER_RESET_VEXPRESS builtin. That makes us see this build
error:

aarch64-linux-gnu-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
../drivers/power/reset/vexpress-poweroff.c:119: undefined reference to `devm_regmap_init_vexpress_config'
../drivers/power/reset/vexpress-poweroff.c:119:(.text+0x48c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`devm_regmap_init_vexpress_config'
make[1]: *** [/srv/src/kernel/next/Makefile:1126: vmlinux] Error 1

Rework so that POWER_RESET_VEXPRESS depends on 'VEXPRESS_CONFIG=y'.

Fixes: d06cfe3f123c ("bus: vexpress-config: Merge vexpress-syscfg into vexpress-config")
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Anders Roxell <[email protected]>
---
drivers/power/reset/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 4dfac618b942..f07b982c8dff 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -191,7 +191,7 @@ config POWER_RESET_VERSATILE
config POWER_RESET_VEXPRESS
bool "ARM Versatile Express power-off and reset driver"
depends on ARM || ARM64
- depends on VEXPRESS_CONFIG
+ depends on VEXPRESS_CONFIG=y
help
Power off and reset support for the ARM Ltd. Versatile
Express boards.
--
2.26.2


2020-05-22 22:55:58

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH] power: reset: vexpress: fix build issue

On Fri, May 22, 2020 at 4:01 PM Anders Roxell <[email protected]> wrote:
>

It's [email protected] that this needs to go to with an explicit request
for them to apply. Please resend so it gets in their Patchwork.

> An allmodconfig kernel makes CONFIG_VEXPRESS_CONFIG a module and
> CONFIG_POWER_RESET_VEXPRESS builtin. That makes us see this build
> error:
>
> aarch64-linux-gnu-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
> ../drivers/power/reset/vexpress-poweroff.c:119: undefined reference to `devm_regmap_init_vexpress_config'
> ../drivers/power/reset/vexpress-poweroff.c:119:(.text+0x48c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
> `devm_regmap_init_vexpress_config'
> make[1]: *** [/srv/src/kernel/next/Makefile:1126: vmlinux] Error 1
>
> Rework so that POWER_RESET_VEXPRESS depends on 'VEXPRESS_CONFIG=y'.
>
> Fixes: d06cfe3f123c ("bus: vexpress-config: Merge vexpress-syscfg into vexpress-config")
> Acked-by: Rob Herring <[email protected]>
> Signed-off-by: Anders Roxell <[email protected]>
> ---
> drivers/power/reset/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> index 4dfac618b942..f07b982c8dff 100644
> --- a/drivers/power/reset/Kconfig
> +++ b/drivers/power/reset/Kconfig
> @@ -191,7 +191,7 @@ config POWER_RESET_VERSATILE
> config POWER_RESET_VEXPRESS
> bool "ARM Versatile Express power-off and reset driver"
> depends on ARM || ARM64
> - depends on VEXPRESS_CONFIG
> + depends on VEXPRESS_CONFIG=y
> help
> Power off and reset support for the ARM Ltd. Versatile
> Express boards.
> --
> 2.26.2
>

2020-05-24 22:35:53

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [PATCH] power: reset: vexpress: fix build issue

On Sat, May 23, 2020 at 12:01:03AM +0200, Anders Roxell wrote:
> An allmodconfig kernel makes CONFIG_VEXPRESS_CONFIG a module and
> CONFIG_POWER_RESET_VEXPRESS builtin. That makes us see this build
> error:
>
> aarch64-linux-gnu-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
> ../drivers/power/reset/vexpress-poweroff.c:119: undefined reference to `devm_regmap_init_vexpress_config'
> ../drivers/power/reset/vexpress-poweroff.c:119:(.text+0x48c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
> `devm_regmap_init_vexpress_config'
> make[1]: *** [/srv/src/kernel/next/Makefile:1126: vmlinux] Error 1
>
> Rework so that POWER_RESET_VEXPRESS depends on 'VEXPRESS_CONFIG=y'.
>
> Fixes: d06cfe3f123c ("bus: vexpress-config: Merge vexpress-syscfg into vexpress-config")
> Acked-by: Rob Herring <[email protected]>
> Signed-off-by: Anders Roxell <[email protected]>
> ---
> drivers/power/reset/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> index 4dfac618b942..f07b982c8dff 100644
> --- a/drivers/power/reset/Kconfig
> +++ b/drivers/power/reset/Kconfig
> @@ -191,7 +191,7 @@ config POWER_RESET_VERSATILE
> config POWER_RESET_VEXPRESS
> bool "ARM Versatile Express power-off and reset driver"
> depends on ARM || ARM64
> - depends on VEXPRESS_CONFIG
> + depends on VEXPRESS_CONFIG=y
> help
> Power off and reset support for the ARM Ltd. Versatile
> Express boards.
> --
> 2.26.2
>

This causes a warning for ARCH=arm allmodconfig:

$ make -j"$(nproc)" -s ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=out/arm allmodconfig

WARNING: unmet direct dependencies detected for POWER_RESET_VEXPRESS
Depends on [n]: POWER_RESET [=y] && (ARM [=y] || ARM64) && VEXPRESS_CONFIG [=m]=y
Selected by [y]:
- ARCH_VEXPRESS [=y] && ARCH_MULTI_V7 [=y]

and still doesn't fix the error:

arm-linux-gnueabi-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
vexpress-poweroff.c:(.text+0x36c): undefined reference to `devm_regmap_init_vexpress_config'

Cheers,
Nathan

2020-05-25 23:42:04

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH] power: reset: vexpress: fix build issue

On Sun, 24 May 2020 15:20:25 -0700, Nathan Chancellor said:

> arm-linux-gnueabi-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
> vexpress-poweroff.c:(.text+0x36c): undefined reference to `devm_regmap_init_vexpress_config'

The part I can't figure out is that git blame tells me there's already an
export:

3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 154) return regmap;
3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 155) }
b33cdd283bd91 (Arnd Bergmann 2014-05-26 17:25:22 +0200 156) EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 157)

but I can't figure out where or if drivers/power/reset/vexpress-poweroff.c gets
a MODULE_LICENSE from...


Attachments:
(No filename) (849.00 B)

2020-05-26 05:42:02

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [PATCH] power: reset: vexpress: fix build issue

On Mon, May 25, 2020 at 07:37:45PM -0400, Valdis Klētnieks wrote:
> On Sun, 24 May 2020 15:20:25 -0700, Nathan Chancellor said:
>
> > arm-linux-gnueabi-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
> > vexpress-poweroff.c:(.text+0x36c): undefined reference to `devm_regmap_init_vexpress_config'
>
> The part I can't figure out is that git blame tells me there's already an
> export:
>
> 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 154) return regmap;
> 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 155) }
> b33cdd283bd91 (Arnd Bergmann 2014-05-26 17:25:22 +0200 156) EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
> 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 157)
>
> but I can't figure out where or if drivers/power/reset/vexpress-poweroff.c gets
> a MODULE_LICENSE from...

Correct, it is exported but that file is being built as a module whereas
the file requiring it is beign builtin. As far as I understand, that
will not work, hence the error.

The issue with this patch is that ARCH_VEXPRESS still just selects
POWER_RESET_VEXPRESS, which ignores "depends on", hence the Kconfig
warning and not fixing the error.

I am not that much of a Kconfig guru to come up with a solution. I am
just reporting it because arm allmodconfig is broken on -next due to
this.

Cheers,
Nathan

2020-05-26 15:46:08

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH] power: reset: vexpress: fix build issue

" On Mon, May 25, 2020 at 11:38 PM Nathan Chancellor
<[email protected]> wrote:
>
> On Mon, May 25, 2020 at 07:37:45PM -0400, Valdis Klētnieks wrote:
> > On Sun, 24 May 2020 15:20:25 -0700, Nathan Chancellor said:
> >
> > > arm-linux-gnueabi-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
> > > vexpress-poweroff.c:(.text+0x36c): undefined reference to `devm_regmap_init_vexpress_config'
> >
> > The part I can't figure out is that git blame tells me there's already an
> > export:
> >
> > 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 154) return regmap;
> > 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 155) }
> > b33cdd283bd91 (Arnd Bergmann 2014-05-26 17:25:22 +0200 156) EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
> > 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 157)
> >
> > but I can't figure out where or if drivers/power/reset/vexpress-poweroff.c gets
> > a MODULE_LICENSE from...
>
> Correct, it is exported but that file is being built as a module whereas
> the file requiring it is beign builtin. As far as I understand, that
> will not work, hence the error.
>
> The issue with this patch is that ARCH_VEXPRESS still just selects
> POWER_RESET_VEXPRESS, which ignores "depends on", hence the Kconfig
> warning and not fixing the error.
>
> I am not that much of a Kconfig guru to come up with a solution. I am
> just reporting it because arm allmodconfig is broken on -next due to
> this.

Commit "ARM: vexpress: Don't select VEXPRESS_CONFIG" needs to be
reverted. I've asked Arnd to revert it.

Anders patch is still needed for arm64.

Rob

2020-05-27 10:03:47

by Anders Roxell

[permalink] [raw]
Subject: Re: [PATCH] power: reset: vexpress: fix build issue

On Tue, 26 May 2020 at 17:41, Rob Herring <[email protected]> wrote:
>
> " On Mon, May 25, 2020 at 11:38 PM Nathan Chancellor
> <[email protected]> wrote:
> >
> > On Mon, May 25, 2020 at 07:37:45PM -0400, Valdis Klētnieks wrote:
> > > On Sun, 24 May 2020 15:20:25 -0700, Nathan Chancellor said:
> > >
> > > > arm-linux-gnueabi-ld: drivers/power/reset/vexpress-poweroff.o: in function `vexpress_reset_probe':
> > > > vexpress-poweroff.c:(.text+0x36c): undefined reference to `devm_regmap_init_vexpress_config'
> > >
> > > The part I can't figure out is that git blame tells me there's already an
> > > export:
> > >
> > > 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 154) return regmap;
> > > 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 155) }
> > > b33cdd283bd91 (Arnd Bergmann 2014-05-26 17:25:22 +0200 156) EXPORT_SYMBOL_GPL(devm_regmap_init_vexpress_config);
> > > 3b9334ac835bb (Pawel Moll 2014-04-30 16:46:29 +0100 157)
> > >
> > > but I can't figure out where or if drivers/power/reset/vexpress-poweroff.c gets
> > > a MODULE_LICENSE from...
> >
> > Correct, it is exported but that file is being built as a module whereas
> > the file requiring it is beign builtin. As far as I understand, that
> > will not work, hence the error.
> >
> > The issue with this patch is that ARCH_VEXPRESS still just selects
> > POWER_RESET_VEXPRESS, which ignores "depends on", hence the Kconfig
> > warning and not fixing the error.
> >
> > I am not that much of a Kconfig guru to come up with a solution. I am
> > just reporting it because arm allmodconfig is broken on -next due to
> > this.
>
> Commit "ARM: vexpress: Don't select VEXPRESS_CONFIG" needs to be
> reverted. I've asked Arnd to revert it.

Reverting that patch with my patch will make allmodconfig work for arm too.

>
> Anders patch is still needed for arm64.

Yes, it is still needed for arm64.

Cheers,
Anders