All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] mfd: intel_soc_pmic: Select designware i2c-bus driver
@ 2017-03-29 18:57 Hans de Goede
  2017-03-29 18:57 ` [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86 Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2017-03-29 18:57 UTC (permalink / raw)
  To: Lee Jones; +Cc: Hans de Goede, linux-kernel, Andy Shevchenko

The Crystal Cove PMIC provides an ACPI OPRegion handler, which must be
available before other drivers using it are loaded, which is why
INTEL_SOC_PMIC is a bool.

Just having the driver is not enough, the driver for the i2c-bus must
also be built in, to ensure this, this patch adds a select for it.

This fixes errors like these during boot:

mmc0: SDHCI controller on ACPI [80860F14:00] using ADMA
ACPI Error: No handler for Region [REGS] (ffff93543b0cc3a8) [UserDefinedRegion] (20170119/evregion-166)
ACPI Error: Region UserDefinedRegion (ID=143) has no handler (20170119/exfldio-299)
ACPI Error: Method parse/execution failed [\_SB.PCI0.I2C7.PMI5.GET] (Node ffff93543b0cde10), AE_NOT_EXIST (20170119/psparse-543)
ACPI Error: Method parse/execution failed [\_SB.PCI0.SHC1._PS0] (Node ffff93543b0b5cd0), AE_NOT_EXIST (20170119/psparse-543)
acpi 80860F14:02: Failed to change power state to D0

While at it this patch also changes the human readable name of the Kconfig
option to make clear the INTEL_SOC_PMIC option selects support for the
Intel Crystal Cove PMIC and documents why this is a bool.

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Note this patch will partially conflicts with (contains the same changes as)
a patch in Andy Shevchenko's tree.
---
Changes in v2:
-Fix Kconfig depends and selects to fix warning reported by kbuild test robot
-Improve commit msg (add example of ACPI errors this avoids)
---
 drivers/mfd/Kconfig | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 2c34574..4eb044e 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -425,14 +425,21 @@ config LPC_SCH
 	  System Management Bus and General Purpose I/O.
 
 config INTEL_SOC_PMIC
-	bool "Support for Intel Atom SoC PMIC"
-	depends on GPIOLIB
-	depends on I2C=y
+	# This is a bool as it provides an ACPI Opregion which must be
+	# available as soon as possible
+	bool "Support for Intel Crystal Cove PMIC"
+	select GPIOLIB
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
+	# In order for the ACPI Opregion to be available the i2c-adapter
+	# driver must be builtin too, select it and its deps
+	depends on HAS_IOMEM
+	select I2C
+	select COMMON_CLK
+	select I2C_DESIGNWARE_PLATFORM
 	help
-	  Select this option to enable support for the PMIC device
+	  Select this option to enable support for the Crystal Cove PMIC
 	  on some Intel SoC systems. The PMIC provides ADC, GPIO,
 	  thermal, charger and related power management functions
 	  on these systems.
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86
  2017-03-29 18:57 [PATCH v2 1/2] mfd: intel_soc_pmic: Select designware i2c-bus driver Hans de Goede
@ 2017-03-29 18:57 ` Hans de Goede
  2017-03-30  5:21   ` kbuild test robot
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hans de Goede @ 2017-03-29 18:57 UTC (permalink / raw)
  To: Lee Jones; +Cc: Hans de Goede, linux-kernel

On x86 the axp288 PMIC provides an ACPI OPRegion handler, which must be
available before other drivers using it are loaded, which can only be
ensured if the mfd, opregion driver and i2c-bus drivers are built in.

The opregion driver is a bool depending on MFD_AXP20X_I2C ensuring that
it will be builtin if the opregion driver is to be enabled, add a
select for the designware-options to ensure those get built in too.

This fixes errors like these during boot:

mmc0: SDHCI controller on ACPI [80860F14:00] using ADMA
ACPI Error: No handler for Region [REGS] (ffff93543b0cc3a8) [UserDefinedRegion]
ACPI Error: Region UserDefinedRegion (ID=143) has no handler (20170119/exfldio-2
ACPI Error: Method parse/execution failed [\_SB.PCI0.I2C7.PMI5.GET] (Node ffff93
ACPI Error: Method parse/execution failed [\_SB.PCI0.SHC1._PS0] (Node ffff93543b
acpi 80860F14:02: Failed to change power state to D0

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Fix Kconfig depends and selects to fix warning reported by kbuild test robot
-Improve commit msg (add example of ACPI errors this avoids)
---
 drivers/mfd/Kconfig | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 4eb044e..ed2616c 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -148,7 +148,14 @@ config MFD_AXP20X_I2C
 	tristate "X-Powers AXP series PMICs with I2C"
 	select MFD_AXP20X
 	select REGMAP_I2C
-	depends on I2C
+	# In order for the ACPI Opregion this provides on x86 to be available
+	# the i2c-adapter driver must be builtin too, select it and its deps
+	depends on X86=n || (ACPI && HAS_IOMEM)
+	select I2C
+	select IOSF_MBI if X86
+	select COMMON_CLK if X86
+	select I2C_DESIGNWARE_PLATFORM if X86
+	select I2C_DESIGNWARE_BAYTRAIL if X86
 	help
 	  If you say Y here you get support for the X-Powers AXP series power
 	  management ICs (PMICs) controlled with I2C.
@@ -156,6 +163,10 @@ config MFD_AXP20X_I2C
 	  components like regulators or the PEK (Power Enable Key) under the
 	  corresponding menus.
 
+	  Note on x86 this provides an ACPI Opregion, so this must be 'y'
+	  (builtin) and not a module, as the OPregion must be available as
+	  soon as possible.
+
 config MFD_AXP20X_RSB
 	tristate "X-Powers AXP series PMICs with RSB"
 	select MFD_AXP20X
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86
  2017-03-29 18:57 ` [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86 Hans de Goede
@ 2017-03-30  5:21   ` kbuild test robot
  2017-03-30  5:21   ` kbuild test robot
  2017-04-03 10:27   ` Lee Jones
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2017-03-30  5:21 UTC (permalink / raw)
  To: Hans de Goede; +Cc: kbuild-all, Lee Jones, Hans de Goede, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]

Hi Hans,

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v4.11-rc4 next-20170329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Hans-de-Goede/mfd-intel_soc_pmic-Select-designware-i2c-bus-driver/20170330-102517
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: i386-randconfig-r0-201713 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/built-in.o: In function `reset_semaphore':
>> i2c-designware-baytrail.c:(.text+0x136c3b): undefined reference to `iosf_mbi_read'
>> i2c-designware-baytrail.c:(.text+0x136c65): undefined reference to `iosf_mbi_write'
   drivers/built-in.o: In function `baytrail_i2c_acquire':
   i2c-designware-baytrail.c:(.text+0x136ce6): undefined reference to `iosf_mbi_write'
   i2c-designware-baytrail.c:(.text+0x136d26): undefined reference to `iosf_mbi_read'
   i2c-designware-baytrail.c:(.text+0x136da1): undefined reference to `iosf_mbi_read'
   drivers/built-in.o: In function `i2c_dw_eval_lock_support':
>> (.text+0x136f01): undefined reference to `iosf_mbi_available'

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26027 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86
  2017-03-29 18:57 ` [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86 Hans de Goede
  2017-03-30  5:21   ` kbuild test robot
@ 2017-03-30  5:21   ` kbuild test robot
  2017-04-03 10:27   ` Lee Jones
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2017-03-30  5:21 UTC (permalink / raw)
  To: Hans de Goede; +Cc: kbuild-all, Lee Jones, Hans de Goede, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]

