Re: drivers/acpi/pmic/intel_pmic_xpower.c:183: undefined reference to `iosf_mbi_block_punit_i2c_access'

From: Randy Dunlap
Date: Thu Nov 08 2018 - 20:57:22 EST


On 11/2/18 10:28 AM, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: d81f50bd34646d8373b989e55180c0fc9af94e0b
> commit: 3c670dba864d9ab0a23612a93b7d98700734bd44 ACPI / PMIC: xpower: Block P-Unit I2C access during read-modify-write
> date: 8 days ago
> config: x86_64-randconfig-s3-11022323 (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
> git checkout 3c670dba864d9ab0a23612a93b7d98700734bd44
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All errors (new ones prefixed by >>):
>
> drivers/acpi/pmic/intel_pmic_xpower.o: In function `intel_xpower_pmic_update_power':
>>> drivers/acpi/pmic/intel_pmic_xpower.c:183: undefined reference to `iosf_mbi_block_punit_i2c_access'
>>> drivers/acpi/pmic/intel_pmic_xpower.c:200: undefined reference to `iosf_mbi_unblock_punit_i2c_access'

This happens because of
CONFIG_PMIC_OPREGION=y
CONFIG_XPOWER_PMIC_OPREGION=y
CONFIG_IOSF_MBI=m

where XPOWER_PMIC_OPREGION (bool) depends on IOSF_MBI (tristate, =m).

This build error could possibly be fixed by adding
select IOSF_MBI
and dropping the "depends on" for XPOWER_PMIC_OPREGION, or by changing
the "depends on" like this:

config XPOWER_PMIC_OPREGION
bool "ACPI operation region support for XPower AXP288 PMIC"
- depends on MFD_AXP20X_I2C && IOSF_MBI
+ depends on MFD_AXP20X_I2C && IOSF_MBI=y



> vim +183 drivers/acpi/pmic/intel_pmic_xpower.c
>
> 172
> 173 static int intel_xpower_pmic_update_power(struct regmap *regmap, int reg,
> 174 int bit, bool on)
> 175 {
> 176 int data, ret;
> 177
> 178 /* GPIO1 LDO regulator needs special handling */
> 179 if (reg == XPOWER_GPI1_CTRL)
> 180 return regmap_update_bits(regmap, reg, GPI1_LDO_MASK,
> 181 on ? GPI1_LDO_ON : GPI1_LDO_OFF);
> 182
> > 183 ret = iosf_mbi_block_punit_i2c_access();
> 184 if (ret)
> 185 return ret;
> 186
> 187 if (regmap_read(regmap, reg, &data)) {
> 188 ret = -EIO;
> 189 goto out;
> 190 }
> 191
> 192 if (on)
> 193 data |= BIT(bit);
> 194 else
> 195 data &= ~BIT(bit);
> 196
> 197 if (regmap_write(regmap, reg, data))
> 198 ret = -EIO;
> 199 out:
> > 200 iosf_mbi_unblock_punit_i2c_access();
> 201
> 202 return ret;
> 203 }
> 204
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation

cheers.
--
~Randy