All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 1/4] drivers core: Introduce CPU type sysfs interface
Date: Sat, 03 Oct 2020 16:07:06 +0800	[thread overview]
Message-ID: <202010031613.c0s0moHM-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201003011745.7768-2-ricardo.neri-calderon@linux.intel.com>
References: <20201003011745.7768-2-ricardo.neri-calderon@linux.intel.com>
TO: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
TO: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
TO: x86(a)kernel.org
TO: Borislav Petkov <bp@suse.de>
TO: Ingo Molnar <mingo@kernel.org>
TO: Thomas Gleixner <tglx@linutronix.de>
TO: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
CC: Tony Luck <tony.luck@intel.com>
CC: Len Brown <len.brown@intel.com>
CC: "Ravi V. Shankar" <ravi.v.shankar@intel.com>
CC: linux-kernel(a)vger.kernel.org

Hi Ricardo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/x86/core]
[also build test WARNING on tip/master driver-core/driver-core-testing linus/master v5.9-rc7 next-20201002]
[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/Ricardo-Neri/drivers-core-Introduce-CPU-type-sysfs-interface/20201003-091754
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 238c91115cd05c71447ea071624a4c9fe661f970
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: s390-randconfig-m031-20201002 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/base/cpu.c:735 cpu_type_sysfs_online() warn: we never enter this loop
drivers/base/cpu.c:772 cpu_type_sysfs_offline() warn: we never enter this loop

Old smatch warnings:
drivers/base/cpu.c:747 cpu_type_sysfs_online() error: we previously assumed 'mask' could be null (see line 747)
drivers/base/cpu.c:779 cpu_type_sysfs_offline() error: we previously assumed 'mask' could be null (see line 779)

vim +735 drivers/base/cpu.c

110646cfb07328 Ricardo Neri 2020-10-02  728  
110646cfb07328 Ricardo Neri 2020-10-02  729  static int cpu_type_sysfs_online(unsigned int cpu)
110646cfb07328 Ricardo Neri 2020-10-02  730  {
110646cfb07328 Ricardo Neri 2020-10-02  731  	u32 cpu_type = arch_get_cpu_type(cpu);
110646cfb07328 Ricardo Neri 2020-10-02  732  	struct cpumask *mask;
110646cfb07328 Ricardo Neri 2020-10-02  733  	int i;
110646cfb07328 Ricardo Neri 2020-10-02  734  
110646cfb07328 Ricardo Neri 2020-10-02 @735  	for (i = 0; i < ARRAY_SIZE(cpu_type_devices); i++) {
110646cfb07328 Ricardo Neri 2020-10-02  736  		u32 this_cpu_type;
110646cfb07328 Ricardo Neri 2020-10-02  737  
110646cfb07328 Ricardo Neri 2020-10-02  738  		/*
110646cfb07328 Ricardo Neri 2020-10-02  739  		 * The first devices in the array are used first. Thus, create
110646cfb07328 Ricardo Neri 2020-10-02  740  		 * a new device as well as sysfs directory and for the type of
110646cfb07328 Ricardo Neri 2020-10-02  741  		 * @cpu.
110646cfb07328 Ricardo Neri 2020-10-02  742  		 */
110646cfb07328 Ricardo Neri 2020-10-02  743  		if (!cpu_type_devices[i])
110646cfb07328 Ricardo Neri 2020-10-02  744  			return cpu_type_create_device(cpu, i);
110646cfb07328 Ricardo Neri 2020-10-02  745  
110646cfb07328 Ricardo Neri 2020-10-02  746  		mask = dev_get_drvdata(cpu_type_devices[i]);
110646cfb07328 Ricardo Neri 2020-10-02  747  		if (!mask && !cpumask_weight(mask)) {
110646cfb07328 Ricardo Neri 2020-10-02  748  			/*
110646cfb07328 Ricardo Neri 2020-10-02  749  			 * We should not be here. Be paranoid about
110646cfb07328 Ricardo Neri 2020-10-02  750  			 * NULL pointers.
110646cfb07328 Ricardo Neri 2020-10-02  751  			 */
110646cfb07328 Ricardo Neri 2020-10-02  752  			dev_err(cpu_type_devices[i], "CPU mask is invalid");
110646cfb07328 Ricardo Neri 2020-10-02  753  			return -EINVAL;
110646cfb07328 Ricardo Neri 2020-10-02  754  		}
110646cfb07328 Ricardo Neri 2020-10-02  755  
110646cfb07328 Ricardo Neri 2020-10-02  756  		this_cpu_type = arch_get_cpu_type(cpumask_first(mask));
110646cfb07328 Ricardo Neri 2020-10-02  757  		if (cpu_type == this_cpu_type) {
110646cfb07328 Ricardo Neri 2020-10-02  758  			cpumask_set_cpu(cpu, mask);
110646cfb07328 Ricardo Neri 2020-10-02  759  			return 0;
110646cfb07328 Ricardo Neri 2020-10-02  760  		}
110646cfb07328 Ricardo Neri 2020-10-02  761  	}
110646cfb07328 Ricardo Neri 2020-10-02  762  
110646cfb07328 Ricardo Neri 2020-10-02  763  	return -ENODEV;
110646cfb07328 Ricardo Neri 2020-10-02  764  }
110646cfb07328 Ricardo Neri 2020-10-02  765  
110646cfb07328 Ricardo Neri 2020-10-02  766  static int cpu_type_sysfs_offline(unsigned int cpu)
110646cfb07328 Ricardo Neri 2020-10-02  767  {
110646cfb07328 Ricardo Neri 2020-10-02  768  	u32 cpu_type = arch_get_cpu_type(cpu);
110646cfb07328 Ricardo Neri 2020-10-02  769  	struct cpumask *mask;
110646cfb07328 Ricardo Neri 2020-10-02  770  	int i;
110646cfb07328 Ricardo Neri 2020-10-02  771  
110646cfb07328 Ricardo Neri 2020-10-02 @772  	for (i = 0; i < ARRAY_SIZE(cpu_type_devices); i++) {
110646cfb07328 Ricardo Neri 2020-10-02  773  		u32 this_cpu_type;
110646cfb07328 Ricardo Neri 2020-10-02  774  
110646cfb07328 Ricardo Neri 2020-10-02  775  		if (!cpu_type_devices[i])
110646cfb07328 Ricardo Neri 2020-10-02  776  			continue;
110646cfb07328 Ricardo Neri 2020-10-02  777  
110646cfb07328 Ricardo Neri 2020-10-02  778  		mask = dev_get_drvdata(cpu_type_devices[i]);
110646cfb07328 Ricardo Neri 2020-10-02  779  		if (!mask && !cpumask_weight(mask)) {
110646cfb07328 Ricardo Neri 2020-10-02  780  			/*
110646cfb07328 Ricardo Neri 2020-10-02  781  			 * We should not be here. Be paranoid about
110646cfb07328 Ricardo Neri 2020-10-02  782  			 * NULL pointers.
110646cfb07328 Ricardo Neri 2020-10-02  783  			 */
110646cfb07328 Ricardo Neri 2020-10-02  784  			dev_err(cpu_type_devices[i], "CPU mask is invalid");
110646cfb07328 Ricardo Neri 2020-10-02  785  			continue;
110646cfb07328 Ricardo Neri 2020-10-02  786  		}
110646cfb07328 Ricardo Neri 2020-10-02  787  
110646cfb07328 Ricardo Neri 2020-10-02  788  		this_cpu_type = arch_get_cpu_type(cpumask_first(mask));
110646cfb07328 Ricardo Neri 2020-10-02  789  		if (cpu_type == this_cpu_type) {
110646cfb07328 Ricardo Neri 2020-10-02  790  			cpumask_clear_cpu(cpu, mask);
110646cfb07328 Ricardo Neri 2020-10-02  791  			return 0;
110646cfb07328 Ricardo Neri 2020-10-02  792  		}
110646cfb07328 Ricardo Neri 2020-10-02  793  	}
110646cfb07328 Ricardo Neri 2020-10-02  794  
110646cfb07328 Ricardo Neri 2020-10-02  795  	/*
110646cfb07328 Ricardo Neri 2020-10-02  796  	 * If we are here, no matching cpu_type was found. This CPU was not
110646cfb07328 Ricardo Neri 2020-10-02  797  	 * accounted for@hotplug online.
110646cfb07328 Ricardo Neri 2020-10-02  798  	 */
110646cfb07328 Ricardo Neri 2020-10-02  799  	pr_warn("Unexpected CPU offline!\n");
110646cfb07328 Ricardo Neri 2020-10-02  800  
110646cfb07328 Ricardo Neri 2020-10-02  801  	return -ENODEV;
110646cfb07328 Ricardo Neri 2020-10-02  802  }
110646cfb07328 Ricardo Neri 2020-10-02  803  

---
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: 20713 bytes --]

             reply	other threads:[~2020-10-03  8:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03  8:07 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-03  1:17 [PATCH 0/4] drivers core: Introduce CPU type sysfs interface Ricardo Neri
2020-10-03  1:17 ` [PATCH 1/4] " Ricardo Neri
2020-10-03  3:27   ` Randy Dunlap
2020-10-06  1:15     ` Ricardo Neri
2020-10-10  3:14       ` Randy Dunlap
2020-10-03  8:53   ` Greg Kroah-Hartman
2020-10-03 11:05     ` Greg Kroah-Hartman
2020-10-06  1:08       ` Ricardo Neri
2020-10-06  0:57     ` Ricardo Neri
2020-10-06  7:37       ` Greg Kroah-Hartman
2020-10-07  3:14         ` Ricardo Neri
2020-10-07  5:15           ` Greg Kroah-Hartman
2020-10-08  3:34             ` Ricardo Neri
2020-11-12  6:19             ` Brice Goglin
2020-11-12  6:42               ` Greg Kroah-Hartman
2020-11-12  9:10                 ` Brice Goglin
2020-11-12 10:49                   ` Greg Kroah-Hartman
2020-11-17 15:55                     ` Brice Goglin
2020-11-18 10:45                       ` Brice Goglin
2020-11-18 10:57                         ` Greg Kroah-Hartman
     [not found]                     ` <38f290d2-4c3a-d1b0-f3cc-a0897ea10abd@gmail.com>
2020-11-12 11:34                       ` Greg Kroah-Hartman
2020-11-19  8:25                       ` Fox Chen

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=202010031613.c0s0moHM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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.