[peterz-queue:sched/wip2 3/5] kernel/sched/core.c:2601:24: error: 'struct rq' has no member named 'hotplug_wait'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/wip2
head: fb0089110c5e29151c75028add05458ad2bf8a68
commit: b89bc5672b8331856b35fa6f63117c9832dd7416 [3/5] sched/core: Wait for tasks being pushed away on hotplug
config: alpha-allyesconfig (attached as .config)
compiler: alpha-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
git checkout b89bc5672b8331856b35fa6f63117c9832dd7416
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
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 >>):
kernel/sched/core.c:2380:6: warning: no previous prototype for 'sched_set_stop_task' [-Wmissing-prototypes]
2380 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~
In file included from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from include/linux/huge_mm.h:8,
from include/linux/mm.h:677,
from arch/alpha/include/asm/io.h:8,
from include/linux/clocksource.h:21,
from include/linux/clockchips.h:14,
from include/linux/tick.h:8,
from include/linux/sched/isolation.h:6,
from kernel/sched/sched.h:17,
from kernel/sched/core.c:13:
kernel/sched/core.c: In function 'balance_hotplug_wait':
>> kernel/sched/core.c:2601:24: error: 'struct rq' has no member named 'hotplug_wait'
2601 | rcuwait_wait_event(&rq->hotplug_wait, rq->nr_running == 1,
| ^~
include/linux/rcuwait.h:59:21: note: in definition of macro 'rcuwait_wait_event'
59 | prepare_to_rcuwait(w); \
| ^
>> kernel/sched/core.c:2601:24: error: 'struct rq' has no member named 'hotplug_wait'
2601 | rcuwait_wait_event(&rq->hotplug_wait, rq->nr_running == 1,
| ^~
include/linux/rcuwait.h:76:17: note: in definition of macro 'rcuwait_wait_event'
76 | finish_rcuwait(w); \
| ^
kernel/sched/core.c: In function 'schedule_tail':
kernel/sched/core.c:3765:13: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
3765 | struct rq *rq;
| ^~
kernel/sched/core.c: At top level:
>> kernel/sched/core.c:6968:20: error: redefinition of 'balance_hotplug_wait'
6968 | static inline void balance_hotplug_wait(void) { }
| ^~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:2597:13: note: previous definition of 'balance_hotplug_wait' was here
2597 | static void balance_hotplug_wait(void)
| ^~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c: In function 'sched_cpu_activate':
kernel/sched/core.c:7055:2: error: implicit declaration of function 'balance_push_set'; did you mean 'balance_push'? [-Werror=implicit-function-declaration]
7055 | balance_push_set(cpu, false);
| ^~~~~~~~~~~~~~~~
| balance_push
At top level:
kernel/sched/core.c:2597:13: warning: 'balance_hotplug_wait' defined but not used [-Wunused-function]
2597 | static void balance_hotplug_wait(void)
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/wip2
git checkout b89bc5672b8331856b35fa6f63117c9832dd7416
vim +2601 kernel/sched/core.c
2590
2591 /*
2592 * Invoked from a CPUs hotplug control thread after the CPU has been marked
2593 * inactive. All tasks which are not per CPU kernel threads are either
2594 * pushed off this CPU now via balance_push() or placed on a different CPU
2595 * during wakeup. Wait until the CPU is quiescent.
2596 */
2597 static void balance_hotplug_wait(void)
2598 {
2599 struct rq *rq = this_rq();
2600
> 2601 rcuwait_wait_event(&rq->hotplug_wait, rq->nr_running == 1,
2602 TASK_UNINTERRUPTIBLE);
2603 }
2604
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[peterz-queue:sched/wip2 2/5] kernel/sched/core.c:6869:2: error: implicit declaration of function 'update_rq_clockrq'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/wip2
head: fb0089110c5e29151c75028add05458ad2bf8a68
commit: 4668b8e3eb50c6b6efeffb610dfaa1e698ee2040 [2/5] sched/hotplug: Ensure only per-cpu kthreads run during hotplug
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
git checkout 4668b8e3eb50c6b6efeffb610dfaa1e698ee2040
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>):
kernel/sched/core.c:2380:6: warning: no previous prototype for 'sched_set_stop_task' [-Wmissing-prototypes]
2380 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/core.c: In function 'schedule_tail':
kernel/sched/core.c:3751:13: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
3751 | struct rq *rq;
| ^~
kernel/sched/core.c: In function '__balance_push_cpu_stop':
>> kernel/sched/core.c:6869:2: error: implicit declaration of function 'update_rq_clockrq'; did you mean 'update_rq_clock'? [-Werror=implicit-function-declaration]
6869 | update_rq_clockrq();
| ^~~~~~~~~~~~~~~~~
| update_rq_clock
cc1: some warnings being treated as errors
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/wip2
git checkout 4668b8e3eb50c6b6efeffb610dfaa1e698ee2040
vim +6869 kernel/sched/core.c
6858
6859 static int __balance_push_cpu_stop(void *arg)
6860 {
6861 struct task_struct *p = arg;
6862 struct rq *rq = this_rq();
6863 struct rq_flags rf;
6864 int cpu;
6865
6866 raw_spin_lock_irq(&p->pi_lock);
6867 rq_lock(rq, &rf);
6868
> 6869 update_rq_clockrq();
6870
6871 if (task_rq(p) == rq && task_on_rq_queued(p)) {
6872 cpu = select_fallback_rq(rq->cpu, p);
6873 rq = __migrate_task(rq, &rf, p, cpu);
6874 }
6875
6876 rq_unlock(rq, &rf);
6877 raw_spin_unlock_irq(&p->pi_lock);
6878
6879 put_task_struct(p);
6880
6881 return 0;
6882 }
6883
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[hch-misc:hmm-headers 1/1] drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:2483:2: error: implicit declaration of function 'clflush_cache_range'
by kernel test robot
tree: git://git.infradead.org/users/hch/misc.git hmm-headers
head: eacffa71b75f2486263f460f97583c2198f9a830
commit: eacffa71b75f2486263f460f97583c2198f9a830 [1/1] hmm: remove unneeded #includes
config: x86_64-randconfig-a014-20200916 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 9e3842d60351f986d77dfe0a94f76e4fd895f188)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout eacffa71b75f2486263f460f97583c2198f9a830
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:2305:5: warning: no previous prototype for function 'parse_ta_bin_descriptor' [-Wmissing-prototypes]
int parse_ta_bin_descriptor(struct psp_context *psp,
^
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:2305:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int parse_ta_bin_descriptor(struct psp_context *psp,
^
static
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:2483:2: error: implicit declaration of function 'clflush_cache_range' [-Werror,-Wimplicit-function-declaration]
clflush_cache_range(cpu_addr, (usbc_pd_fw->size & ~(L1_CACHE_BYTES - 1)));
^
1 warning and 1 error generated.
git remote add hch-misc git://git.infradead.org/users/hch/misc.git
git fetch --no-tags hch-misc hmm-headers
git checkout eacffa71b75f2486263f460f97583c2198f9a830
vim +/clflush_cache_range +2483 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2443
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2444 static ssize_t psp_usbc_pd_fw_sysfs_write(struct device *dev,
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2445 struct device_attribute *attr,
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2446 const char *buf,
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2447 size_t count)
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2448 {
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2449 struct drm_device *ddev = dev_get_drvdata(dev);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2450 struct amdgpu_device *adev = ddev->dev_private;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2451 void *cpu_addr;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2452 dma_addr_t dma_addr;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2453 int ret;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2454 char fw_name[100];
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2455 const struct firmware *usbc_pd_fw;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2456
90f88cdd7c8d6a6 Andrey Grodzovsky 2020-03-04 2457 if (!adev->ip_blocks[AMD_IP_BLOCK_TYPE_PSP].status.late_initialized) {
90f88cdd7c8d6a6 Andrey Grodzovsky 2020-03-04 2458 DRM_INFO("PSP block is not ready yet.");
90f88cdd7c8d6a6 Andrey Grodzovsky 2020-03-04 2459 return -EBUSY;
90f88cdd7c8d6a6 Andrey Grodzovsky 2020-03-04 2460 }
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2461
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2462 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s", buf);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2463 ret = request_firmware(&usbc_pd_fw, fw_name, adev->dev);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2464 if (ret)
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2465 goto fail;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2466
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2467 /* We need contiguous physical mem to place the FW for psp to access */
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2468 cpu_addr = dma_alloc_coherent(adev->dev, usbc_pd_fw->size, &dma_addr, GFP_KERNEL);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2469
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2470 ret = dma_mapping_error(adev->dev, dma_addr);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2471 if (ret)
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2472 goto rel_buf;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2473
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2474 memcpy_toio(cpu_addr, usbc_pd_fw->data, usbc_pd_fw->size);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2475
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2476 /*
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2477 * x86 specific workaround.
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2478 * Without it the buffer is invisible in PSP.
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2479 *
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2480 * TODO Remove once PSP starts snooping CPU cache
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2481 */
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2482 #ifdef CONFIG_X86
57430471e2fa60a Andrey Grodzovsky 2019-12-19 @2483 clflush_cache_range(cpu_addr, (usbc_pd_fw->size & ~(L1_CACHE_BYTES - 1)));
6863d60732acf57 Andrey Grodzovsky 2020-03-04 2484 #endif
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2485
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2486 mutex_lock(&adev->psp.mutex);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2487 ret = psp_load_usbc_pd_fw(&adev->psp, dma_addr);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2488 mutex_unlock(&adev->psp.mutex);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2489
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2490 rel_buf:
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2491 dma_free_coherent(adev->dev, usbc_pd_fw->size, cpu_addr, dma_addr);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2492 release_firmware(usbc_pd_fw);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2493
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2494 fail:
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2495 if (ret) {
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2496 DRM_ERROR("Failed to load USBC PD FW, err = %d", ret);
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2497 return ret;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2498 }
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2499
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2500 return count;
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2501 }
57430471e2fa60a Andrey Grodzovsky 2019-12-19 2502
:::::: The code at line 2483 was first introduced by commit
:::::: 57430471e2fa60a412e220fa3014567e792aaa6f drm/amdgpu: Add support for USBC PD FW download
:::::: TO: Andrey Grodzovsky <andrey.grodzovsky(a)amd.com>
:::::: CC: Alex Deucher <alexander.deucher(a)amd.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[peterz-queue:sched/wip2 5/5] kernel/sched/core.c:6058:47: error: 'SCA_CHECK' undeclared
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/wip2
head: fb0089110c5e29151c75028add05458ad2bf8a68
commit: fb0089110c5e29151c75028add05458ad2bf8a68 [5/5] sched: Massage set_cpus_allowed
config: alpha-randconfig-r022-20200916 (attached as .config)
compiler: alpha-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
git checkout fb0089110c5e29151c75028add05458ad2bf8a68
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
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/alpha/include/asm/bug.h:23,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/current.h:5,
from ./arch/alpha/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
from include/linux/sched/numa_balancing.h:10,
from include/trace/events/sched.h:8,
from kernel/sched/core.c:10:
kernel/sched/sched.h: In function 'rq_pin_lock':
kernel/sched/sched.h:1229:18: error: 'struct rq' has no member named 'balance_callback'
1229 | SCHED_WARN_ON(rq->balance_callback);
| ^~
include/asm-generic/bug.h:157:27: note: in definition of macro 'WARN_ONCE'
157 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
kernel/sched/sched.h:1229:2: note: in expansion of macro 'SCHED_WARN_ON'
1229 | SCHED_WARN_ON(rq->balance_callback);
| ^~~~~~~~~~~~~
kernel/sched/core.c: In function 'ttwu_stat':
kernel/sched/core.c:2456:13: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
2456 | struct rq *rq;
| ^~
kernel/sched/core.c: In function 'schedule_tail':
kernel/sched/core.c:3798:13: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
3798 | struct rq *rq;
| ^~
kernel/sched/core.c: In function 'sched_setaffinity':
>> kernel/sched/core.c:6058:47: error: 'SCA_CHECK' undeclared (first use in this function)
6058 | retval = __set_cpus_allowed_ptr(p, new_mask, SCA_CHECK);
| ^~~~~~~~~
kernel/sched/core.c:6058:47: note: each undeclared identifier is reported only once for each function it appears in
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/wip2
git checkout fb0089110c5e29151c75028add05458ad2bf8a68
vim +/SCA_CHECK +6058 kernel/sched/core.c
5991
5992 long sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
5993 {
5994 cpumask_var_t cpus_allowed, new_mask;
5995 struct task_struct *p;
5996 int retval;
5997
5998 rcu_read_lock();
5999
6000 p = find_process_by_pid(pid);
6001 if (!p) {
6002 rcu_read_unlock();
6003 return -ESRCH;
6004 }
6005
6006 /* Prevent p going away */
6007 get_task_struct(p);
6008 rcu_read_unlock();
6009
6010 if (p->flags & PF_NO_SETAFFINITY) {
6011 retval = -EINVAL;
6012 goto out_put_task;
6013 }
6014 if (!alloc_cpumask_var(&cpus_allowed, GFP_KERNEL)) {
6015 retval = -ENOMEM;
6016 goto out_put_task;
6017 }
6018 if (!alloc_cpumask_var(&new_mask, GFP_KERNEL)) {
6019 retval = -ENOMEM;
6020 goto out_free_cpus_allowed;
6021 }
6022 retval = -EPERM;
6023 if (!check_same_owner(p)) {
6024 rcu_read_lock();
6025 if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE)) {
6026 rcu_read_unlock();
6027 goto out_free_new_mask;
6028 }
6029 rcu_read_unlock();
6030 }
6031
6032 retval = security_task_setscheduler(p);
6033 if (retval)
6034 goto out_free_new_mask;
6035
6036
6037 cpuset_cpus_allowed(p, cpus_allowed);
6038 cpumask_and(new_mask, in_mask, cpus_allowed);
6039
6040 /*
6041 * Since bandwidth control happens on root_domain basis,
6042 * if admission test is enabled, we only admit -deadline
6043 * tasks allowed to run on all the CPUs in the task's
6044 * root_domain.
6045 */
6046 #ifdef CONFIG_SMP
6047 if (task_has_dl_policy(p) && dl_bandwidth_enabled()) {
6048 rcu_read_lock();
6049 if (!cpumask_subset(task_rq(p)->rd->span, new_mask)) {
6050 retval = -EBUSY;
6051 rcu_read_unlock();
6052 goto out_free_new_mask;
6053 }
6054 rcu_read_unlock();
6055 }
6056 #endif
6057 again:
> 6058 retval = __set_cpus_allowed_ptr(p, new_mask, SCA_CHECK);
6059
6060 if (!retval) {
6061 cpuset_cpus_allowed(p, cpus_allowed);
6062 if (!cpumask_subset(new_mask, cpus_allowed)) {
6063 /*
6064 * We must have raced with a concurrent cpuset
6065 * update. Just reset the cpus_allowed to the
6066 * cpuset's cpus_allowed
6067 */
6068 cpumask_copy(new_mask, cpus_allowed);
6069 goto again;
6070 }
6071 }
6072 out_free_new_mask:
6073 free_cpumask_var(new_mask);
6074 out_free_cpus_allowed:
6075 free_cpumask_var(cpus_allowed);
6076 out_put_task:
6077 put_task_struct(p);
6078 return retval;
6079 }
6080
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[peterz-queue:x86/pti 3/5] arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/pti
head: 767d46ab566dd489733666efe48732d523c8c332
commit: a9210620ec360f7375282ff1d35c8f8016ccc986 [3/5] x86/mm: Optionally flush L1D on context switch
config: i386-randconfig-s002-20200916 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-201-g24bdaac6-dirty
git checkout a9210620ec360f7375282ff1d35c8f8016ccc986
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
>> arch/x86/mm/tlb.c:426:36: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
>> arch/x86/mm/tlb.c:426:36: sparse: expected void const [noderef] __percpu *__vpp_verify
>> arch/x86/mm/tlb.c:426:36: sparse: got bool *
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/pti
git checkout a9210620ec360f7375282ff1d35c8f8016ccc986
vim +426 arch/x86/mm/tlb.c
347
348 static void cond_mitigation(struct task_struct *next)
349 {
350 unsigned long prev_mm, next_mm;
351
352 if (!next || !next->mm)
353 return;
354
355 next_mm = mm_mangle_tif_spec_bits(next);
356 prev_mm = this_cpu_read(cpu_tlbstate.last_user_mm_spec);
357
358 /*
359 * Avoid user/user BTB poisoning by flushing the branch predictor
360 * when switching between processes. This stops one process from
361 * doing Spectre-v2 attacks on another.
362 *
363 * Both, the conditional and the always IBPB mode use the mm
364 * pointer to avoid the IBPB when switching between tasks of the
365 * same process. Using the mm pointer instead of mm->context.ctx_id
366 * opens a hypothetical hole vs. mm_struct reuse, which is more or
367 * less impossible to control by an attacker. Aside of that it
368 * would only affect the first schedule so the theoretically
369 * exposed data is not really interesting.
370 */
371 if (static_branch_likely(&switch_mm_cond_ibpb)) {
372 /*
373 * This is a bit more complex than the always mode because
374 * it has to handle two cases:
375 *
376 * 1) Switch from a user space task (potential attacker)
377 * which has TIF_SPEC_IB set to a user space task
378 * (potential victim) which has TIF_SPEC_IB not set.
379 *
380 * 2) Switch from a user space task (potential attacker)
381 * which has TIF_SPEC_IB not set to a user space task
382 * (potential victim) which has TIF_SPEC_IB set.
383 *
384 * This could be done by unconditionally issuing IBPB when
385 * a task which has TIF_SPEC_IB set is either scheduled in
386 * or out. Though that results in two flushes when:
387 *
388 * - the same user space task is scheduled out and later
389 * scheduled in again and only a kernel thread ran in
390 * between.
391 *
392 * - a user space task belonging to the same process is
393 * scheduled in after a kernel thread ran in between
394 *
395 * - a user space task belonging to the same process is
396 * scheduled in immediately.
397 *
398 * Optimize this with reasonably small overhead for the
399 * above cases. Mangle the TIF_SPEC_IB bit into the mm
400 * pointer of the incoming task which is stored in
401 * cpu_tlbstate.last_user_mm_spec for comparison.
402 *
403 * Issue IBPB only if the mm's are different and one or
404 * both have the IBPB bit set.
405 */
406 if (next_mm != prev_mm &&
407 (next_mm | prev_mm) & LAST_USER_MM_IBPB)
408 indirect_branch_prediction_barrier();
409 }
410
411 if (static_branch_unlikely(&switch_mm_always_ibpb)) {
412 /*
413 * Only flush when switching to a user space task with a
414 * different context than the user space task which ran
415 * last on this CPU.
416 */
417 if ((prev_mm & ~LAST_USER_MM_SPEC_MASK) !=
418 (unsigned long)next->mm)
419 indirect_branch_prediction_barrier();
420 }
421
422 /*
423 * Flush only if SMT is disabled as per the contract, which is checked
424 * when the feature is enabled.
425 */
> 426 if (sched_smt_active() && !this_cpu_read(cpu_info.smt_active) &&
427 (prev_mm & LAST_USER_MM_L1D_FLUSH))
428 l1d_flush_hw();
429
430 this_cpu_write(cpu_tlbstate.last_user_mm_spec, next_mm);
431 }
432
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[char-misc:char-misc-testing 43/50] drivers/android/binder_latency_tracer.c:25:6: warning: no previous prototype for 'probe_binder_txn_latency_free'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing
head: c248e6b8a8fe4cfe382f49324d776a04cc89c061
commit: 10f6fcd31b177c9b8efca992ec47ec30cf9ec9ed [43/50] binder: add transaction latency tracer
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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
git checkout 10f6fcd31b177c9b8efca992ec47ec30cf9ec9ed
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/android/binder_latency_tracer.c:25:6: warning: no previous prototype for 'probe_binder_txn_latency_free' [-Wmissing-prototypes]
25 | void probe_binder_txn_latency_free(void *ignore, struct binder_transaction *t,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/rtc.h:38,
from drivers/android/binder_internal.h:19,
from drivers/android/binder_latency_tracer.c:8:
drivers/android/binder_internal.h:125:23: warning: 'binder_transaction_log_fops' defined but not used [-Wunused-const-variable=]
125 | DEFINE_SHOW_ATTRIBUTE(binder_transaction_log);
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:173:37: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
173 | static const struct file_operations __name ## _fops = { \
| ^~~~~~
drivers/android/binder_internal.h:122:23: warning: 'binder_transactions_fops' defined but not used [-Wunused-const-variable=]
122 | DEFINE_SHOW_ATTRIBUTE(binder_transactions);
| ^~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:173:37: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
173 | static const struct file_operations __name ## _fops = { \
| ^~~~~~
drivers/android/binder_internal.h:119:23: warning: 'binder_state_fops' defined but not used [-Wunused-const-variable=]
119 | DEFINE_SHOW_ATTRIBUTE(binder_state);
| ^~~~~~~~~~~~
include/linux/seq_file.h:173:37: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
173 | static const struct file_operations __name ## _fops = { \
| ^~~~~~
drivers/android/binder_internal.h:116:23: warning: 'binder_stats_fops' defined but not used [-Wunused-const-variable=]
116 | DEFINE_SHOW_ATTRIBUTE(binder_stats);
| ^~~~~~~~~~~~
include/linux/seq_file.h:173:37: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
173 | static const struct file_operations __name ## _fops = { \
| ^~~~~~
# https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/comm...
git remote add char-misc https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
git fetch --no-tags char-misc char-misc-testing
git checkout 10f6fcd31b177c9b8efca992ec47ec30cf9ec9ed
vim +/probe_binder_txn_latency_free +25 drivers/android/binder_latency_tracer.c
10
11 /**
12 * The reason setting the binder_txn_latency_threshold to 2 sec
13 * is that most of timeout abort is greater or equal to 2 sec.
14 * Making it configurable to let all users determine which
15 * threshold is more suitable.
16 */
17 static uint32_t binder_txn_latency_threshold = 2;
18 module_param_named(threshold, binder_txn_latency_threshold,
19 uint, 0644);
20
21 /*
22 * probe_binder_txn_latency_free - Output info of a delay transaction
23 * @t: pointer to the over-time transaction
24 */
> 25 void probe_binder_txn_latency_free(void *ignore, struct binder_transaction *t,
26 int from_proc, int from_thread,
27 int to_proc, int to_thread)
28 {
29 struct rtc_time tm;
30 struct timespec64 *startime;
31 struct timespec64 cur, sub_t;
32
33 ktime_get_ts64(&cur);
34 startime = &t->ts;
35 sub_t = timespec64_sub(cur, *startime);
36
37 /* if transaction time is over than binder_txn_latency_threshold (sec),
38 * show timeout warning log.
39 */
40 if (sub_t.tv_sec < binder_txn_latency_threshold)
41 return;
42
43 rtc_time64_to_tm(t->real_ts.tv_sec, &tm);
44
45 pr_info_ratelimited("%d: from %d:%d to %d:%d",
46 t->debug_id, from_proc, from_thread,
47 to_proc, to_thread);
48
49 pr_info_ratelimited(" total %u.%03ld s code %u start %lu.%03ld android %d-%02d-%02d %02d:%02d:%02d.%03lu\n",
50 (unsigned int)sub_t.tv_sec,
51 (sub_t.tv_nsec / NSEC_PER_MSEC),
52 t->code,
53 (unsigned long)startime->tv_sec,
54 (startime->tv_nsec / NSEC_PER_MSEC),
55 (tm.tm_year + 1900), (tm.tm_mon + 1), tm.tm_mday,
56 tm.tm_hour, tm.tm_min, tm.tm_sec,
57 (unsigned long)(t->real_ts.tv_nsec / NSEC_PER_MSEC));
58 }
59
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[intel-linux-intel-lts:5.4/preempt-rt 1346/11140] sound/soc/sof/topology.c:729:40: warning: unused variable 'stream_tokens'
by kernel test robot
Hi Keyon,
FYI, the error/warning still remains.
tree: https://github.com/intel/linux-intel-lts.git 5.4/preempt-rt
head: e00ce2dbe204df8675b04a820f6a4e6fc0f784b1
commit: dd0a11b4604af8ca61e1e578409c61227dccc3ae [1346/11140] ASoC: SOF: token: add tokens for PCM compatible with D0i3 substate
config: x86_64-randconfig-a014-20200916 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 9e3842d60351f986d77dfe0a94f76e4fd895f188)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout dd0a11b4604af8ca61e1e578409c61227dccc3ae
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> sound/soc/sof/topology.c:729:40: warning: unused variable 'stream_tokens' [-Wunused-const-variable]
static const struct sof_topology_token stream_tokens[] = {
^
1 warning generated.
# https://github.com/intel/linux-intel-lts/commit/dd0a11b4604af8ca61e1e5784...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/preempt-rt
git checkout dd0a11b4604af8ca61e1e578409c61227dccc3ae
vim +/stream_tokens +729 sound/soc/sof/topology.c
727
728 /* PCM */
> 729 static const struct sof_topology_token stream_tokens[] = {
730 {SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3,
731 SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
732 offsetof(struct snd_sof_pcm, stream[0].d0i3_compatible), 0},
733 {SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3,
734 SND_SOC_TPLG_TUPLE_TYPE_BOOL, get_token_u16,
735 offsetof(struct snd_sof_pcm, stream[1].d0i3_compatible), 0},
736 };
737
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[kbuild] [toke:bpf-freplace-multi-attach-alt-04 3/8] kernel/bpf/verifier.c:11344 check_attach_btf_id() error: we previously assumed 'prog->aux->tgt_link' could be null (see line 11286)
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git bpf-freplace-multi-attach-alt-04
head: 4b32f3fa732bbc5ab739fc9a0b9864c66a6183fd
commit: b166eea4ca70570e9998331165242454c2a357c0 [3/8] bpf: wrap prog->aux->linked_prog in a bpf_tracing_link
config: x86_64-randconfig-m001-20200916 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
kernel/bpf/verifier.c:11344 check_attach_btf_id() error: we previously assumed 'prog->aux->tgt_link' could be null (see line 11286)
# https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git/commit/?id...
git remote add toke https://git.kernel.org/pub/scm/linux/kernel/git/toke/linux.git
git fetch --no-tags toke bpf-freplace-multi-attach-alt-04
git checkout b166eea4ca70570e9998331165242454c2a357c0
vim +11344 kernel/bpf/verifier.c
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11273 static int check_attach_btf_id(struct bpf_verifier_env *env)
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11274 {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11275 struct bpf_prog *prog = env->prog;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11276 u32 btf_id = prog->aux->attach_btf_id;
b166eea4ca70570 Toke Høiland-Jørgensen 2020-09-01 11277 struct bpf_prog *tgt_prog = NULL;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11278 struct btf_func_model fmodel;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11279 struct bpf_trampoline *tr;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11280 const struct btf_type *t;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11281 const char *tname;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11282 long addr;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11283 int ret;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11284 u64 key;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11285
b166eea4ca70570 Toke Høiland-Jørgensen 2020-09-01 @11286 if (prog->aux->tgt_link)
^^^^^^^^^^^^^^^^^^^
This code assumed ->tgt_link can be NULL.
b166eea4ca70570 Toke Høiland-Jørgensen 2020-09-01 11287 tgt_prog = prog->aux->tgt_link->tgt_prog;
b166eea4ca70570 Toke Høiland-Jørgensen 2020-09-01 11288
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11289 if (prog->aux->sleepable && prog->type != BPF_PROG_TYPE_TRACING &&
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11290 prog->type != BPF_PROG_TYPE_LSM) {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11291 verbose(env, "Only fentry/fexit/fmod_ret and lsm programs can be sleepable\n");
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11292 return -EINVAL;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11293 }
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11294
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11295 if (prog->type == BPF_PROG_TYPE_STRUCT_OPS)
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11296 return check_struct_ops_btf_id(env);
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11297
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11298 if (prog->type != BPF_PROG_TYPE_TRACING &&
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11299 prog->type != BPF_PROG_TYPE_LSM &&
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11300 prog->type != BPF_PROG_TYPE_EXT)
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11301 return 0;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11302
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11303 ret = bpf_check_attach_target(&env->log, prog, tgt_prog, btf_id,
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11304 &fmodel, &addr, &tname, &t);
18644cec714aabb Alexei Starovoitov 2020-05-28 11305 if (ret)
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11306 return ret;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11307
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11308 if (tgt_prog) {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11309 if (prog->type == BPF_PROG_TYPE_EXT) {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11310 env->ops = bpf_verifier_ops[tgt_prog->type];
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11311 prog->expected_attach_type =
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11312 tgt_prog->expected_attach_type;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11313 }
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11314 key = ((u64)tgt_prog->aux->id) << 32 | btf_id;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11315 } else {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11316 key = btf_id;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11317 }
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11318
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11319 /* remember two read only pointers that are valid for
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11320 * the life time of the kernel
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11321 */
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11322 prog->aux->attach_func_proto = t;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11323 prog->aux->attach_func_name = tname;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11324
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11325 if (prog->expected_attach_type == BPF_TRACE_RAW_TP) {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11326 prog->aux->attach_btf_trace = true;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11327 return 0;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11328 } else if (prog->expected_attach_type == BPF_TRACE_ITER) {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11329 if (!bpf_iter_prog_supported(prog))
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11330 return -EINVAL;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11331 return 0;
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11332 }
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11333
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11334 if (prog->type == BPF_PROG_TYPE_LSM) {
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11335 ret = bpf_lsm_verify_prog(&env->log, prog);
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11336 if (ret < 0)
fec56f5890d93fc Alexei Starovoitov 2019-11-14 11337 return ret;
f1b9509c2fb0ef4 Alexei Starovoitov 2019-10-30 11338 }
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11339
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11340 tr = bpf_trampoline_get(key, (void *)addr, &fmodel);
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11341 if (IS_ERR(tr))
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11342 return PTR_ERR(tr);
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11343
b166eea4ca70570 Toke Høiland-Jørgensen 2020-09-01 @11344 prog->aux->tgt_link->trampoline = tr;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unchecked dereference.
90c87648e09050a Toke Høiland-Jørgensen 2020-07-13 11345 return 0;
382072916044015 Martin KaFai Lau 2019-10-24 11346 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
2 years
[linux-next:master 2762/7920] drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3355 amdgpu_device_init() warn: 'adev->rmmio' not released on lines: 3355.
by Dan Carpenter
[
This is a new check that I pushed yesterday. I've pushed some more
improvements to hopefully cut down on the false positives.
It finds a ton of bugs in ancient code. The bug here is really five
years old. I don't know why it's picking this particular
commit to blame.
The other noteworthy for zero-day bot commit that I pushed yesterday
is that I hopefully silenced the "double unlock" warnings. Those were
because CONFIG_SMP was disabled, so now the check is only enabled if
CONFIG_SMP is set.
- dan ]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6b02addb1d1748d21dd1261e46029b264be4e5a0
commit: 8aba21b75136c39c4bf63345d699d97dc477ce0e [2762/7920] drm/amdgpu: Embed drm_device into amdgpu_device (v3)
config: i386-randconfig-m021-20200916 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3355 amdgpu_device_init() warn: 'adev->rmmio' not released on lines: 3355.
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 8aba21b75136c39c4bf63345d699d97dc477ce0e
vim +3355 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
d38ceaf99ed015 Alex Deucher 2015-04-20 2988 int amdgpu_device_init(struct amdgpu_device *adev,
d38ceaf99ed015 Alex Deucher 2015-04-20 2989 uint32_t flags)
d38ceaf99ed015 Alex Deucher 2015-04-20 2990 {
8aba21b75136c3 Luben Tuikov 2020-08-14 2991 struct drm_device *ddev = adev_to_drm(adev);
8aba21b75136c3 Luben Tuikov 2020-08-14 2992 struct pci_dev *pdev = adev->pdev;
d38ceaf99ed015 Alex Deucher 2015-04-20 2993 int r, i;
3840c5bcc24563 Alex Deucher 2019-10-04 2994 bool boco = false;
95844d20ae024b Marek Olšák 2016-08-17 2995 u32 max_MBps;
d38ceaf99ed015 Alex Deucher 2015-04-20 2996
d38ceaf99ed015 Alex Deucher 2015-04-20 2997 adev->shutdown = false;
d38ceaf99ed015 Alex Deucher 2015-04-20 2998 adev->flags = flags;
4e66d7d2156243 Yong Zhao 2019-08-30 2999
4e66d7d2156243 Yong Zhao 2019-08-30 3000 if (amdgpu_force_asic_type >= 0 && amdgpu_force_asic_type < CHIP_LAST)
4e66d7d2156243 Yong Zhao 2019-08-30 3001 adev->asic_type = amdgpu_force_asic_type;
4e66d7d2156243 Yong Zhao 2019-08-30 3002 else
2f7d10b393c83a Jammy Zhou 2015-07-22 3003 adev->asic_type = flags & AMD_ASIC_MASK;
4e66d7d2156243 Yong Zhao 2019-08-30 3004
d38ceaf99ed015 Alex Deucher 2015-04-20 3005 adev->usec_timeout = AMDGPU_MAX_USEC_TIMEOUT;
593aa2d282259e Shaoyun Liu 2018-02-07 3006 if (amdgpu_emu_mode == 1)
8bdab6bb1cf120 Yong Zhao 2020-02-25 3007 adev->usec_timeout *= 10;
770d13b19fdf36 Christian König 2018-01-12 3008 adev->gmc.gart_size = 512 * 1024 * 1024;
d38ceaf99ed015 Alex Deucher 2015-04-20 3009 adev->accel_working = false;
d38ceaf99ed015 Alex Deucher 2015-04-20 3010 adev->num_rings = 0;
d38ceaf99ed015 Alex Deucher 2015-04-20 3011 adev->mman.buffer_funcs = NULL;
d38ceaf99ed015 Alex Deucher 2015-04-20 3012 adev->mman.buffer_funcs_ring = NULL;
d38ceaf99ed015 Alex Deucher 2015-04-20 3013 adev->vm_manager.vm_pte_funcs = NULL;
0c88b43032131f Nirmoy Das 2019-12-06 3014 adev->vm_manager.vm_pte_num_scheds = 0;
132f34e4b55848 Christian König 2018-01-12 3015 adev->gmc.gmc_funcs = NULL;
f54d1867005c33 Chris Wilson 2016-10-25 3016 adev->fence_context = dma_fence_context_alloc(AMDGPU_MAX_RINGS);
b8866c26ec072f Andres Rodriguez 2017-04-28 3017 bitmap_zero(adev->gfx.pipe_reserve_bitmap, AMDGPU_MAX_COMPUTE_QUEUES);
d38ceaf99ed015 Alex Deucher 2015-04-20 3018
d38ceaf99ed015 Alex Deucher 2015-04-20 3019 adev->smc_rreg = &amdgpu_invalid_rreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3020 adev->smc_wreg = &amdgpu_invalid_wreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3021 adev->pcie_rreg = &amdgpu_invalid_rreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3022 adev->pcie_wreg = &amdgpu_invalid_wreg;
36b9a952bbf688 Huang Rui 2016-08-31 3023 adev->pciep_rreg = &amdgpu_invalid_rreg;
36b9a952bbf688 Huang Rui 2016-08-31 3024 adev->pciep_wreg = &amdgpu_invalid_wreg;
4fa1c6a679bb0d Tao Zhou 2019-07-24 3025 adev->pcie_rreg64 = &amdgpu_invalid_rreg64;
4fa1c6a679bb0d Tao Zhou 2019-07-24 3026 adev->pcie_wreg64 = &amdgpu_invalid_wreg64;
d38ceaf99ed015 Alex Deucher 2015-04-20 3027 adev->uvd_ctx_rreg = &amdgpu_invalid_rreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3028 adev->uvd_ctx_wreg = &amdgpu_invalid_wreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3029 adev->didt_rreg = &amdgpu_invalid_rreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3030 adev->didt_wreg = &amdgpu_invalid_wreg;
ccdbb20a75e3e3 Rex Zhu 2016-06-08 3031 adev->gc_cac_rreg = &amdgpu_invalid_rreg;
ccdbb20a75e3e3 Rex Zhu 2016-06-08 3032 adev->gc_cac_wreg = &amdgpu_invalid_wreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3033 adev->audio_endpt_rreg = &amdgpu_block_invalid_rreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3034 adev->audio_endpt_wreg = &amdgpu_block_invalid_wreg;
d38ceaf99ed015 Alex Deucher 2015-04-20 3035
3e39ab90833b20 Alex Deucher 2015-06-05 3036 DRM_INFO("initializing kernel modesetting (%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X).\n",
d38ceaf99ed015 Alex Deucher 2015-04-20 3037 amdgpu_asic_name[adev->asic_type], pdev->vendor, pdev->device,
3e39ab90833b20 Alex Deucher 2015-06-05 3038 pdev->subsystem_vendor, pdev->subsystem_device, pdev->revision);
d38ceaf99ed015 Alex Deucher 2015-04-20 3039
d38ceaf99ed015 Alex Deucher 2015-04-20 3040 /* mutex initialization are all done here so we
d38ceaf99ed015 Alex Deucher 2015-04-20 3041 * can recall function without having locking issues */
d38ceaf99ed015 Alex Deucher 2015-04-20 3042 atomic_set(&adev->irq.ih.lock, 0);
0e5ca0d1ac07ef Huang Rui 2017-03-03 3043 mutex_init(&adev->firmware.mutex);
d38ceaf99ed015 Alex Deucher 2015-04-20 3044 mutex_init(&adev->pm.mutex);
d38ceaf99ed015 Alex Deucher 2015-04-20 3045 mutex_init(&adev->gfx.gpu_clock_mutex);
d38ceaf99ed015 Alex Deucher 2015-04-20 3046 mutex_init(&adev->srbm_mutex);
b8866c26ec072f Andres Rodriguez 2017-04-28 3047 mutex_init(&adev->gfx.pipe_reserve_mutex);
d23ee13fba23a3 Rex Zhu 2018-07-30 3048 mutex_init(&adev->gfx.gfx_off_mutex);
d38ceaf99ed015 Alex Deucher 2015-04-20 3049 mutex_init(&adev->grbm_idx_mutex);
d38ceaf99ed015 Alex Deucher 2015-04-20 3050 mutex_init(&adev->mn_lock);
e23b74aab5dc48 Alex Deucher 2017-09-28 3051 mutex_init(&adev->virt.vf_errors.lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3052 hash_init(adev->mn_hash);
53b3f8f40e6cff Dennis Li 2020-08-19 3053 atomic_set(&adev->in_gpu_reset, 0);
6049db43d6dd9c Dennis Li 2020-08-20 3054 init_rwsem(&adev->reset_sem);
32eaeae0ef193b Alex Deucher 2019-07-08 3055 mutex_init(&adev->psp.mutex);
bd052211233266 Pan, Xinhui 2020-01-16 3056 mutex_init(&adev->notifier_lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3057
912dfc846aad77 Evan Quan 2019-04-29 3058 r = amdgpu_device_check_arguments(adev);
912dfc846aad77 Evan Quan 2019-04-29 3059 if (r)
912dfc846aad77 Evan Quan 2019-04-29 3060 return r;
d38ceaf99ed015 Alex Deucher 2015-04-20 3061
d38ceaf99ed015 Alex Deucher 2015-04-20 3062 spin_lock_init(&adev->mmio_idx_lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3063 spin_lock_init(&adev->smc_idx_lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3064 spin_lock_init(&adev->pcie_idx_lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3065 spin_lock_init(&adev->uvd_ctx_idx_lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3066 spin_lock_init(&adev->didt_idx_lock);
ccdbb20a75e3e3 Rex Zhu 2016-06-08 3067 spin_lock_init(&adev->gc_cac_idx_lock);
16abb5d206499d Evan Quan 2017-07-04 3068 spin_lock_init(&adev->se_cac_idx_lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3069 spin_lock_init(&adev->audio_endpt_idx_lock);
95844d20ae024b Marek Olšák 2016-08-17 3070 spin_lock_init(&adev->mm_stats.lock);
d38ceaf99ed015 Alex Deucher 2015-04-20 3071
0c4e7fa56112b0 Chunming Zhou 2016-08-17 3072 INIT_LIST_HEAD(&adev->shadow_list);
0c4e7fa56112b0 Chunming Zhou 2016-08-17 3073 mutex_init(&adev->shadow_list_lock);
0c4e7fa56112b0 Chunming Zhou 2016-08-17 3074
beff74bc6e0fa9 Alex Deucher 2019-05-28 3075 INIT_DELAYED_WORK(&adev->delayed_init_work,
beff74bc6e0fa9 Alex Deucher 2019-05-28 3076 amdgpu_device_delayed_init_work_handler);
1e317b99f0c244 Rex Zhu 2018-07-27 3077 INIT_DELAYED_WORK(&adev->gfx.gfx_off_delay_work,
1e317b99f0c244 Rex Zhu 2018-07-27 3078 amdgpu_device_delay_enable_gfx_off);
2dc80b00652f2a Shirish S 2017-05-25 3079
d4535e2c018bba Andrey Grodzovsky 2018-11-29 3080 INIT_WORK(&adev->xgmi_reset_work, amdgpu_device_xgmi_reset_func);
d4535e2c018bba Andrey Grodzovsky 2018-11-29 3081
d23ee13fba23a3 Rex Zhu 2018-07-30 3082 adev->gfx.gfx_off_req_count = 1;
b6e79d9a314ebe Jason Yan 2020-04-27 3083 adev->pm.ac_power = power_supply_is_system_supplied() > 0;
b1ddf548472729 Rex Zhu 2018-06-04 3084
b265bdbd9f2811 Evan Quan 2020-05-22 3085 atomic_set(&adev->throttling_logging_enabled, 1);
b265bdbd9f2811 Evan Quan 2020-05-22 3086 /*
b265bdbd9f2811 Evan Quan 2020-05-22 3087 * If throttling continues, logging will be performed every minute
b265bdbd9f2811 Evan Quan 2020-05-22 3088 * to avoid log flooding. "-1" is subtracted since the thermal
b265bdbd9f2811 Evan Quan 2020-05-22 3089 * throttling interrupt comes every second. Thus, the total logging
b265bdbd9f2811 Evan Quan 2020-05-22 3090 * interval is 59 seconds(retelimited printk interval) + 1(waiting
b265bdbd9f2811 Evan Quan 2020-05-22 3091 * for throttling interrupt) = 60 seconds.
b265bdbd9f2811 Evan Quan 2020-05-22 3092 */
b265bdbd9f2811 Evan Quan 2020-05-22 3093 ratelimit_state_init(&adev->throttling_logging_rs, (60 - 1) * HZ, 1);
b265bdbd9f2811 Evan Quan 2020-05-22 3094 ratelimit_set_flags(&adev->throttling_logging_rs, RATELIMIT_MSG_ON_RELEASE);
b265bdbd9f2811 Evan Quan 2020-05-22 3095
0fa4955838ea1e Alex Xie 2017-06-08 3096 /* Registers mapping */
0fa4955838ea1e Alex Xie 2017-06-08 3097 /* TODO: block userspace mapping of io register */
da69c161448d6a Ken Wang 2016-01-21 3098 if (adev->asic_type >= CHIP_BONAIRE) {
d38ceaf99ed015 Alex Deucher 2015-04-20 3099 adev->rmmio_base = pci_resource_start(adev->pdev, 5);
d38ceaf99ed015 Alex Deucher 2015-04-20 3100 adev->rmmio_size = pci_resource_len(adev->pdev, 5);
da69c161448d6a Ken Wang 2016-01-21 3101 } else {
da69c161448d6a Ken Wang 2016-01-21 3102 adev->rmmio_base = pci_resource_start(adev->pdev, 2);
da69c161448d6a Ken Wang 2016-01-21 3103 adev->rmmio_size = pci_resource_len(adev->pdev, 2);
da69c161448d6a Ken Wang 2016-01-21 3104 }
5c1354bd30c118 Chunming Zhou 2016-08-30 3105
d38ceaf99ed015 Alex Deucher 2015-04-20 3106 adev->rmmio = ioremap(adev->rmmio_base, adev->rmmio_size);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This isn't released on error.
d38ceaf99ed015 Alex Deucher 2015-04-20 3107 if (adev->rmmio == NULL) {
d38ceaf99ed015 Alex Deucher 2015-04-20 3108 return -ENOMEM;
d38ceaf99ed015 Alex Deucher 2015-04-20 3109 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3110 DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base);
d38ceaf99ed015 Alex Deucher 2015-04-20 3111 DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size);
d38ceaf99ed015 Alex Deucher 2015-04-20 3112
d38ceaf99ed015 Alex Deucher 2015-04-20 3113 /* io port mapping */
d38ceaf99ed015 Alex Deucher 2015-04-20 3114 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
d38ceaf99ed015 Alex Deucher 2015-04-20 3115 if (pci_resource_flags(adev->pdev, i) & IORESOURCE_IO) {
d38ceaf99ed015 Alex Deucher 2015-04-20 3116 adev->rio_mem_size = pci_resource_len(adev->pdev, i);
d38ceaf99ed015 Alex Deucher 2015-04-20 3117 adev->rio_mem = pci_iomap(adev->pdev, i, adev->rio_mem_size);
d38ceaf99ed015 Alex Deucher 2015-04-20 3118 break;
d38ceaf99ed015 Alex Deucher 2015-04-20 3119 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3120 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3121 if (adev->rio_mem == NULL)
b64a18c502feda Amber Lin 2017-01-04 3122 DRM_INFO("PCI I/O BAR is not found.\n");
d38ceaf99ed015 Alex Deucher 2015-04-20 3123
b2109d8ed69765 Jack Xiao 2019-05-24 3124 /* enable PCIE atomic ops */
b2109d8ed69765 Jack Xiao 2019-05-24 3125 r = pci_enable_atomic_ops_to_root(adev->pdev,
b2109d8ed69765 Jack Xiao 2019-05-24 3126 PCI_EXP_DEVCAP2_ATOMIC_COMP32 |
b2109d8ed69765 Jack Xiao 2019-05-24 3127 PCI_EXP_DEVCAP2_ATOMIC_COMP64);
b2109d8ed69765 Jack Xiao 2019-05-24 3128 if (r) {
b2109d8ed69765 Jack Xiao 2019-05-24 3129 adev->have_atomics_support = false;
b2109d8ed69765 Jack Xiao 2019-05-24 3130 DRM_INFO("PCIE atomic ops is not supported\n");
b2109d8ed69765 Jack Xiao 2019-05-24 3131 } else {
b2109d8ed69765 Jack Xiao 2019-05-24 3132 adev->have_atomics_support = true;
b2109d8ed69765 Jack Xiao 2019-05-24 3133 }
b2109d8ed69765 Jack Xiao 2019-05-24 3134
5494d8640ffc1d Alex Deucher 2018-03-09 3135 amdgpu_device_get_pcie_info(adev);
5494d8640ffc1d Alex Deucher 2018-03-09 3136
b239c01727459b Jack Xiao 2019-01-10 3137 if (amdgpu_mcbp)
b239c01727459b Jack Xiao 2019-01-10 3138 DRM_INFO("MCBP is enabled\n");
b239c01727459b Jack Xiao 2019-01-10 3139
5f84cc635bce58 Jack Xiao 2019-01-25 3140 if (amdgpu_mes && adev->asic_type >= CHIP_NAVI10)
5f84cc635bce58 Jack Xiao 2019-01-25 3141 adev->enable_mes = true;
5f84cc635bce58 Jack Xiao 2019-01-25 3142
3aa0115d238c71 Monk Liu 2020-03-04 3143 /* detect hw virtualization here */
3aa0115d238c71 Monk Liu 2020-03-04 3144 amdgpu_detect_virtualization(adev);
3aa0115d238c71 Monk Liu 2020-03-04 3145
dffa11b4f74b15 Monk Liu 2020-03-04 3146 r = amdgpu_device_get_job_timeout_settings(adev);
a190d1c75c73ce Xiaojie Yuan 2019-03-27 3147 if (r) {
dffa11b4f74b15 Monk Liu 2020-03-04 3148 dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
a190d1c75c73ce Xiaojie Yuan 2019-03-27 3149 return r;
a190d1c75c73ce Xiaojie Yuan 2019-03-27 3150 }
a190d1c75c73ce Xiaojie Yuan 2019-03-27 3151
d38ceaf99ed015 Alex Deucher 2015-04-20 3152 /* early init functions */
06ec907054c5a4 Alex Deucher 2017-12-14 3153 r = amdgpu_device_ip_early_init(adev);
d38ceaf99ed015 Alex Deucher 2015-04-20 3154 if (r)
d38ceaf99ed015 Alex Deucher 2015-04-20 3155 return r;
d38ceaf99ed015 Alex Deucher 2015-04-20 3156
6585661ddd6a0a Oak Zeng 2018-11-19 3157 /* doorbell bar mapping and doorbell index init*/
6585661ddd6a0a Oak Zeng 2018-11-19 3158 amdgpu_device_doorbell_init(adev);
6585661ddd6a0a Oak Zeng 2018-11-19 3159
d38ceaf99ed015 Alex Deucher 2015-04-20 3160 /* if we have > 1 VGA cards, then disable the amdgpu VGA resources */
d38ceaf99ed015 Alex Deucher 2015-04-20 3161 /* this will fail for cards that aren't VGA class devices, just
d38ceaf99ed015 Alex Deucher 2015-04-20 3162 * ignore it */
06ec907054c5a4 Alex Deucher 2017-12-14 3163 vga_client_register(adev->pdev, adev, NULL, amdgpu_device_vga_set_decode);
d38ceaf99ed015 Alex Deucher 2015-04-20 3164
31af062acfbd5d Alex Deucher 2019-10-04 3165 if (amdgpu_device_supports_boco(ddev))
3840c5bcc24563 Alex Deucher 2019-10-04 3166 boco = true;
3840c5bcc24563 Alex Deucher 2019-10-04 3167 if (amdgpu_has_atpx() &&
3840c5bcc24563 Alex Deucher 2019-10-04 3168 (amdgpu_is_atpx_hybrid() ||
3840c5bcc24563 Alex Deucher 2019-10-04 3169 amdgpu_has_atpx_dgpu_power_cntl()) &&
3840c5bcc24563 Alex Deucher 2019-10-04 3170 !pci_is_thunderbolt_attached(adev->pdev))
84c8b22e9fe8d9 Lukas Wunner 2017-03-10 3171 vga_switcheroo_register_client(adev->pdev,
3840c5bcc24563 Alex Deucher 2019-10-04 3172 &amdgpu_switcheroo_ops, boco);
3840c5bcc24563 Alex Deucher 2019-10-04 3173 if (boco)
d38ceaf99ed015 Alex Deucher 2015-04-20 3174 vga_switcheroo_init_domain_pm_ops(adev->dev, &adev->vga_pm_domain);
d38ceaf99ed015 Alex Deucher 2015-04-20 3175
9475a9434f594f Shaoyun Liu 2018-02-01 3176 if (amdgpu_emu_mode == 1) {
9475a9434f594f Shaoyun Liu 2018-02-01 3177 /* post the asic on emulation mode */
9475a9434f594f Shaoyun Liu 2018-02-01 3178 emu_soc_asic_init(adev);
bfca02892773d2 Shaoyun Liu 2018-02-01 3179 goto fence_driver_init;
9475a9434f594f Shaoyun Liu 2018-02-01 3180 }
bfca02892773d2 Shaoyun Liu 2018-02-01 3181
4e99a44e37bfed Monk Liu 2016-03-31 3182 /* detect if we are with an SRIOV vbios */
4e99a44e37bfed Monk Liu 2016-03-31 3183 amdgpu_device_detect_sriov_bios(adev);
048765ad5af7c8 Andres Rodriguez 2016-06-11 3184
95e8e59ec49f7c Alex Deucher 2018-11-01 3185 /* check if we need to reset the asic
95e8e59ec49f7c Alex Deucher 2018-11-01 3186 * E.g., driver was not cleanly unloaded previously, etc.
95e8e59ec49f7c Alex Deucher 2018-11-01 3187 */
f14899fd2a5607 wentalou 2019-01-17 3188 if (!amdgpu_sriov_vf(adev) && amdgpu_asic_need_reset_on_init(adev)) {
95e8e59ec49f7c Alex Deucher 2018-11-01 3189 r = amdgpu_asic_reset(adev);
95e8e59ec49f7c Alex Deucher 2018-11-01 3190 if (r) {
95e8e59ec49f7c Alex Deucher 2018-11-01 3191 dev_err(adev->dev, "asic reset on init failed\n");
95e8e59ec49f7c Alex Deucher 2018-11-01 3192 goto failed;
95e8e59ec49f7c Alex Deucher 2018-11-01 3193 }
95e8e59ec49f7c Alex Deucher 2018-11-01 3194 }
95e8e59ec49f7c Alex Deucher 2018-11-01 3195
d38ceaf99ed015 Alex Deucher 2015-04-20 3196 /* Post card if necessary */
39c640c086ad12 Alex Deucher 2017-12-15 3197 if (amdgpu_device_need_post(adev)) {
d38ceaf99ed015 Alex Deucher 2015-04-20 3198 if (!adev->bios) {
bec86378befae4 Monk Liu 2016-09-14 3199 dev_err(adev->dev, "no vBIOS found\n");
83ba126a9be318 Alex Deucher 2016-06-03 3200 r = -EINVAL;
83ba126a9be318 Alex Deucher 2016-06-03 3201 goto failed;
d38ceaf99ed015 Alex Deucher 2015-04-20 3202 }
bec86378befae4 Monk Liu 2016-09-14 3203 DRM_INFO("GPU posting now...\n");
4e99a44e37bfed Monk Liu 2016-03-31 3204 r = amdgpu_atom_asic_init(adev->mode_info.atom_context);
4e99a44e37bfed Monk Liu 2016-03-31 3205 if (r) {
4e99a44e37bfed Monk Liu 2016-03-31 3206 dev_err(adev->dev, "gpu post error!\n");
4e99a44e37bfed Monk Liu 2016-03-31 3207 goto failed;
4e99a44e37bfed Monk Liu 2016-03-31 3208 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3209 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3210
88b64e9536746e Alex Deucher 2017-07-10 3211 if (adev->is_atom_fw) {
88b64e9536746e Alex Deucher 2017-07-10 3212 /* Initialize clocks */
88b64e9536746e Alex Deucher 2017-07-10 3213 r = amdgpu_atomfirmware_get_clock_info(adev);
88b64e9536746e Alex Deucher 2017-07-10 3214 if (r) {
88b64e9536746e Alex Deucher 2017-07-10 3215 dev_err(adev->dev, "amdgpu_atomfirmware_get_clock_info failed\n");
e23b74aab5dc48 Alex Deucher 2017-09-28 3216 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_ATOMBIOS_GET_CLOCK_FAIL, 0, 0);
88b64e9536746e Alex Deucher 2017-07-10 3217 goto failed;
88b64e9536746e Alex Deucher 2017-07-10 3218 }
88b64e9536746e Alex Deucher 2017-07-10 3219 } else {
d38ceaf99ed015 Alex Deucher 2015-04-20 3220 /* Initialize clocks */
d38ceaf99ed015 Alex Deucher 2015-04-20 3221 r = amdgpu_atombios_get_clock_info(adev);
2c1a2784039442 Alex Deucher 2015-12-07 3222 if (r) {
2c1a2784039442 Alex Deucher 2015-12-07 3223 dev_err(adev->dev, "amdgpu_atombios_get_clock_info failed\n");
e23b74aab5dc48 Alex Deucher 2017-09-28 3224 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_ATOMBIOS_GET_CLOCK_FAIL, 0, 0);
890419409a3aba Gavin Wan 2017-06-23 3225 goto failed;
2c1a2784039442 Alex Deucher 2015-12-07 3226 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3227 /* init i2c buses */
4562236b3bc0a2 Harry Wentland 2017-09-12 3228 if (!amdgpu_device_has_dc_support(adev))
d38ceaf99ed015 Alex Deucher 2015-04-20 3229 amdgpu_atombios_i2c_init(adev);
a5bde2f964fa06 Alex Deucher 2016-09-23 3230 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3231
bfca02892773d2 Shaoyun Liu 2018-02-01 3232 fence_driver_init:
d38ceaf99ed015 Alex Deucher 2015-04-20 3233 /* Fence driver */
d38ceaf99ed015 Alex Deucher 2015-04-20 3234 r = amdgpu_fence_driver_init(adev);
2c1a2784039442 Alex Deucher 2015-12-07 3235 if (r) {
2c1a2784039442 Alex Deucher 2015-12-07 3236 dev_err(adev->dev, "amdgpu_fence_driver_init failed\n");
e23b74aab5dc48 Alex Deucher 2017-09-28 3237 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_FENCE_INIT_FAIL, 0, 0);
83ba126a9be318 Alex Deucher 2016-06-03 3238 goto failed;
2c1a2784039442 Alex Deucher 2015-12-07 3239 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3240
d38ceaf99ed015 Alex Deucher 2015-04-20 3241 /* init the mode config */
4a580877bdcb83 Luben Tuikov 2020-08-24 3242 drm_mode_config_init(adev_to_drm(adev));
d38ceaf99ed015 Alex Deucher 2015-04-20 3243
06ec907054c5a4 Alex Deucher 2017-12-14 3244 r = amdgpu_device_ip_init(adev);
d38ceaf99ed015 Alex Deucher 2015-04-20 3245 if (r) {
8840a3878d40c9 pding 2017-10-23 3246 /* failed in exclusive mode due to timeout */
8840a3878d40c9 pding 2017-10-23 3247 if (amdgpu_sriov_vf(adev) &&
8840a3878d40c9 pding 2017-10-23 3248 !amdgpu_sriov_runtime(adev) &&
8840a3878d40c9 pding 2017-10-23 3249 amdgpu_virt_mmio_blocked(adev) &&
8840a3878d40c9 pding 2017-10-23 3250 !amdgpu_virt_wait_reset(adev)) {
8840a3878d40c9 pding 2017-10-23 3251 dev_err(adev->dev, "VF exclusive mode timeout\n");
1daee8b472e896 Pixel Ding 2017-11-08 3252 /* Don't send request since VF is inactive. */
1daee8b472e896 Pixel Ding 2017-11-08 3253 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
1daee8b472e896 Pixel Ding 2017-11-08 3254 adev->virt.ops = NULL;
8840a3878d40c9 pding 2017-10-23 3255 r = -EAGAIN;
8840a3878d40c9 pding 2017-10-23 3256 goto failed;
8840a3878d40c9 pding 2017-10-23 3257 }
06ec907054c5a4 Alex Deucher 2017-12-14 3258 dev_err(adev->dev, "amdgpu_device_ip_init failed\n");
e23b74aab5dc48 Alex Deucher 2017-09-28 3259 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_AMDGPU_INIT_FAIL, 0, 0);
83ba126a9be318 Alex Deucher 2016-06-03 3260 goto failed;
d38ceaf99ed015 Alex Deucher 2015-04-20 3261 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3262
d69b8971e540ae Yong Zhao 2020-04-17 3263 dev_info(adev->dev,
d69b8971e540ae Yong Zhao 2020-04-17 3264 "SE %d, SH per SE %d, CU per SH %d, active_cu_number %d\n",
d7f72fe482bfb7 Yong Zhao 2019-12-11 3265 adev->gfx.config.max_shader_engines,
d7f72fe482bfb7 Yong Zhao 2019-12-11 3266 adev->gfx.config.max_sh_per_se,
d7f72fe482bfb7 Yong Zhao 2019-12-11 3267 adev->gfx.config.max_cu_per_sh,
d7f72fe482bfb7 Yong Zhao 2019-12-11 3268 adev->gfx.cu_info.number);
d7f72fe482bfb7 Yong Zhao 2019-12-11 3269
d38ceaf99ed015 Alex Deucher 2015-04-20 3270 adev->accel_working = true;
d38ceaf99ed015 Alex Deucher 2015-04-20 3271
e59c020598666f Alex Xie 2017-06-01 3272 amdgpu_vm_check_compute_bug(adev);
e59c020598666f Alex Xie 2017-06-01 3273
95844d20ae024b Marek Olšák 2016-08-17 3274 /* Initialize the buffer migration limit. */
95844d20ae024b Marek Olšák 2016-08-17 3275 if (amdgpu_moverate >= 0)
95844d20ae024b Marek Olšák 2016-08-17 3276 max_MBps = amdgpu_moverate;
95844d20ae024b Marek Olšák 2016-08-17 3277 else
95844d20ae024b Marek Olšák 2016-08-17 3278 max_MBps = 8; /* Allow 8 MB/s. */
95844d20ae024b Marek Olšák 2016-08-17 3279 /* Get a log2 for easy divisions. */
95844d20ae024b Marek Olšák 2016-08-17 3280 adev->mm_stats.log2_max_MBps = ilog2(max(1u, max_MBps));
95844d20ae024b Marek Olšák 2016-08-17 3281
9bc92b9c8d0919 Monk Liu 2017-02-08 3282 amdgpu_fbdev_init(adev);
9bc92b9c8d0919 Monk Liu 2017-02-08 3283
d2f52ac800fec2 Rex Zhu 2017-09-22 3284 r = amdgpu_pm_sysfs_init(adev);
7c868b592d5c2c Yintian Tao 2019-11-29 3285 if (r) {
7c868b592d5c2c Yintian Tao 2019-11-29 3286 adev->pm_sysfs_en = false;
d2f52ac800fec2 Rex Zhu 2017-09-22 3287 DRM_ERROR("registering pm debugfs failed (%d).\n", r);
7c868b592d5c2c Yintian Tao 2019-11-29 3288 } else
7c868b592d5c2c Yintian Tao 2019-11-29 3289 adev->pm_sysfs_en = true;
d2f52ac800fec2 Rex Zhu 2017-09-22 3290
5bb23532732384 Ori Messinger 2019-04-22 3291 r = amdgpu_ucode_sysfs_init(adev);
7c868b592d5c2c Yintian Tao 2019-11-29 3292 if (r) {
7c868b592d5c2c Yintian Tao 2019-11-29 3293 adev->ucode_sysfs_en = false;
5bb23532732384 Ori Messinger 2019-04-22 3294 DRM_ERROR("Creating firmware sysfs failed (%d).\n", r);
7c868b592d5c2c Yintian Tao 2019-11-29 3295 } else
7c868b592d5c2c Yintian Tao 2019-11-29 3296 adev->ucode_sysfs_en = true;
5bb23532732384 Ori Messinger 2019-04-22 3297
d38ceaf99ed015 Alex Deucher 2015-04-20 3298 if ((amdgpu_testing & 1)) {
d38ceaf99ed015 Alex Deucher 2015-04-20 3299 if (adev->accel_working)
d38ceaf99ed015 Alex Deucher 2015-04-20 3300 amdgpu_test_moves(adev);
d38ceaf99ed015 Alex Deucher 2015-04-20 3301 else
d38ceaf99ed015 Alex Deucher 2015-04-20 3302 DRM_INFO("amdgpu: acceleration disabled, skipping move tests\n");
d38ceaf99ed015 Alex Deucher 2015-04-20 3303 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3304 if (amdgpu_benchmarking) {
d38ceaf99ed015 Alex Deucher 2015-04-20 3305 if (adev->accel_working)
d38ceaf99ed015 Alex Deucher 2015-04-20 3306 amdgpu_benchmark(adev, amdgpu_benchmarking);
d38ceaf99ed015 Alex Deucher 2015-04-20 3307 else
d38ceaf99ed015 Alex Deucher 2015-04-20 3308 DRM_INFO("amdgpu: acceleration disabled, skipping benchmarks\n");
d38ceaf99ed015 Alex Deucher 2015-04-20 3309 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3310
b0adca4d50169d Evan Quan 2019-11-05 3311 /*
b0adca4d50169d Evan Quan 2019-11-05 3312 * Register gpu instance before amdgpu_device_enable_mgpu_fan_boost.
b0adca4d50169d Evan Quan 2019-11-05 3313 * Otherwise the mgpu fan boost feature will be skipped due to the
b0adca4d50169d Evan Quan 2019-11-05 3314 * gpu instance is counted less.
b0adca4d50169d Evan Quan 2019-11-05 3315 */
b0adca4d50169d Evan Quan 2019-11-05 3316 amdgpu_register_gpu_instance(adev);
b0adca4d50169d Evan Quan 2019-11-05 3317
d38ceaf99ed015 Alex Deucher 2015-04-20 3318 /* enable clockgating, etc. after ib tests, etc. since some blocks require
d38ceaf99ed015 Alex Deucher 2015-04-20 3319 * explicit gating rather than handling it automatically.
d38ceaf99ed015 Alex Deucher 2015-04-20 3320 */
06ec907054c5a4 Alex Deucher 2017-12-14 3321 r = amdgpu_device_ip_late_init(adev);
2c1a2784039442 Alex Deucher 2015-12-07 3322 if (r) {
06ec907054c5a4 Alex Deucher 2017-12-14 3323 dev_err(adev->dev, "amdgpu_device_ip_late_init failed\n");
e23b74aab5dc48 Alex Deucher 2017-09-28 3324 amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_AMDGPU_LATE_INIT_FAIL, 0, r);
83ba126a9be318 Alex Deucher 2016-06-03 3325 goto failed;
2c1a2784039442 Alex Deucher 2015-12-07 3326 }
d38ceaf99ed015 Alex Deucher 2015-04-20 3327
108c6a6309c96a xinhui pan 2019-03-11 3328 /* must succeed. */
511fdbc33aaa47 xinhui pan 2019-05-09 3329 amdgpu_ras_resume(adev);
108c6a6309c96a xinhui pan 2019-03-11 3330
beff74bc6e0fa9 Alex Deucher 2019-05-28 3331 queue_delayed_work(system_wq, &adev->delayed_init_work,
beff74bc6e0fa9 Alex Deucher 2019-05-28 3332 msecs_to_jiffies(AMDGPU_RESUME_MS));
beff74bc6e0fa9 Alex Deucher 2019-05-28 3333
2c738637bac1aa Monk Liu 2020-06-29 3334 if (amdgpu_sriov_vf(adev))
2c738637bac1aa Monk Liu 2020-06-29 3335 flush_delayed_work(&adev->delayed_init_work);
2c738637bac1aa Monk Liu 2020-06-29 3336
77f3a5cd7023d9 Nirmoy Das 2020-05-07 3337 r = sysfs_create_files(&adev->dev->kobj, amdgpu_dev_attributes);
bd607166af7fe3 Kent Russell 2020-03-13 3338 if (r) {
77f3a5cd7023d9 Nirmoy Das 2020-05-07 3339 dev_err(adev->dev, "Could not create amdgpu device attr\n");
bd607166af7fe3 Kent Russell 2020-03-13 3340 return r;
^^^^^^^^
This should probably be "goto failed;"?
bd607166af7fe3 Kent Russell 2020-03-13 3341 }
bd607166af7fe3 Kent Russell 2020-03-13 3342
d155bef0636e01 Arnd Bergmann 2019-07-08 3343 if (IS_ENABLED(CONFIG_PERF_EVENTS))
9c7c85f7ea1fe5 Jonathan Kim 2019-06-19 3344 r = amdgpu_pmu_init(adev);
9c7c85f7ea1fe5 Jonathan Kim 2019-06-19 3345 if (r)
9c7c85f7ea1fe5 Jonathan Kim 2019-06-19 3346 dev_err(adev->dev, "amdgpu_pmu_init failed\n");
9c7c85f7ea1fe5 Jonathan Kim 2019-06-19 3347
d38ceaf99ed015 Alex Deucher 2015-04-20 3348 return 0;
83ba126a9be318 Alex Deucher 2016-06-03 3349
83ba126a9be318 Alex Deucher 2016-06-03 3350 failed:
890419409a3aba Gavin Wan 2017-06-23 3351 amdgpu_vf_error_trans_all(adev);
3840c5bcc24563 Alex Deucher 2019-10-04 3352 if (boco)
83ba126a9be318 Alex Deucher 2016-06-03 3353 vga_switcheroo_fini_domain_pm_ops(adev->dev);
8840a3878d40c9 pding 2017-10-23 3354
83ba126a9be318 Alex Deucher 2016-06-03 @3355 return r;
d38ceaf99ed015 Alex Deucher 2015-04-20 3356 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
Re: [PATCH 2/2] crypto: ccree - add custom cache params from DT file
by kernel test robot
Hi Gilad,
I love your patch! Perhaps something to improve:
[auto build test WARNING on cryptodev/master]
[also build test WARNING on crypto/master robh/for-next v5.9-rc5 next-20200916]
[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/Gilad-Ben-Yossef/add-optional-ca...
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: arm64-randconfig-r015-20200916 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 9e3842d60351f986d77dfe0a94f76e4fd895f188)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/crypto/ccree/cc_driver.c:120:18: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
cache_params |= FIELD_PREP(mask, val);
^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: expanded from macro 'FIELD_PREP'
__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:52:28: note: expanded from macro '__BF_FIELD_CHECK'
BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:319:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:307:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:299:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/crypto/ccree/cc_driver.c:125:18: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
cache_params |= FIELD_PREP(mask, val);
^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: expanded from macro 'FIELD_PREP'
__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:52:28: note: expanded from macro '__BF_FIELD_CHECK'
BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:319:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:307:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:299:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/crypto/ccree/cc_driver.c:133:18: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
cache_params |= FIELD_PREP(mask, val);
^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: expanded from macro 'FIELD_PREP'
__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:52:28: note: expanded from macro '__BF_FIELD_CHECK'
BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:319:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:307:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:299:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/crypto/ccree/cc_driver.c:153:15: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
ace_const |= FIELD_PREP(mask, val);
^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: expanded from macro 'FIELD_PREP'
__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:52:28: note: expanded from macro '__BF_FIELD_CHECK'
BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:319:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:307:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:299:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/crypto/ccree/cc_driver.c:161:15: warning: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
ace_const |= FIELD_PREP(mask, val);
^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: expanded from macro 'FIELD_PREP'
__BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:52:28: note: expanded from macro '__BF_FIELD_CHECK'
BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:319:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:307:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
# https://github.com/0day-ci/linux/commit/3c84102e6f9ba61d7efbadd1ed836eab9...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Gilad-Ben-Yossef/add-optional-cache-params-from-DT/20200916-152151
git checkout 3c84102e6f9ba61d7efbadd1ed836eab947106c1
vim +120 drivers/crypto/ccree/cc_driver.c
102
103 static void init_cc_dt_params(struct cc_drvdata *drvdata)
104 {
105 struct device *dev = drvdata_to_dev(drvdata);
106 struct device_node *np = dev->of_node;
107 u32 cache_params, ace_const, val, mask;
108 int rc;
109
110 /* register CC_AXIM_CACHE_PARAMS */
111 cache_params = cc_ioread(drvdata, CC_REG(AXIM_CACHE_PARAMS));
112 dev_dbg(dev, "Cache params previous: 0x%08X\n", cache_params);
113
114 rc = of_property_read_u32(np, "awcache", &val);
115 if (rc)
116 val = (drvdata->coherent ? 0xb : 0x2);
117
118 mask = CC_GENMASK(CC_AXIM_CACHE_PARAMS_AWCACHE);
119 cache_params &= ~mask;
> 120 cache_params |= FIELD_PREP(mask, val);
121
122 /* write AWCACHE also to AWCACHE_LAST */
123 mask = CC_GENMASK(CC_AXIM_CACHE_PARAMS_AWCACHE_LAST);
124 cache_params &= ~mask;
125 cache_params |= FIELD_PREP(mask, val);
126
127 rc = of_property_read_u32(np, "arcache", &val);
128 if (rc)
129 val = (drvdata->coherent ? 0xb : 0x2);
130
131 mask = CC_GENMASK(CC_AXIM_CACHE_PARAMS_ARCACHE);
132 cache_params &= ~mask;
133 cache_params |= FIELD_PREP(mask, val);
134
135 drvdata->cache_params = cache_params;
136
137 dev_dbg(dev, "Cache params current: 0x%08X\n", cache_params);
138
139 if (drvdata->hw_rev <= CC_HW_REV_710)
140 return;
141
142 /* register CC_AXIM_ACE_CONST */
143 ace_const = cc_ioread(drvdata, CC_REG(AXIM_ACE_CONST));
144 dev_dbg(dev, "ACE-const previous: 0x%08X\n", ace_const);
145
146 rc = of_property_read_u32(np, "ardomain", &val);
147 ace_const = cc_ioread(drvdata, CC_REG(AXIM_ACE_CONST));
148 if (rc)
149 val = (drvdata->coherent ? 0x2 : 0x3);
150
151 mask = CC_GENMASK(CC_AXIM_ACE_CONST_ARDOMAIN);
152 ace_const &= ~mask;
153 ace_const |= FIELD_PREP(mask, val);
154
155 rc = of_property_read_u32(np, "awdomain", &val);
156 if (rc)
157 val = (drvdata->coherent ? 0x2 : 0x3);
158
159 mask = CC_GENMASK(CC_AXIM_ACE_CONST_AWDOMAIN);
160 ace_const &= ~mask;
161 ace_const |= FIELD_PREP(mask, val);
162
163 dev_dbg(dev, "ACE-const current: 0x%08X\n", ace_const);
164
165 drvdata->ace_const = ace_const;
166 }
167
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years