Hi Jindong,
First bad commit (maybe != root cause):
tree:
https://github.com/Freescale/linux-fslc 5.4-2.3.x-imx
head: ef2339380856bee33c1ae25535ff0d72c92d02ad
commit: d29c65632f73063945b8ab29a5634573959e8539 [14380/18813] MA-17597-2 mfd: pca9450:
Support module build
config: ia64-randconfig-r011-20210519 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.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/Freescale/linux-fslc/commit/d29c65632f73063945b8ab29a5...
git remote add freescale-fslc
https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc 5.4-2.3.x-imx
git checkout d29c65632f73063945b8ab29a5634573959e8539
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/mm.h:99,
from arch/ia64/include/asm/uaccess.h:38,
from include/linux/uaccess.h:11,
from arch/ia64/include/asm/sections.h:11,
from include/linux/interrupt.h:20,
from drivers/regulator/pca9450-regulator.c:18:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but
not used [-Wunused-but-set-variable]
137 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
drivers/regulator/pca9450-regulator.c: In function 'pca9450_probe':
> drivers/regulator/pca9450-regulator.c:678:16: error:
'pca9450_matches' undeclared (first use in this function)
678 |
desc->name = pca9450_matches[i].name;
| ^~~~~~~~~~~~~~~
drivers/regulator/pca9450-regulator.c:678:16: note: each undeclared identifier is
reported only once for each function it appears in
At top level:
drivers/regulator/pca9450-regulator.c:149:44: warning:
'pca9450_ldo2_voltage_ranges' defined but not used [-Wunused-const-variable=]
149 | static const struct regulator_linear_range pca9450_ldo2_voltage_ranges[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/pca9450_matches +678 drivers/regulator/pca9450-regulator.c
c46712e52a8dd0 Robin Gong 2019-10-23 634
c46712e52a8dd0 Robin Gong 2019-10-23 635 /*
c46712e52a8dd0 Robin Gong 2019-10-23 636 * @brief probe pca9450 regulator device
c46712e52a8dd0 Robin Gong 2019-10-23 637 * @param pdev pca9450 regulator platform
device
c46712e52a8dd0 Robin Gong 2019-10-23 638 * @retval 0 success
c46712e52a8dd0 Robin Gong 2019-10-23 639 * @retval negative fail
c46712e52a8dd0 Robin Gong 2019-10-23 640 */
c46712e52a8dd0 Robin Gong 2019-10-23 641 static int pca9450_probe(struct platform_device
*pdev)
c46712e52a8dd0 Robin Gong 2019-10-23 642 {
c46712e52a8dd0 Robin Gong 2019-10-23 643 struct pca9450_pmic *pmic;
c46712e52a8dd0 Robin Gong 2019-10-23 644 struct pca9450_board *pdata;
c46712e52a8dd0 Robin Gong 2019-10-23 645 struct regulator_config config = {};
c46712e52a8dd0 Robin Gong 2019-10-23 646 struct pca9450 *pca9450 =
dev_get_drvdata(pdev->dev.parent);
c46712e52a8dd0 Robin Gong 2019-10-23 647 struct of_regulator_match *matches = NULL;
c46712e52a8dd0 Robin Gong 2019-10-23 648 int i = 0, err, irq = 0, ret = 0;
c46712e52a8dd0 Robin Gong 2019-10-23 649
c46712e52a8dd0 Robin Gong 2019-10-23 650 pmic = kzalloc(sizeof(*pmic), GFP_KERNEL);
c46712e52a8dd0 Robin Gong 2019-10-23 651 if (!pmic)
c46712e52a8dd0 Robin Gong 2019-10-23 652 return -ENOMEM;
c46712e52a8dd0 Robin Gong 2019-10-23 653
c46712e52a8dd0 Robin Gong 2019-10-23 654 memcpy(pmic->descs,
pca9450_regulators, sizeof(pmic->descs));
c46712e52a8dd0 Robin Gong 2019-10-23 655
c46712e52a8dd0 Robin Gong 2019-10-23 656 pmic->dev = &pdev->dev;
c46712e52a8dd0 Robin Gong 2019-10-23 657 pmic->mfd = pca9450;
c46712e52a8dd0 Robin Gong 2019-10-23 658 platform_set_drvdata(pdev, pmic);
c46712e52a8dd0 Robin Gong 2019-10-23 659 pdata = dev_get_platdata(pca9450->dev);
c46712e52a8dd0 Robin Gong 2019-10-23 660
c46712e52a8dd0 Robin Gong 2019-10-23 661 if (!pdata &&
pca9450->dev->of_node) {
c46712e52a8dd0 Robin Gong 2019-10-23 662
pca9450_parse_dt_reg_data(pdev, &matches);
c46712e52a8dd0 Robin Gong 2019-10-23 663 if (matches == NULL) {
c46712e52a8dd0 Robin Gong 2019-10-23 664 dev_err(&pdev->dev, "Platform
data not found\n");
c46712e52a8dd0 Robin Gong 2019-10-23 665 return -EINVAL;
c46712e52a8dd0 Robin Gong 2019-10-23 666 }
c46712e52a8dd0 Robin Gong 2019-10-23 667 }
c46712e52a8dd0 Robin Gong 2019-10-23 668
c46712e52a8dd0 Robin Gong 2019-10-23 669 /* Get buck dvs parameters */
c46712e52a8dd0 Robin Gong 2019-10-23 670 of_pca9450_buck_dvs(pdev,
&pmic->buck_dvs[0]);
c46712e52a8dd0 Robin Gong 2019-10-23 671
c46712e52a8dd0 Robin Gong 2019-10-23 672 for (i = 0; i < PCA9450_REGULATOR_CNT; i++)
{
c46712e52a8dd0 Robin Gong 2019-10-23 673 struct regulator_init_data *init_data;
c46712e52a8dd0 Robin Gong 2019-10-23 674 struct regulator_desc *desc;
c46712e52a8dd0 Robin Gong 2019-10-23 675 struct regulator_dev *rdev;
c46712e52a8dd0 Robin Gong 2019-10-23 676
c46712e52a8dd0 Robin Gong 2019-10-23 677 desc = &pmic->descs[i];
c46712e52a8dd0 Robin Gong 2019-10-23 @678 desc->name = pca9450_matches[i].name;
c46712e52a8dd0 Robin Gong 2019-10-23 679
c46712e52a8dd0 Robin Gong 2019-10-23 680 if (pdata)
c46712e52a8dd0 Robin Gong 2019-10-23 681 init_data = pdata->init_data[i];
c46712e52a8dd0 Robin Gong 2019-10-23 682 else
c46712e52a8dd0 Robin Gong 2019-10-23 683 init_data = pca9450_matches[i].init_data;
c46712e52a8dd0 Robin Gong 2019-10-23 684
c46712e52a8dd0 Robin Gong 2019-10-23 685 config.dev = pmic->dev;
c46712e52a8dd0 Robin Gong 2019-10-23 686 config.init_data = init_data;
c46712e52a8dd0 Robin Gong 2019-10-23 687 config.driver_data = pmic;
c46712e52a8dd0 Robin Gong 2019-10-23 688 config.regmap = pca9450->regmap;
c46712e52a8dd0 Robin Gong 2019-10-23 689 if (matches)
c46712e52a8dd0 Robin Gong 2019-10-23 690 config.of_node = matches[i].of_node;
c46712e52a8dd0 Robin Gong 2019-10-23 691 dev_dbg(config.dev, "regulator register
name '%s'\n",
c46712e52a8dd0 Robin Gong 2019-10-23 692 desc->name);
c46712e52a8dd0 Robin Gong 2019-10-23 693
c46712e52a8dd0 Robin Gong 2019-10-23 694 rdev = regulator_register(desc,
&config);
c46712e52a8dd0 Robin Gong 2019-10-23 695 if (IS_ERR(rdev)) {
c46712e52a8dd0 Robin Gong 2019-10-23 696 dev_err(pca9450->dev,
c46712e52a8dd0 Robin Gong 2019-10-23 697 "failed to register %s
regulator\n",
c46712e52a8dd0 Robin Gong 2019-10-23 698 desc->name);
c46712e52a8dd0 Robin Gong 2019-10-23 699 err = PTR_ERR(rdev);
c46712e52a8dd0 Robin Gong 2019-10-23 700 goto err;
c46712e52a8dd0 Robin Gong 2019-10-23 701 }
c46712e52a8dd0 Robin Gong 2019-10-23 702 pmic->rdev[i] = rdev;
c46712e52a8dd0 Robin Gong 2019-10-23 703 }
c46712e52a8dd0 Robin Gong 2019-10-23 704
c46712e52a8dd0 Robin Gong 2019-10-23 705 /* Init sysfs registers */
c46712e52a8dd0 Robin Gong 2019-10-23 706 pmic->reg_index = -1;
c46712e52a8dd0 Robin Gong 2019-10-23 707
c46712e52a8dd0 Robin Gong 2019-10-23 708 err =
sysfs_create_group(&pdev->dev.kobj, &clk_attr_group);
c46712e52a8dd0 Robin Gong 2019-10-23 709 if (err != 0) {
c46712e52a8dd0 Robin Gong 2019-10-23 710 dev_err(&pdev->dev, "Failed to
create sysfs: %d\n", err);
c46712e52a8dd0 Robin Gong 2019-10-23 711 goto err;
c46712e52a8dd0 Robin Gong 2019-10-23 712 }
c46712e52a8dd0 Robin Gong 2019-10-23 713
c46712e52a8dd0 Robin Gong 2019-10-23 714 /* Init Buck1/2/3 dvs */
c46712e52a8dd0 Robin Gong 2019-10-23 715 err = pca9450_buck123_dvs_init(pmic);
c46712e52a8dd0 Robin Gong 2019-10-23 716 if (err != 0) {
c46712e52a8dd0 Robin Gong 2019-10-23 717 dev_err(&pdev->dev, "Failed to
buck123 dvs: %d\n", err);
c46712e52a8dd0 Robin Gong 2019-10-23 718 goto err;
c46712e52a8dd0 Robin Gong 2019-10-23 719 }
c46712e52a8dd0 Robin Gong 2019-10-23 720
c46712e52a8dd0 Robin Gong 2019-10-23 721 /* Add Interrupt */
c46712e52a8dd0 Robin Gong 2019-10-23 722 irq = platform_get_irq(pdev, 0);
c46712e52a8dd0 Robin Gong 2019-10-23 723 if (irq <= 0) {
c46712e52a8dd0 Robin Gong 2019-10-23 724 dev_warn(&pdev->dev, "platform
irq error # %d\n", irq);
c46712e52a8dd0 Robin Gong 2019-10-23 725 return -ENXIO;
c46712e52a8dd0 Robin Gong 2019-10-23 726 }
c46712e52a8dd0 Robin Gong 2019-10-23 727 ret =
devm_request_threaded_irq(&pdev->dev, irq, NULL,
c46712e52a8dd0 Robin Gong 2019-10-23 728 pca9450_pmic_interrupt,
c46712e52a8dd0 Robin Gong 2019-10-23 729 IRQF_TRIGGER_LOW | IRQF_EARLY_RESUME,
c46712e52a8dd0 Robin Gong 2019-10-23 730 dev_name(&pdev->dev),
&pdev->dev);
c46712e52a8dd0 Robin Gong 2019-10-23 731 if (ret < 0)
c46712e52a8dd0 Robin Gong 2019-10-23 732 dev_err(&pdev->dev, "IRQ %d is
not free.\n", irq);
c46712e52a8dd0 Robin Gong 2019-10-23 733
c46712e52a8dd0 Robin Gong 2019-10-23 734 /* Un-mask IRQ Interrupt */
c46712e52a8dd0 Robin Gong 2019-10-23 735 ret = pca9450_reg_write(pca9450,
PCA9450_INT1_MSK, 0);
c46712e52a8dd0 Robin Gong 2019-10-23 736 if (ret < 0) {
c46712e52a8dd0 Robin Gong 2019-10-23 737 dev_err(&pdev->dev, "Write
'PCA9450_REG_MIRQ': failed!\n");
c46712e52a8dd0 Robin Gong 2019-10-23 738 ret = -EIO;
c46712e52a8dd0 Robin Gong 2019-10-23 739 goto err;
c46712e52a8dd0 Robin Gong 2019-10-23 740 }
c46712e52a8dd0 Robin Gong 2019-10-23 741
c46712e52a8dd0 Robin Gong 2019-10-23 742 return 0;
c46712e52a8dd0 Robin Gong 2019-10-23 743
c46712e52a8dd0 Robin Gong 2019-10-23 744 err:
c46712e52a8dd0 Robin Gong 2019-10-23 745 while (--i >= 0)
c46712e52a8dd0 Robin Gong 2019-10-23 746 regulator_unregister(pmic->rdev[i]);
c46712e52a8dd0 Robin Gong 2019-10-23 747
c46712e52a8dd0 Robin Gong 2019-10-23 748 kfree(pmic);
c46712e52a8dd0 Robin Gong 2019-10-23 749 return err;
c46712e52a8dd0 Robin Gong 2019-10-23 750 }
c46712e52a8dd0 Robin Gong 2019-10-23 751
:::::: The code at line 678 was first introduced by commit
:::::: c46712e52a8dd0ecce6efbd2d2d56919352478a9 MLK-22824-2: regulator: pca9450: add
pca9450 regulator driver
:::::: TO: Robin Gong <yibin.gong(a)nxp.com>
:::::: CC: Robin Gong <yibin.gong(a)nxp.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org