Hi Pingfan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.17-rc5 next-20180511]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Pingfan-Liu/powerpc-cpu-nr_cpu_ids-should-be-aligned-on-threads_per_core/20180514-141629
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allnoconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   arch/powerpc/kernel/prom.c: In function 'early_init_dt_scan_cpus':
>> arch/powerpc/kernel/prom.c:370:14: error: lvalue required as left operand of 
>> assignment
      nr_cpu_ids = nr_cpus_aligned;
                 ^

vim +370 arch/powerpc/kernel/prom.c

   306  
   307  static int __init early_init_dt_scan_cpus(unsigned long node,
   308                                            const char *uname, int depth,
   309                                            void *data)
   310  {
   311          const char *type = of_get_flat_dt_prop(node, "device_type", 
NULL);
   312          const __be32 *prop;
   313          const __be32 *intserv;
   314          int i, nthreads;
   315          int len;
   316          int found = -1;
   317          int found_thread = 0;
   318          unsigned int nr_cpus_aligned;
   319  
   320          /* We are scanning "cpu" nodes only */
   321          if (type == NULL || strcmp(type, "cpu") != 0)
   322                  return 0;
   323  
   324          /* Get physical cpuid */
   325          intserv = of_get_flat_dt_prop(node, 
"ibm,ppc-interrupt-server#s", &len);
   326          if (!intserv)
   327                  intserv = of_get_flat_dt_prop(node, "reg", &len);
   328  
   329          nthreads = len / sizeof(int);
   330  
   331          /*
   332           * Now see if any of these threads match our boot cpu.
   333           * NOTE: This must match the parsing done in smp_setup_cpu_maps.
   334           */
   335          for (i = 0; i < nthreads; i++) {
   336                  /*
   337                   * version 2 of the kexec param format adds the phys 
cpuid of
   338                   * booted proc.
   339                   */
   340                  if (fdt_version(initial_boot_params) >= 2) {
   341                          if (be32_to_cpu(intserv[i]) ==
   342                              fdt_boot_cpuid_phys(initial_boot_params)) {
   343                                  found = boot_cpu_count;
   344                                  found_thread = i;
   345                          }
   346                  } else {
   347                          /*
   348                           * Check if it's the boot-cpu, set it's hw 
index now,
   349                           * unfortunately this format did not support 
booting
   350                           * off secondary threads.
   351                           */
   352                          if (of_get_flat_dt_prop(node,
   353                                          "linux,boot-cpu", NULL) != NULL)
   354                                  found = boot_cpu_count;
   355                  }
   356  #ifdef CONFIG_SMP
   357                  /* logical cpu id is always 0 on UP kernels */
   358                  boot_cpu_count++;
   359  #endif
   360          }
   361  
   362          /* Not the boot CPU */
   363          if (found < 0)
   364                  return 0;
   365          /* to work around p8 subcore mode */
   366          nr_cpus_aligned = _ALIGN_UP(nr_cpu_ids, nthreads);
   367          if (nr_cpus_aligned != nr_cpu_ids) {
   368                  pr_info("nr_cpus is forced to align up on 
threads_per_core,"
   369                          "from %u to %u\n", nr_cpu_ids, nr_cpus_aligned);
 > 370                  nr_cpu_ids = nr_cpus_aligned;
   371          }
   372          DBG("boot cpu: logical %d physical %d\n", found,
   373              be32_to_cpu(intserv[found_thread]));
   374          boot_cpuid = found;
   375  
   376          /*
   377           * PAPR defines "logical" PVR values for cpus that
   378           * meet various levels of the architecture:
   379           * 0x0f000001   Architecture version 2.04
   380           * 0x0f000002   Architecture version 2.05
   381           * If the cpu-version property in the cpu node contains
   382           * such a value, we call identify_cpu again with the
   383           * logical PVR value in order to use the cpu feature
   384           * bits appropriate for the architecture level.
   385           *
   386           * A POWER6 partition in "POWER6 architected" mode
   387           * uses the 0x0f000002 PVR value; in POWER5+ mode
   388           * it uses 0x0f000001.
   389           *
   390           * If we're using device tree CPU feature discovery then we 
don't
   391           * support the cpu-version property, and it's the 
responsibility of the
   392           * firmware/hypervisor to provide the correct feature set for 
the
   393           * architecture level via the ibm,powerpc-cpu-features binding.
   394           */
   395          if (!dt_cpu_ftrs_in_use()) {
   396                  prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
   397                  if (prop && (be32_to_cpup(prop) & 0xff000000) == 
0x0f000000)
   398                          identify_cpu(0, be32_to_cpup(prop));
   399  
   400                  check_cpu_feature_properties(node);
   401                  check_cpu_pa_features(node);
   402          }
   403  
   404          identical_pvr_fixup(node);
   405          init_mmu_slb_size(node);
   406  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to