lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202507162012.qDNKtUiI-lkp@intel.com>
Date: Wed, 16 Jul 2025 20:24:38 +0800
From: kernel test robot <lkp@...el.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	linux-mediatek@...ts.infradead.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev, lee@...nel.org,
	robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
	matthias.bgg@...il.com, angelogioacchino.delregno@...labora.com,
	lgirdwood@...il.com, broonie@...nel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	kernel@...labora.com, wenst@...omium.org
Subject: Re: [PATCH v5 4/8] regulator: Add support for MediaTek MT6363 SPMI
 PMIC Regulators

Hi AngeloGioacchino,

kernel test robot noticed the following build errors:

[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on lee-mfd/for-mfd-next lee-mfd/for-mfd-fixes lee-leds/for-leds-next linus/master v6.16-rc6 next-20250715]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/AngeloGioacchino-Del-Regno/dt-bindings-regulator-Document-MediaTek-MT6316-PMIC-Regulators/20250715-222516
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20250715140224.206329-5-angelogioacchino.delregno%40collabora.com
patch subject: [PATCH v5 4/8] regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20250716/202507162012.qDNKtUiI-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250716/202507162012.qDNKtUiI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507162012.qDNKtUiI-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/regulator/mt6363-regulator.c:519:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     519 |                 sel = FIELD_PREP(MT6363_RG_VEMC_VOSEL_1_MASK, sel);
         |                       ^
>> drivers/regulator/mt6363-regulator.c:577:10: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     577 |                 vsel = FIELD_GET(MT6363_RG_VEMC_VOSEL_1_MASK, vosel);
         |                        ^
   2 errors generated.


vim +/FIELD_PREP +519 drivers/regulator/mt6363-regulator.c

   481	
   482	static int mt6363_vemc_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
   483	{
   484		const u16 tma_unlock_key = MT6363_TMA_UNLOCK_VALUE;
   485		const struct regulator_desc *rdesc = rdev->desc;
   486		struct regmap *regmap = rdev->regmap;
   487		unsigned int range, val;
   488		int i, ret;
   489		u16 mask;
   490	
   491		for (i = 0; i < rdesc->n_linear_ranges; i++) {
   492			const struct linear_range *r = &rdesc->linear_ranges[i];
   493			unsigned int voltages_in_range = linear_range_values_in_range(r);
   494	
   495			if (sel < voltages_in_range)
   496				break;
   497			sel -= voltages_in_range;
   498		}
   499	
   500		if (i == rdesc->n_linear_ranges)
   501			return -EINVAL;
   502	
   503		ret = regmap_read(rdev->regmap, MT6363_TOP_TRAP, &val);
   504		if (ret)
   505			return ret;
   506	
   507		if (val > 1)
   508			return -EINVAL;
   509	
   510		/* Unlock TMA for writing */
   511		ret = regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L,
   512					&tma_unlock_key, sizeof(tma_unlock_key));
   513		if (ret)
   514			return ret;
   515	
   516		/* If HW trapping value is 1, use VEMC_VOSEL_1 instead of VEMC_VOSEL_0 */
   517		if (val == 1) {
   518			mask = MT6363_RG_VEMC_VOSEL_1_MASK;
 > 519			sel = FIELD_PREP(MT6363_RG_VEMC_VOSEL_1_MASK, sel);
   520		} else {
   521			mask = rdesc->vsel_mask;
   522		}
   523	
   524		sel <<= ffs(rdesc->vsel_mask) - 1;
   525		sel += rdesc->linear_ranges[i].min_sel;
   526	
   527		range = rdesc->linear_range_selectors_bitfield[i];
   528		range <<= ffs(rdesc->vsel_range_mask) - 1;
   529	
   530		/* Write to the vreg calibration register for voltage finetuning */
   531		ret = regmap_update_bits(regmap, rdesc->vsel_range_reg,
   532					 rdesc->vsel_range_mask, range);
   533		if (ret)
   534			goto lock_tma;
   535	
   536		/* Function must return the result of this write operation */
   537		ret = regmap_update_bits(regmap, rdesc->vsel_reg, mask, sel);
   538	
   539	lock_tma:
   540		/* Unconditionally re-lock TMA */
   541		val = 0;
   542		regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L, &val, 2);
   543	
   544		return ret;
   545	}
   546	
   547	static int mt6363_vemc_get_voltage_sel(struct regulator_dev *rdev)
   548	{
   549		const struct regulator_desc *rdesc = rdev->desc;
   550		unsigned int vosel, trap, calsel;
   551		int vcal, vsel, range, ret;
   552	
   553		ret = regmap_read(rdev->regmap, rdesc->vsel_reg, &vosel);
   554		if (ret)
   555			return ret;
   556	
   557		ret = regmap_read(rdev->regmap, rdesc->vsel_range_reg, &calsel);
   558		if (ret)
   559			return ret;
   560	
   561		calsel &= rdesc->vsel_range_mask;
   562		for (range = 0; range < rdesc->n_linear_ranges; range++)
   563			if (rdesc->linear_range_selectors_bitfield[range] != calsel)
   564				break;
   565	
   566		if (range == rdesc->n_linear_ranges)
   567			return -EINVAL;
   568	
   569		ret = regmap_read(rdev->regmap, MT6363_TOP_TRAP, &trap);
   570		if (ret)
   571			return ret;
   572	
   573		/* If HW trapping value is 1, use VEMC_VOSEL_1 instead of VEMC_VOSEL_0 */
   574		if (trap > 1)
   575			return -EINVAL;
   576		else if (trap == 1)
 > 577			vsel = FIELD_GET(MT6363_RG_VEMC_VOSEL_1_MASK, vosel);
   578		else
   579			vsel = vosel & rdesc->vsel_mask;
   580	
   581		vcal = linear_range_values_in_range_array(rdesc->linear_ranges, range);
   582	
   583		return vsel + vcal;
   584	}
   585	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