All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Sourabh Jain <sourabhjain@linux.ibm.com>, mpe@ellerman.id.au
Cc: mahesh@linux.vnet.ibm.com, kbuild-all@lists.01.org,
	hbathini@linux.ibm.com, bauerman@linux.ibm.com,
	linuxppc-dev@ozlabs.org
Subject: Re: [PATCH v2] powerpc/kexec_file: use current CPU info while setting up FDT
Date: Fri, 16 Apr 2021 23:27:09 +0800	[thread overview]
Message-ID: <202104162334.bayeV25Z-lkp@intel.com> (raw)
In-Reply-To: <20210416124658.718860-1-sourabhjain@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 5194 bytes --]

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@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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 72716 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2] powerpc/kexec_file: use current CPU info while setting up FDT
Date: Fri, 16 Apr 2021 23:27:09 +0800	[thread overview]
Message-ID: <202104162334.bayeV25Z-lkp@intel.com> (raw)
In-Reply-To: <20210416124658.718860-1-sourabhjain@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 5331 bytes --]

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@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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 72716 bytes --]

  reply	other threads:[~2021-04-16 15:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 12:46 [PATCH v2] powerpc/kexec_file: use current CPU info while setting up FDT Sourabh Jain
2021-04-16 15:27 ` kernel test robot [this message]
2021-04-16 15:27   ` kernel test robot
2021-04-16 18:08 ` Hari Bathini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202104162334.bayeV25Z-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bauerman@linux.ibm.com \
    --cc=hbathini@linux.ibm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=sourabhjain@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.