Skip to contentSkip to conversation

regulator: Kconfig: Fix REGULATOR_QCOM_RPMH dependencies to avoid build error

PATCH Superseded John Stultz 3 participants 5 messages Nov 21, 2020 – Nov 23, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: Kconfig: Fix REGULATOR_QCOM_RPMH dependencies to avoid build error

The kernel test robot reported the following build error:

All errors (new ones prefixed by >>):

xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':
qcom-rpmh-regulator.c:(.text+0x270): undefined reference to `rpmh_write'
xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
qcom-rpmh-regulator.c:(.text+0x2f2): undefined reference to `rpmh_write'
xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':

Quoted 1 line
Quoted 1 line

qcom-rpmh-regulator.c:(.text+0x274): undefined reference to `rpmh_write_async'

xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
qcom-rpmh-regulator.c:(.text+0x2fc): undefined reference to `rpmh_write_async'

Which is due to REGULATOR_QCOM_RPMH depending on QCOM_RPMH || COMPILE_TEST. The problem is that QOM_RPMH can now be a module, which in that case requires REGULATOR_QCOM_RPMH=m to build.

However, if COMPILE_TEST is enabled, REGULATOR_QCOM_RPMH can be set to =y while REGULATOR_QCOM_RPMH=m which will cause build failures.

The easy fix here is to remove COMPILE_TEST.

Feedback would be appreciated!

Cc Todd Kjos <[email protected]>
Cc Saravana Kannan <[email protected]>
Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Rajendra Nayak <[email protected]>
Cc Maulik Shah <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
---
 drivers/regulator/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/Kconfig +1 -1
index 020a00d6696b..9e4fc73ed5a1 100644
@@ -843,7 +843,7 @@ config REGULATOR_QCOM_RPM
 
 config REGULATOR_QCOM_RPMH
 	tristate "Qualcomm Technologies, Inc. RPMh regulator driver"
-	depends on QCOM_RPMH || COMPILE_TEST
+	depends on QCOM_RPMH
 	help
 	  This driver supports control of PMIC regulators via the RPMh hardware
 	  block found on Qualcomm Technologies Inc. SoCs.  RPMh regulator
Signature · 1 line
2.17.1
#1 lore raw

Hi John,

Thanks for the patch.

Quoted 13 lines · John Stultz

The kernel test robot reported the following build error:

All errors (new ones prefixed by >>):

xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':
qcom-rpmh-regulator.c:(.text+0x270): undefined reference to `rpmh_write'
xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
qcom-rpmh-regulator.c:(.text+0x2f2): undefined reference to `rpmh_write'
xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':

Quoted 1 line
Quoted 1 line

qcom-rpmh-regulator.c:(.text+0x274): undefined reference to `rpmh_write_async'

xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
qcom-rpmh-regulator.c:(.text+0x2fc): undefined reference to `rpmh_write_async'

Quoted 8 lines

Which is due to REGULATOR_QCOM_RPMH depending on QCOM_RPMH || COMPILE_TEST. The problem is that QOM_RPMH can now be a module, which in that case requires REGULATOR_QCOM_RPMH=m to build.

However, if COMPILE_TEST is enabled, REGULATOR_QCOM_RPMH can be set to =y while REGULATOR_QCOM_RPMH=m which will cause build failures.

Seems typo here, you mean to say, REGULATOR_QCOM_RPMH can be set to =y while QCOM_RPMH=m....

Quoted 2 lines

The easy fix here is to remove COMPILE_TEST.

As config QCOM_RPMH also has COMPILE_TEST, i don't see why it should be removed from REGULATOR_QCOM_RPMH.

Can REGULATOR_QCOM_RPMH have depends on ARCH_QCOM set similar to QCOM_RPMH? As test bot reported build errors on other ARCH with regulatore driver of QCOM arch.

Thanks,
Maulik

Quoted 32 lines

Feedback would be appreciated!

Cc Todd Kjos <[email protected]>
Cc Saravana Kannan <[email protected]>
Cc Andy Gross <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc Rajendra Nayak <[email protected]>
Cc Maulik Shah <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
---
  drivers/regulator/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/Kconfig +1 -1
