[PATCH v2] powerpc/kexec_file: use current CPU info while setting up FDT

kernel test robot lkp at intel.com
Sat Apr 17 01:27:09 AEST 2021


Hi Sourabh,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on linus/master v5.12-rc7 next-20210416]
[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]

url:    https://github.com/0day-ci/linux/commits/Sourabh-Jain/powerpc-kexec_file-use-current-CPU-info-while-setting-up-FDT/20210416-204821
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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/0day-ci/linux/commit/c4f40243a6928fb16798b2b98c5371815b49e4cc
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Sourabh-Jain/powerpc-kexec_file-use-current-CPU-info-while-setting-up-FDT/20210416-204821
        git checkout c4f40243a6928fb16798b2b98c5371815b49e4cc
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

>> arch/powerpc/kexec/file_load_64.c:972:5: warning: no previous prototype for 'add_node_prop' [-Wmissing-prototypes]
     972 | int add_node_prop(void *fdt, int node_offset, const struct device_node *np)
         |     ^~~~~~~~~~~~~
>> arch/powerpc/kexec/file_load_64.c:1003:5: warning: no previous prototype for 'update_cpus_node' [-Wmissing-prototypes]
    1003 | int update_cpus_node(void *fdt)
         |     ^~~~~~~~~~~~~~~~


vim +/add_node_prop +972 arch/powerpc/kexec/file_load_64.c

   962	
   963	/**
   964	 * add_node_prop - Read property from device node structure and add
   965	 *			them to fdt.
   966	 * @fdt:		Flattened device tree of the kernel
   967	 * @node_offset:	offset of the node to add a property at
   968	 * np:			device node pointer
   969	 *
   970	 * Returns 0 on success, negative errno on error.
   971	 */
 > 972	int add_node_prop(void *fdt, int node_offset, const struct device_node *np)
   973	{
   974		int ret = 0;
   975		struct property *pp;
   976		unsigned long flags;
   977	
   978		if (!np)
   979			return -EINVAL;
   980	
   981		raw_spin_lock_irqsave(&devtree_lock, flags);
   982		for (pp = np->properties; pp; pp = pp->next) {
   983			ret = fdt_setprop(fdt, node_offset, pp->name,
   984					  pp->value, pp->length);
   985			if (ret < 0) {
   986				pr_err("Unable to add %s property: %s\n",
   987					pp->name, fdt_strerror(ret));
   988				goto out;
   989			}
   990		}
   991	out:
   992		raw_spin_unlock_irqrestore(&devtree_lock, flags);
   993		return ret;
   994	}
   995	
   996	/**
   997	 * update_cpus_node - Update cpus node of flattened device-tree using of_root
   998	 *			device node.
   999	 * @fdt:		Flattened device tree of the kernel.
  1000	 *
  1001	 * Returns 0 on success, negative errno on error.
  1002	 */
> 1003	int update_cpus_node(void *fdt)
  1004	{
  1005		struct device_node *cpus_node, *dn;
  1006		int cpus_offset, cpus_subnode_off, ret = 0;
  1007	
  1008		cpus_offset = fdt_path_offset(fdt, "/cpus");
  1009		if (cpus_offset == -FDT_ERR_NOTFOUND || cpus_offset > 0) {
  1010			if (cpus_offset > 0) {
  1011				ret = fdt_del_node(fdt, cpus_offset);
  1012				if (ret < 0) {
  1013					pr_err("Error deleting /cpus node: %s\n",
  1014					       fdt_strerror(ret));
  1015					return -EINVAL;
  1016				}
  1017			}
  1018	
  1019			/* Add cpus node to fdt */
  1020			cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"),
  1021						      "cpus");
  1022			if (cpus_offset < 0) {
  1023				pr_err("Error creating /cpus node: %s\n",
  1024				       fdt_strerror(cpus_offset));
  1025				return -EINVAL;
  1026			}
  1027	
  1028			/* Add cpus node properties */
  1029			cpus_node = of_find_node_by_path("/cpus");
  1030			ret = add_node_prop(fdt, cpus_offset, cpus_node);
  1031			if (ret < 0)
  1032				return ret;
  1033	
  1034			/* Loop through all subnodes of cpus and add them to fdt */
  1035			for_each_node_by_type(dn, "cpu") {
  1036				cpus_subnode_off = fdt_add_subnode(fdt,
  1037								   cpus_offset,
  1038								   dn->full_name);
  1039				if (cpus_subnode_off < 0) {
  1040					pr_err("Unable to add %s subnode: %s\n",
  1041					       dn->full_name, fdt_strerror(cpus_subnode_off));
  1042					return cpus_subnode_off;
  1043				}
  1044				ret = add_node_prop(fdt, cpus_subnode_off, dn);
  1045				if (ret < 0)
  1046					return ret;
  1047			}
  1048		} else if (cpus_offset < 0) {
  1049			pr_err("Malformed device tree: error reading /cpus node: %s\n",
  1050			       fdt_strerror(cpus_offset));
  1051		}
  1052	
  1053		return ret;
  1054	}
  1055	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 72716 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20210416/3cc5c29d/attachment-0001.gz>


More information about the Linuxppc-dev mailing list