Hi Hans,

[auto build test WARNING on ljones-mfd/for-mfd-next]
[also build test WARNING on v4.11-rc4 next-20170329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Hans-de-Goede/mfd-intel_soc_pmic-Select-designware-i2c-bus-driver/20170330-102517
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: i386-randconfig-x074-201713 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

warning: (MFD_AXP20X_I2C) selects I2C_DESIGNWARE_BAYTRAIL which has unmet direct dependencies (I2C && HAS_IOMEM && ACPI && (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI || I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y))

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 21061 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86
  2017-03-29 18:57 ` [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86 Hans de Goede
  2017-03-30  5:21   ` kbuild test robot
  2017-03-30  5:21   ` kbuild test robot
@ 2017-04-03 10:27   ` Lee Jones
  2017-04-03 10:48     ` Hans de Goede
  2 siblings, 1 reply; 6+ messages in thread
From: Lee Jones @ 2017-04-03 10:27 UTC (permalink / raw)
  To: Hans de Goede; +Cc: linux-kernel

On Wed, 29 Mar 2017, Hans de Goede wrote:

> On x86 the axp288 PMIC provides an ACPI OPRegion handler, which must be
> available before other drivers using it are loaded, which can only be
> ensured if the mfd, opregion driver and i2c-bus drivers are built in.
> 
> The opregion driver is a bool depending on MFD_AXP20X_I2C ensuring that
> it will be builtin if the opregion driver is to be enabled, add a
> select for the designware-options to ensure those get built in too.
> 
> This fixes errors like these during boot:
> 
> mmc0: SDHCI controller on ACPI [80860F14:00] using ADMA
> ACPI Error: No handler for Region [REGS] (ffff93543b0cc3a8) [UserDefinedRegion]
> ACPI Error: Region UserDefinedRegion (ID=143) has no handler (20170119/exfldio-2
> ACPI Error: Method parse/execution failed [\_SB.PCI0.I2C7.PMI5.GET] (Node ffff93
> ACPI Error: Method parse/execution failed [\_SB.PCI0.SHC1._PS0] (Node ffff93543b
> acpi 80860F14:02: Failed to change power state to D0
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -Fix Kconfig depends and selects to fix warning reported by kbuild test robot

Looks like there is still an issue.

> -Improve commit msg (add example of ACPI errors this avoids)
> ---
>  drivers/mfd/Kconfig | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 4eb044e..ed2616c 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -148,7 +148,14 @@ config MFD_AXP20X_I2C
>  	tristate "X-Powers AXP series PMICs with I2C"
>  	select MFD_AXP20X
>  	select REGMAP_I2C
> -	depends on I2C
> +	# In order for the ACPI Opregion this provides on x86 to be available
> +	# the i2c-adapter driver must be builtin too, select it and its deps
> +	depends on X86=n || (ACPI && HAS_IOMEM)
> +	select I2C
> +	select IOSF_MBI if X86
> +	select COMMON_CLK if X86
> +	select I2C_DESIGNWARE_PLATFORM if X86
> +	select I2C_DESIGNWARE_BAYTRAIL if X86
>  	help
>  	  If you say Y here you get support for the X-Powers AXP series power
>  	  management ICs (PMICs) controlled with I2C.
> @@ -156,6 +163,10 @@ config MFD_AXP20X_I2C
>  	  components like regulators or the PEK (Power Enable Key) under the
>  	  corresponding menus.
>  
> +	  Note on x86 this provides an ACPI Opregion, so this must be 'y'
> +	  (builtin) and not a module, as the OPregion must be available as
> +	  soon as possible.
> +
>  config MFD_AXP20X_RSB
>  	tristate "X-Powers AXP series PMICs with RSB"
>  	select MFD_AXP20X

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86
  2017-04-03 10:27   ` Lee Jones
@ 2017-04-03 10:48     ` Hans de Goede
  0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2017-04-03 10:48 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel

Hi,

On 03-04-17 12:27, Lee Jones wrote:
> On Wed, 29 Mar 2017, Hans de Goede wrote:
>
>> On x86 the axp288 PMIC provides an ACPI OPRegion handler, which must be
>> available before other drivers using it are loaded, which can only be
>> ensured if the mfd, opregion driver and i2c-bus drivers are built in.
>>
>> The opregion driver is a bool depending on MFD_AXP20X_I2C ensuring that
>> it will be builtin if the opregion driver is to be enabled, add a
>> select for the designware-options to ensure those get built in too.
>>
>> This fixes errors like these during boot:
>>
>> mmc0: SDHCI controller on ACPI [80860F14:00] using ADMA
>> ACPI Error: No handler for Region [REGS] (ffff93543b0cc3a8) [UserDefinedRegion]
>> ACPI Error: Region UserDefinedRegion (ID=143) has no handler (20170119/exfldio-2
>> ACPI Error: Method parse/execution failed [\_SB.PCI0.I2C7.PMI5.GET] (Node ffff93
>> ACPI Error: Method parse/execution failed [\_SB.PCI0.SHC1._PS0] (Node ffff93543b
>> acpi 80860F14:02: Failed to change power state to D0
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> Changes in v2:
>> -Fix Kconfig depends and selects to fix warning reported by kbuild test robot
>
> Looks like there is still an issue.

Yes I noticed the new kbuild test mails I will take a look at this
and do a v3 as time permits.

Regards,

Hans


>
>> -Improve commit msg (add example of ACPI errors this avoids)
>> ---
>>  drivers/mfd/Kconfig | 13 ++++++++++++-
>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>> index 4eb044e..ed2616c 100644
>> --- a/drivers/mfd/Kconfig
>> +++ b/drivers/mfd/Kconfig
>> @@ -148,7 +148,14 @@ config MFD_AXP20X_I2C
>>  	tristate "X-Powers AXP series PMICs with I2C"
>>  	select MFD_AXP20X
>>  	select REGMAP_I2C
>> -	depends on I2C
>> +	# In order for the ACPI Opregion this provides on x86 to be available
>> +	# the i2c-adapter driver must be builtin too, select it and its deps
>> +	depends on X86=n || (ACPI && HAS_IOMEM)
>> +	select I2C
>> +	select IOSF_MBI if X86
>> +	select COMMON_CLK if X86
>> +	select I2C_DESIGNWARE_PLATFORM if X86
>> +	select I2C_DESIGNWARE_BAYTRAIL if X86
>>  	help
>>  	  If you say Y here you get support for the X-Powers AXP series power
>>  	  management ICs (PMICs) controlled with I2C.
>> @@ -156,6 +163,10 @@ config MFD_AXP20X_I2C
>>  	  components like regulators or the PEK (Power Enable Key) under the
>>  	  corresponding menus.
>>
>> +	  Note on x86 this provides an ACPI Opregion, so this must be 'y'
>> +	  (builtin) and not a module, as the OPregion must be available as
>> +	  soon as possible.
>> +
>>  config MFD_AXP20X_RSB
>>  	tristate "X-Powers AXP series PMICs with RSB"
>>  	select MFD_AXP20X
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-03 10:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 18:57 [PATCH v2 1/2] mfd: intel_soc_pmic: Select designware i2c-bus driver Hans de Goede
2017-03-29 18:57 ` [PATCH v2 2/2] mfd: axp20c-i2c: Select designware i2c-bus driver on x86 Hans de Goede
2017-03-30  5:21   ` kbuild test robot
2017-03-30  5:21   ` kbuild test robot
2017-04-03 10:27   ` Lee Jones
2017-04-03 10:48     ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.