Skip to contentSkip to conversation

regmap: Kconfig: Select SPMI when REGMAP_SPMI is selected

PATCH In review [email protected] 6 participants 12 messages Jul 16, 2014

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

PATCH 1/1 regmap: Kconfig: Select SPMI when REGMAP_SPMI is selected

From: Pramod Gurav <[email protected]>

REGMAP_SPMI module calls some functions from SPMI hence build breaks when SPMI is not enabled while compiling REGMAP_SPMI with below linker errors:

drivers/built-in.o: In function `regmap_spmi_ext_read':
:(.text+0x1143ec): undefined reference to spmi_ext_register_read' :(.text+0x11443c): undefined reference to spmi_ext_register_readl' drivers/built-in.o: In function `regmap_spmi_ext_gather_write':
:(.text+0x1144c4): undefined reference to spmi_ext_register_write' :(.text+0x114520): undefined reference to spmi_ext_register_writel' drivers/built-in.o: In function `regmap_spmi_base_read':
:(.text+0x1145b8): undefined reference to spmi_register_read' drivers/built-in.o: In function regmap_spmi_base_gather_write':
:(.text+0x114630): undefined reference to spmi_register_write' :(.text+0x11465c): undefined reference to spmi_register_zero_write'

CC Josh Cartwright <[email protected]>
CC Mark Brown <[email protected]>

---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selects REGMAP_SPMI and hence the crash.

 drivers/base/regmap/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/base/regmap/Kconfig +1 -0
index 4251570..1aa9d71 100644
@@ -16,6 +16,7 @@ config REGMAP_SPI
 	tristate
 
 config REGMAP_SPMI
+	select SPMI
 	tristate
 
 config REGMAP_MMIO
Signature · 1 line
1.7.9.5
#1 lore raw

Hi,

<snip>

Quoted 16 lines
CC Josh Cartwright <[email protected]>
CC Mark Brown <[email protected]>

---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selects REGMAP_SPMI and hence the crash.

 drivers/base/regmap/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/base/regmap/Kconfig +0 -0
index 4251570..1aa9d71 100644

drivers/base/regmap/Kconfig config REGMAP_SPI · line 19

Quoted 4 lines
drivers/base/regmap/Kconfig +1 -0
@@ -16,6 +16,7 @@ config REGMAP_SPI
 	tristate
 
 config REGMAP_SPMI
+	select SPMI

NO, IMO the CONFIG_SPMI should be enabled by qcom_defconfig and multi_v7_defconfig. See CONFIG_I2C and REGMAP_I2C for example.

Signature · 2 lines
regards,
Stan
#2 lore raw

Hi,

Quoted 21 lines · Stanimir Varbanov

Hi,

<snip>

Quoted 18 lines
CC Josh Cartwright <[email protected]>
CC Mark Brown <[email protected]>

---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selects REGMAP_SPMI and hence the crash.

 drivers/base/regmap/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/base/regmap/Kconfig +0 -0
index 4251570..1aa9d71 100644
@@ -16,6 +16,7 @@ config REGMAP_SPI
 	tristate
 
Quoted 6 lines

drivers/base/regmap/Kconfig config REGMAP_SPI · line 19

Quoted 2 lines
drivers/base/regmap/Kconfig +1 -0
 config REGMAP_SPMI
+	select SPMI

NO, IMO the CONFIG_SPMI should be enabled by qcom_defconfig and multi_v7_defconfig. See CONFIG_I2C and REGMAP_I2C for example.

I am using multi_v7_defconfig but its not enabling it. I ran qcom_defconfig which does.

Quoted 8 lines

--
regards,
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

<snip>

Quoted 9 lines
Quoted 7 lines

drivers/base/regmap/Kconfig config REGMAP_SPI · line 19

Quoted 3 lines

config REGMAP_SPMI

drivers/base/regmap/Kconfig +1 -0
+	select SPMI

NO, IMO the CONFIG_SPMI should be enabled by qcom_defconfig and multi_v7_defconfig. See CONFIG_I2C and REGMAP_I2C for example.

I am using multi_v7_defconfig but its not enabling it. I ran qcom_defconfig which does.

yes, it seems reasonable to add it in multi_v7_defconfig also.

Signature · 2 lines
regards,
Stan
#4 lore raw

Hi,

Quoted 10 lines · Stanimir Varbanov

<snip>

Quoted 8 lines
Quoted 7 lines

drivers/base/regmap/Kconfig config REGMAP_SPI · line 19

Quoted 3 lines

config REGMAP_SPMI

drivers/base/regmap/Kconfig +1 -0
+	select SPMI

NO, IMO the CONFIG_SPMI should be enabled by qcom_defconfig and multi_v7_defconfig. See CONFIG_I2C and REGMAP_I2C for example.

Quoted 5 lines
Quoted 2 lines

I am using multi_v7_defconfig but its not enabling it. I ran qcom_defconfig which does.

yes, it seems reasonable to add it in multi_v7_defconfig also.

Thanks.
I misunderstood the Kconfig documentation which says, "Reverse dependencies can only be used with boolean or tristate symbols". In the note following this statement doc says, "In general use select only for non-visible symbols".

The CONFIG_SPMI option is visible in menuconfig hence either it should be set by default in multi_v7_defconfig(like in qcom_defconfig) or driver owner should mention a 'depneds on CONFIG_SPMI' as suggested by Lars-Peter Clausen. I prefer the former (defconfig).

Shall I send a new patch adding it in multi_v7_defconfig?

Quoted 9 lines

--
regards,
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

<snip>

Quoted 8 lines

Thanks.
I misunderstood the Kconfig documentation which says, "Reverse dependencies can only be used with boolean or tristate symbols". In the note following this statement doc says, "In general use select only for non-visible symbols".

The CONFIG_SPMI option is visible in menuconfig hence either it should be set by default in multi_v7_defconfig(like in qcom_defconfig) or driver owner should mention a 'depneds on CONFIG_SPMI' as suggested by Lars-Peter Clausen. I prefer the former (defconfig).

Shall I send a new patch adding it in multi_v7_defconfig?

yes, I think it should be enabled. On the other side I'm not sure that it will be acceptable because presently there are no users if it in multi platform build. Might be worth to do it ones the MFD driver is in.

And I/we should add a dependency to SPMI in the MFD driver as Lars pointed out.

Signature · 2 lines
regards,
Stan
maintainer
#6 lore raw
In reply to Pramod Gurav

On Wed, Jul 16, 2014 at 06:26:15PM +0530, Pramod Gurav wrote:

Fix your mailer to word wrap within paragraphs, this will make your mails more legible - see Documentation/email-clients.txt.

Quoted 8 lines · Stanimir Varbanov

The CONFIG_SPMI option is visible in menuconfig hence either it should be set by default in multi_v7_defconfig(like in qcom_defconfig) or driver owner should mention a 'depneds on CONFIG_SPMI' as suggested by Lars-Peter Clausen.

I prefer the former (defconfig).

No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.

#7 lore raw
Quoted 14 lines · Mark Brown

On Wed, Jul 16, 2014 at 06:26:15PM +0530, Pramod Gurav wrote:

Fix your mailer to word wrap within paragraphs, this will make your mails more legible - see Documentation/email-clients.txt.

Quoted 8 lines · Stanimir Varbanov

The CONFIG_SPMI option is visible in menuconfig hence either it should be set by default in multi_v7_defconfig(like in qcom_defconfig) or driver owner should mention a 'depneds on CONFIG_SPMI' as suggested by Lars-Peter Clausen.

I prefer the former (defconfig).

Quoted 7 lines

No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.

Then config REGMAP_SPMI should depend on SPMI, right?

Regards,
Ivan

maintainer
#8 lore raw
Quoted 11 lines · Ivan T. Ivanov
Quoted 7 lines · Mark Brown

No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.

Then config REGMAP_SPMI should depend on SPMI, right?

No, REGMAP_SPMI is not something that can be enabled directly - it is selected by its users which should be ensuring that SPMI is enabled as it is difficult to see a use case for REGMAP_SPMI which does not do this.

A dependency from a selected symbol will have no effect.

#9 lore raw
Quoted 11 lines · Mark Brown
Quoted 9 lines · Ivan T. Ivanov
Quoted 7 lines · Mark Brown

No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.

Quoted 8 lines
Quoted 1 line

Then config REGMAP_SPMI should depend on SPMI, right?

No, REGMAP_SPMI is not something that can be enabled directly - it is selected by its users which should be ensuring that SPMI is enabled as it is difficult to see a use case for REGMAP_SPMI which does not do this.

A dependency from a selected symbol will have no effect.

Thanks Mark. So essentially in this case PMIC driver should 'select SPMI'. Right?

Signature · 2 lines
Thanks and Regards
Pramod
maintainer
#10 lore raw
Quoted 6 lines · pramod gurav
Quoted 1 line · Mark Brown

A dependency from a selected symbol will have no effect.

Thanks Mark. So essentially in this case PMIC driver should 'select SPMI'. Right?

I would expect it to depend on SPMI and select REGMAP_SPMI, assuming SPMI is a user-selectable Kconfig symbol.

#11 lore raw
In reply to [email protected]
Quoted 18 lines · On 07/16/2014 01:39 PM, [email protected] wrote:

From: Pramod Gurav <[email protected]>

REGMAP_SPMI module calls some functions from SPMI hence build breaks when SPMI is not enabled while compiling REGMAP_SPMI with below linker errors:

drivers/built-in.o: In function `regmap_spmi_ext_read':
:(.text+0x1143ec): undefined reference to spmi_ext_register_read' :(.text+0x11443c): undefined reference to spmi_ext_register_readl' drivers/built-in.o: In function `regmap_spmi_ext_gather_write':
:(.text+0x1144c4): undefined reference to spmi_ext_register_write' :(.text+0x114520): undefined reference to spmi_ext_register_writel' drivers/built-in.o: In function `regmap_spmi_base_read':
:(.text+0x1145b8): undefined reference to spmi_register_read' drivers/built-in.o: In function regmap_spmi_base_gather_write':
:(.text+0x114630): undefined reference to spmi_register_write' :(.text+0x11465c): undefined reference to spmi_register_zero_write'

Quoted 6 lines
CC Josh Cartwright <[email protected]>
CC Mark Brown <[email protected]>

---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selects REGMAP_SPMI and hence the crash.

Any driver that does select REGMAP_SPMI needs to depends on SPMI. So the correct fix for this issue is to make sure that the driver can only be enabled if SPMI is enabled.

- Lars