index 020a00d6696b..9e4fc73ed5a1 100644
@@ -843,7 +843,7 @@ config REGULATOR_QCOM_RPM
 
  config REGULATOR_QCOM_RPMH
  	tristate "Qualcomm Technologies, Inc. RPMh regulator driver"
-	depends on QCOM_RPMH || COMPILE_TEST
+	depends on QCOM_RPMH
  	help
  	  This driver supports control of PMIC regulators via the RPMh hardware
  	  block found on Qualcomm Technologies Inc. SoCs.  RPMh regulator
Signature · 1 line
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
#2 lore raw
Quoted 19 lines · Maulik Shah
Quoted 18 lines · John Stultz

The kernel test robot reported the following build error:

All errors (new ones prefixed by >>):

xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':
qcom-rpmh-regulator.c:(.text+0x270): undefined reference to `rpmh_write'
xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
qcom-rpmh-regulator.c:(.text+0x2f2): undefined reference to `rpmh_write'
xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_vrm_get_voltage_sel':

Quoted 1 line
Quoted 1 line

qcom-rpmh-regulator.c:(.text+0x274): undefined reference to `rpmh_write_async'

xtensa-linux-ld: drivers/regulator/qcom-rpmh-regulator.o: in function `rpmh_regulator_send_request':
qcom-rpmh-regulator.c:(.text+0x2fc): undefined reference to `rpmh_write_async'

Which is due to REGULATOR_QCOM_RPMH depending on QCOM_RPMH || COMPILE_TEST. The problem is that QOM_RPMH can now be a module, which in that case requires REGULATOR_QCOM_RPMH=m to build.

Quoted 5 lines
Quoted 3 lines

However, if COMPILE_TEST is enabled, REGULATOR_QCOM_RPMH can be set to =y while REGULATOR_QCOM_RPMH=m which will cause build failures.

Seems typo here, you mean to say, REGULATOR_QCOM_RPMH can be set to =y while QCOM_RPMH=m....

Ah, yes, thanks for catching that. I'll fix it up.

Quoted 8 lines
Quoted 1 line

The easy fix here is to remove COMPILE_TEST.

As config QCOM_RPMH also has COMPILE_TEST, i don't see why it should be removed from REGULATOR_QCOM_RPMH.

Can REGULATOR_QCOM_RPMH have depends on ARCH_QCOM set similar to QCOM_RPMH? As test bot reported build errors on other ARCH with regulatore driver of QCOM arch.

I think Mark's suggestion of "|| (QCOM_RPMH=n && COMPILE_TEST)" is probably better, as you could still trigger the build issue with a ARCH_QCOM and compile test. But I appreciate the suggestion!

Thanks so much for the review!
-john

maintainer
#3 lore raw
In reply to John Stultz

drivers/regulator/Kconfig config REGULATOR_QCOM_RPM · line 846

Quoted 4 lines · John Stultz

config REGULATOR_QCOM_RPMH

drivers/regulator/Kconfig +1 -1
 	tristate "Qualcomm Technologies, Inc. RPMh regulator driver"
-	depends on QCOM_RPMH || COMPILE_TEST
+	depends on QCOM_RPMH

QCOM_RPMH || (QCOM_RPMH=n && COMPILE_TEST)
should do the trick IIRC.

#4 lore raw
Quoted 10 lines · Mark Brown

drivers/regulator/Kconfig config REGULATOR_QCOM_RPM · line 846

Quoted 4 lines · John Stultz

config REGULATOR_QCOM_RPMH
tristate "Qualcomm Technologies, Inc. RPMh regulator driver"

drivers/regulator/Kconfig +1 -1
-     depends on QCOM_RPMH || COMPILE_TEST
+     depends on QCOM_RPMH

QCOM_RPMH || (QCOM_RPMH=n && COMPILE_TEST)
should do the trick IIRC.

Sounds good. I'll resend shortly.

thanks
-john