Skip to contentSkip to conversation

i2c: Disable I2C_APPLE when I2C_PASEMI is a builtin

PATCH Applied Benjamin Gray 5 participants 8 messages Feb 27, 2023 – Mar 3, 2023 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 i2c: Disable I2C_APPLE when I2C_PASEMI is a builtin

The ppc64le_allmodconfig sets I2C_PASEMI=y and leaves COMPILE_TEST to default to y and I2C_APPLE to default to m, running into a known incompatible configuration that breaks the build [1]. Specifically, a common dependency (i2c-pasemi-core.o in this case) cannot be used by both builtin and module consumers.

Disable I2C_APPLE when I2C_PASEMI is a builtin to prevent this.

[1]: https://lore.kernel.org/all/[email protected]

---
v1: https://lore.kernel.org/linux-i2c/[email protected]/

---
 drivers/i2c/busses/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/i2c/busses/Kconfig +1 -0
index d4975444a32d..c42109e972fe 100644
@@ -896,6 +896,7 @@ config I2C_PASEMI
 
 config I2C_APPLE
 	tristate "Apple SMBus platform driver"
+	depends on !I2C_PASEMI
 	depends on ARCH_APPLE || COMPILE_TEST
 	default ARCH_APPLE
 	help

base-commit: ec0a1b360aec1ba0bdfad3dd69e300b028529c0d

Signature · 1 line
2.39.2
#1 lore raw

PATCH v2 2/2 i2c: Build I2C_PASEMI with COMPILE_TEST

This driver builds fine on non-power platforms, so add it to the COMPILE_TEST set to increase build coverage.

---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
index c42109e972fe..52b1aa164cda 100644
@@ -890,7 +890,7 @@ config I2C_OWL
 
 config I2C_PASEMI
 	tristate "PA Semi SMBus interface"
-	depends on PPC_PASEMI && PCI
+	depends on (PPC_PASEMI && PCI) || COMPILE_TEST
 	help
 	  Supports the PA Semi PWRficient on-chip SMBus interfaces.
 
Signature · 1 line
2.39.2
#2 lore raw

Re: [PATCH v2 2/2] i2c: Build I2C_PASEMI with COMPILE_TEST

Thank you for the patch! Yet something to improve:

Hi Benjamin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ec0a1b360aec1ba0bdfad3dd69e300b028529c0d]

url:    https://github.com/intel-lab-lkp/linux/commits/Benjamin-Gray/i2c-Build-I2C_PASEMI-with-COMPILE_TEST/20230228-073442
base:   ec0a1b360aec1ba0bdfad3dd69e300b028529c0d
patch link:    https://lore.kernel.org/r/20230227233318.120415-2-bgray%40linux.ibm.com
patch subject: [PATCH v2 2/2] i2c: Build I2C_PASEMI with COMPILE_TEST
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20230228/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 12.1.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/6f8f477a04ff9dcd1091aed71674b27c513b6b39
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Benjamin-Gray/i2c-Build-I2C_PASEMI-with-COMPILE_TEST/20230228-073442 git checkout 6f8f477a04ff9dcd1091aed71674b27c513b6b39
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/i2c/busses/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

>> drivers/i2c/busses/i2c-pasemi-pci.c:82:1: warning: data definition has no type or storage class
      82 | module_pci_driver(pasemi_smb_pci_driver);
         | ^~~~~~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-pasemi-pci.c:82:1: error: type defaults to 'int' in declaration of 'module_pci_driver' [-Werror=implicit-int]
>> drivers/i2c/busses/i2c-pasemi-pci.c:82:1: warning: parameter names (without types) in function declaration

cc1: some warnings being treated as errors

vim +82 drivers/i2c/busses/i2c-pasemi-pci.c

9bc5f4f660ff3e Sven Peter 2021-10-08 81
9bc5f4f660ff3e Sven Peter 2021-10-08 @82 module_pci_driver(pasemi_smb_pci_driver); 9bc5f4f660ff3e Sven Peter 2021-10-08 83

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
#3 lore raw

Re: [PATCH v2 2/2] i2c: Build I2C_PASEMI with COMPILE_TEST

Heh, that's what I get for only trying the defconfig. This patch was just a possible bonus though, only the first one is important.

#4 lore raw

Re: [PATCH v2 2/2] i2c: Build I2C_PASEMI with COMPILE_TEST

In reply to Benjamin Gray

Hi,

Quoted 14 lines · Benjamin Gray

This driver builds fine on non-power platforms, so add it to the COMPILE_TEST set to increase build coverage.

---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +0 -0
index c42109e972fe..52b1aa164cda 100644

drivers/i2c/busses/Kconfig config I2C_OWL · line 893

Quoted 5 lines
drivers/i2c/busses/Kconfig +1 -1
@@ -890,7 +890,7 @@ config I2C_OWL
 
 config I2C_PASEMI
 	tristate "PA Semi SMBus interface"
-	depends on PPC_PASEMI && PCI
+	depends on (PPC_PASEMI && PCI) || COMPILE_TEST

I think you just want

	depends on PCI
	depends on PPC_PASEMI || COMPILE_TEST

here and then it should work.

Best,

Sven

Acked-by on v2 1/2
#5 lore raw
In reply to Benjamin Gray
Quoted 6 lines · Benjamin Gray

The ppc64le_allmodconfig sets I2C_PASEMI=y and leaves COMPILE_TEST to default to y and I2C_APPLE to default to m, running into a known incompatible configuration that breaks the build [1]. Specifically, a common dependency (i2c-pasemi-core.o in this case) cannot be used by both builtin and module consumers.

Quoted 6 lines

Disable I2C_APPLE when I2C_PASEMI is a builtin to prevent this.

[1]: https://lore.kernel.org/all/[email protected]

Looks good to me,

Acked-by on v2 1/2
#6 lore raw
In reply to Benjamin Gray
Quoted 6 lines · Benjamin Gray

The ppc64le_allmodconfig sets I2C_PASEMI=y and leaves COMPILE_TEST to default to y and I2C_APPLE to default to m, running into a known incompatible configuration that breaks the build [1]. Specifically, a common dependency (i2c-pasemi-core.o in this case) cannot be used by both builtin and module consumers.

Quoted 7 lines

Disable I2C_APPLE when I2C_PASEMI is a builtin to prevent this.

[1]: https://lore.kernel.org/all/[email protected]

---

Best,

Sven

Applied
#7 lore raw
In reply to Benjamin Gray
Quoted 6 lines · Benjamin Gray

The ppc64le_allmodconfig sets I2C_PASEMI=y and leaves COMPILE_TEST to default to y and I2C_APPLE to default to m, running into a known incompatible configuration that breaks the build [1]. Specifically, a common dependency (i2c-pasemi-core.o in this case) cannot be used by both builtin and module consumers.

Quoted 6 lines

Disable I2C_APPLE when I2C_PASEMI is a builtin to prevent this.

[1]: https://lore.kernel.org/all/[email protected]

Applied to for-current, thanks!