[hch-block:blkdev.h-includes 13/17] drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3680:25: error: implicit declaration of function 'local_clock'; did you mean 'local_lock'?
by kernel test robot
tree: git://git.infradead.org/users/hch/block.git blkdev.h-includes
head: 0687088056048288700f442e86ea92af0fce9a12
commit: e8d9ef3cbe46f071717e3b78ccf33b6bdf6ade05 [13/17] block: drop unused includes in <linux/blkdev.h>
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.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 remote add hch-block git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block blkdev.h-includes
git checkout e8d9ef3cbe46f071717e3b78ccf33b6bdf6ade05
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 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 errors (new ones prefixed by >>):
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function 'debugfs_snapshot_regs_v3_hw':
>> drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3680:25: error: implicit declaration of function 'local_clock'; did you mean 'local_lock'? [-Werror=implicit-function-declaration]
3680 | u64 timestamp = local_clock();
| ^~~~~~~~~~~
| local_lock
cc1: some warnings being treated as errors
vim +3680 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3675
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3676 static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba)
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3677 {
2c74cb1f9222eb Jianqin Xie 2021-04-06 3678 int debugfs_dump_index = hisi_hba->debugfs_dump_index;
2c74cb1f9222eb Jianqin Xie 2021-04-06 3679 struct device *dev = hisi_hba->dev;
2c74cb1f9222eb Jianqin Xie 2021-04-06 @3680 u64 timestamp = local_clock();
2c74cb1f9222eb Jianqin Xie 2021-04-06 3681
2c74cb1f9222eb Jianqin Xie 2021-04-06 3682 if (debugfs_dump_index >= hisi_sas_debugfs_dump_count) {
2c74cb1f9222eb Jianqin Xie 2021-04-06 3683 dev_warn(dev, "dump count exceeded!\n");
2c74cb1f9222eb Jianqin Xie 2021-04-06 3684 return;
2c74cb1f9222eb Jianqin Xie 2021-04-06 3685 }
2c74cb1f9222eb Jianqin Xie 2021-04-06 3686
2c74cb1f9222eb Jianqin Xie 2021-04-06 3687 do_div(timestamp, NSEC_PER_MSEC);
2c74cb1f9222eb Jianqin Xie 2021-04-06 3688 hisi_hba->debugfs_timestamp[debugfs_dump_index] = timestamp;
2c74cb1f9222eb Jianqin Xie 2021-04-06 3689 hisi_hba->debugfs_dump_index++;
2c74cb1f9222eb Jianqin Xie 2021-04-06 3690
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3691 debugfs_snapshot_prepare_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3692
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3693 debugfs_snapshot_global_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3694 debugfs_snapshot_port_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3695 debugfs_snapshot_axi_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3696 debugfs_snapshot_ras_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3697 debugfs_snapshot_cq_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3698 debugfs_snapshot_dq_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3699 debugfs_snapshot_itct_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3700 debugfs_snapshot_iost_reg_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3701
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3702 debugfs_create_files_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3703
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3704 debugfs_snapshot_restore_v3_hw(hisi_hba);
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3705 }
623a4b6d5c2a75 Luo Jiaxing 2020-11-24 3706
:::::: The code at line 3680 was first introduced by commit
:::::: 2c74cb1f9222ebfcc204c02018275ad167d25212 scsi: hisi_sas: Directly snapshot registers when executing a reset
:::::: TO: Jianqin Xie <xiejianqin(a)hisilicon.com>
:::::: CC: Martin K. Petersen <martin.petersen(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[cifs:for-next 3/4] fs/smbfs_client/cifsroot.c:83:12: warning: no previous prototype for 'cifs_root_data'
by kernel test robot
tree: git://git.samba.org/sfrench/cifs-2.6.git for-next
head: c1abf13059571edd59d42d676ffe593fb987c019
commit: b4a8c8f8fa8b7b86bb62257fbb27e7bde58ac97e [3/4] cifs: rename fs/cifs directory to fs/smbfs_client
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add cifs git://git.samba.org/sfrench/cifs-2.6.git
git fetch --no-tags cifs for-next
git checkout b4a8c8f8fa8b7b86bb62257fbb27e7bde58ac97e
# save the attached .config to linux build tree
make W=1 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 >>):
>> fs/smbfs_client/cifsroot.c:83:12: warning: no previous prototype for 'cifs_root_data' [-Wmissing-prototypes]
83 | int __init cifs_root_data(char **dev, char **opts)
| ^~~~~~~~~~~~~~
vim +/cifs_root_data +83 fs/smbfs_client/cifsroot.c
8eecd1c2e5bc73 fs/cifs/cifsroot.c Paulo Alcantara (SUSE 2019-07-16 82)
8eecd1c2e5bc73 fs/cifs/cifsroot.c Paulo Alcantara (SUSE 2019-07-16 @83) int __init cifs_root_data(char **dev, char **opts)
:::::: The code at line 83 was first introduced by commit
:::::: 8eecd1c2e5bc73d33f3a544751305679dbf88eb4 cifs: Add support for root file systems
:::::: TO: Paulo Alcantara (SUSE) <paulo(a)paulo.ac>
:::::: CC: Steve French <stfrench(a)microsoft.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[jimc:dd-drm-next 3/16] lib/dynamic_debug.c:786:53: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long')
by kernel test robot
tree: https://github.com/jimc/linux.git dd-drm-next
head: bf8f0832d11f09c546179ca6a2c5432706ea3d32
commit: 221a341c10ebb8545beac6ee3937859d26ddcc60 [3/16] dyndbg: rationalize verbosity
config: riscv-buildonly-randconfig-r005-20210913 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 261cbe98c38f8c1ee1a482fe76511110e790f58a)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/jimc/linux/commit/221a341c10ebb8545beac6ee3937859d26dd...
git remote add jimc https://github.com/jimc/linux.git
git fetch --no-tags jimc dd-drm-next
git checkout 221a341c10ebb8545beac6ee3937859d26ddcc60
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
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 >>):
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from lib/dynamic_debug.c:35:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> lib/dynamic_debug.c:786:53: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
v2pr_info("read %u bytes from userspace <\n%s>\n", len, tmpbuf);
~~ ^~~
%lu
lib/dynamic_debug.c:120:49: note: expanded from macro 'v2pr_info'
#define v2pr_info(fmt, ...) vnpr_info(2, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
lib/dynamic_debug.c:116:18: note: expanded from macro 'vnpr_info'
pr_info(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/printk.h:420:34: note: expanded from macro 'pr_info'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
8 warnings generated.
vim +786 lib/dynamic_debug.c
765
766 /*
767 * File_ops->write method for <debugfs>/dynamic_debug/control. Gathers the
768 * command text from userspace, parses and executes it.
769 */
770 #define USER_BUF_PAGE 4096
771 static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf,
772 size_t len, loff_t *offp)
773 {
774 char *tmpbuf;
775 int ret;
776
777 if (len == 0)
778 return 0;
779 if (len > USER_BUF_PAGE - 1) {
780 pr_warn("expected <%d bytes into control\n", USER_BUF_PAGE);
781 return -E2BIG;
782 }
783 tmpbuf = memdup_user_nul(ubuf, len);
784 if (IS_ERR(tmpbuf))
785 return PTR_ERR(tmpbuf);
> 786 v2pr_info("read %u bytes from userspace <\n%s>\n", len, tmpbuf);
787
788 ret = ddebug_exec_queries(tmpbuf, NULL);
789 kfree(tmpbuf);
790 if (ret < 0)
791 return ret;
792
793 *offp += len;
794 return len;
795 }
796
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[zen-kernel-zen-kernel:5.14/cacule 1/2] kernel/sched/fair.c:11865:24: warning: variable 'cfs_rqb' set but not used
by kernel test robot
tree: https://github.com/zen-kernel/zen-kernel 5.14/cacule
head: 4430be30ae5bf7d608eb292aa8680a2dc82ca847
commit: 9e3f9e4d524cfe1d20d03a731930e4d6ebacbfd8 [1/2] CacULE 5.14
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/zen-kernel/zen-kernel/commit/9e3f9e4d524cfe1d20d03a731...
git remote add zen-kernel-zen-kernel https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen-kernel-zen-kernel 5.14/cacule
git checkout 9e3f9e4d524cfe1d20d03a731930e4d6ebacbfd8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64
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 >>):
kernel/sched/fair.c:11849:6: warning: no previous prototype for 'task_vruntime_update' [-Wmissing-prototypes]
11849 | void task_vruntime_update(struct rq *rq, struct task_struct *p, bool in_fi)
| ^~~~~~~~~~~~~~~~~~~~
kernel/sched/fair.c: In function 'cfs_prio_less':
>> kernel/sched/fair.c:11865:24: warning: variable 'cfs_rqb' set but not used [-Wunused-but-set-variable]
11865 | struct cfs_rq *cfs_rqb;
| ^~~~~~~
>> kernel/sched/fair.c:11864:24: warning: variable 'cfs_rqa' set but not used [-Wunused-but-set-variable]
11864 | struct cfs_rq *cfs_rqa;
| ^~~~~~~
vim +/cfs_rqb +11865 kernel/sched/fair.c
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11858)
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11859) bool cfs_prio_less(struct task_struct *a, struct task_struct *b, bool in_fi)
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11860) {
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11861) struct rq *rq = task_rq(a);
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11862) struct sched_entity *sea = &a->se;
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11863) struct sched_entity *seb = &b->se;
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 @11864) struct cfs_rq *cfs_rqa;
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 @11865) struct cfs_rq *cfs_rqb;
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11866) s64 delta;
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11867)
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11868) SCHED_WARN_ON(task_rq(b)->core != rq->core);
c6047c2e3af68d Joel Fernandes (Google 2020-11-17 11869)
:::::: The code at line 11865 was first introduced by commit
:::::: c6047c2e3af68dae23ad884249e0d42ff28d2d1b sched/fair: Snapshot the min_vruntime of CPUs on force idle
:::::: TO: Joel Fernandes (Google) <joel(a)joelfernandes.org>
:::::: CC: Peter Zijlstra <peterz(a)infradead.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[zen-kernel-zen-kernel:5.14/prjc 1/209] kernel/sched/alt_core.c:5653:23: warning: variable 'preempt_disable_ip' set but not used
by kernel test robot
tree: https://github.com/zen-kernel/zen-kernel 5.14/prjc
head: d549588e3d79002f0c4b567b49644318af78a3db
commit: f746b5817d3274fa4f458f87f6b452e7304b1d64 [1/209] Project C v5.7.5-r2
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/zen-kernel/zen-kernel/commit/f746b5817d3274fa4f458f87f...
git remote add zen-kernel-zen-kernel https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen-kernel-zen-kernel 5.14/prjc
git checkout f746b5817d3274fa4f458f87f6b452e7304b1d64
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nios2
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 >>):
| MAX_RT_PRIO
kernel/sched/alt_core.c:4031:46: note: each undeclared identifier is reported only once for each function it appears in
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:4749:13: error: redefinition of '_cond_resched'
4749 | int __sched _cond_resched(void)
| ^~~~~~~~~~~~~
In file included from kernel/sched/alt_sched.h:4,
from kernel/sched/sched.h:6,
from kernel/sched/alt_core.c:14:
include/linux/sched.h:1948:19: note: previous definition of '_cond_resched' with type 'int(void)'
1948 | static inline int _cond_resched(void)
| ^~~~~~~~~~~~~
kernel/sched/alt_core.c: In function '__do_sys_sched_get_priority_max':
kernel/sched/alt_core.c:4902:23: error: 'MAX_USER_RT_PRIO' undeclared (first use in this function); did you mean 'MAX_RT_PRIO'?
4902 | ret = MAX_USER_RT_PRIO-1;
| ^~~~~~~~~~~~~~~~
| MAX_RT_PRIO
kernel/sched/alt_core.c: In function 'sched_show_task':
kernel/sched/alt_core.c:5010:16: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5010 | if (p->state == TASK_RUNNING)
| ^~~~~
| __state
kernel/sched/alt_core.c:5025:9: error: too few arguments to function 'show_stack'
5025 | show_stack(p, NULL);
| ^~~~~~~~~~
In file included from kernel/sched/alt_sched.h:9,
from kernel/sched/sched.h:6,
from kernel/sched/alt_core.c:14:
include/linux/sched/debug.h:33:13: note: declared here
33 | extern void show_stack(struct task_struct *task, unsigned long *sp,
| ^~~~~~~~~~
kernel/sched/alt_core.c: In function 'state_filter_match':
kernel/sched/alt_core.c:5038:18: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5038 | if (!(p->state & state_filter))
| ^~~~~
| __state
kernel/sched/alt_core.c:5045:56: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5045 | if (state_filter == TASK_UNINTERRUPTIBLE && p->state == TASK_IDLE)
| ^~~~~
| __state
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:5052:6: error: conflicting types for 'show_state_filter'; have 'void(long unsigned int)'
5052 | void show_state_filter(unsigned long state_filter)
| ^~~~~~~~~~~~~~~~~
In file included from kernel/sched/alt_sched.h:9,
from kernel/sched/sched.h:6,
from kernel/sched/alt_core.c:14:
include/linux/sched/debug.h:17:13: note: previous declaration of 'show_state_filter' with type 'void(unsigned int)'
17 | extern void show_state_filter(unsigned int state_filter);
| ^~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c: In function 'init_idle':
kernel/sched/alt_core.c:5118:15: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5118 | idle->state = TASK_RUNNING;
| ^~~~~
| __state
In file included from include/asm-generic/bug.h:7,
from ./arch/nios2/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/asm-generic/current.h:5,
from ./arch/nios2/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
from kernel/sched/alt_sched.h:4,
from kernel/sched/sched.h:6,
from kernel/sched/alt_core.c:14:
kernel/sched/alt_core.c: In function '__might_sleep':
kernel/sched/alt_core.c:5637:28: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5637 | WARN_ONCE(current->state != TASK_RUNNING && current->task_state_change,
| ^~~~~
include/linux/once_lite.h:15:41: note: in definition of macro 'DO_ONCE_LITE_IF'
15 | bool __ret_do_once = !!(condition); \
| ^~~~~~~~~
kernel/sched/alt_core.c:5637:9: note: in expansion of macro 'WARN_ONCE'
5637 | WARN_ONCE(current->state != TASK_RUNNING && current->task_state_change,
| ^~~~~~~~~
In file included from ./arch/nios2/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/asm-generic/current.h:5,
from ./arch/nios2/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
from kernel/sched/alt_sched.h:4,
from kernel/sched/sched.h:6,
from kernel/sched/alt_core.c:14:
kernel/sched/alt_core.c:5640:34: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5640 | current->state,
| ^~~~~
include/asm-generic/bug.h:91:62: note: in definition of macro '__WARN_printf'
91 | warn_slowpath_fmt(__FILE__, __LINE__, taint, arg); \
| ^~~
include/linux/once_lite.h:19:25: note: in expansion of macro 'WARN'
19 | func(__VA_ARGS__); \
| ^~~~
include/asm-generic/bug.h:150:9: note: in expansion of macro 'DO_ONCE_LITE_IF'
150 | DO_ONCE_LITE_IF(condition, WARN, 1, format)
| ^~~~~~~~~~~~~~~
kernel/sched/alt_core.c:5637:9: note: in expansion of macro 'WARN_ONCE'
5637 | WARN_ONCE(current->state != TASK_RUNNING && current->task_state_change,
| ^~~~~~~~~
kernel/sched/alt_core.c: In function '___might_sleep':
>> kernel/sched/alt_core.c:5653:23: warning: variable 'preempt_disable_ip' set but not used [-Wunused-but-set-variable]
5653 | unsigned long preempt_disable_ip;
| ^~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:5813:20: warning: no previous prototype for 'sched_create_group' [-Wmissing-prototypes]
5813 | struct task_group *sched_create_group(struct task_group *parent)
| ^~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:5824:6: warning: no previous prototype for 'sched_online_group' [-Wmissing-prototypes]
5824 | void sched_online_group(struct task_group *tg, struct task_group *parent)
| ^~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:5835:6: warning: no previous prototype for 'sched_destroy_group' [-Wmissing-prototypes]
5835 | void sched_destroy_group(struct task_group *tg)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:5841:6: warning: no previous prototype for 'sched_offline_group' [-Wmissing-prototypes]
5841 | void sched_offline_group(struct task_group *tg)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:5933:27: warning: initialized field overwritten [-Woverride-init]
5933 | .legacy_cftypes = cpu_legacy_files,
| ^~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:5933:27: note: (near initialization for 'cpu_cgrp_subsys.legacy_cftypes')
kernel/sched/alt_core.c:142:18: warning: 'sched_sg_idle_mask' defined but not used [-Wunused-variable]
142 | static cpumask_t sched_sg_idle_mask ____cacheline_aligned_in_smp;
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/preempt_disable_ip +5653 kernel/sched/alt_core.c
5647
5648 void ___might_sleep(const char *file, int line, int preempt_offset)
5649 {
5650 /* Ratelimiting timestamp: */
5651 static unsigned long prev_jiffy;
5652
> 5653 unsigned long preempt_disable_ip;
5654
5655 /* WARN_ON_ONCE() by default, no rate limit required: */
5656 rcu_sleep_check();
5657
5658 if ((preempt_count_equals(preempt_offset) && !irqs_disabled() &&
5659 !is_idle_task(current) && !current->non_block_count) ||
5660 system_state == SYSTEM_BOOTING || system_state > SYSTEM_RUNNING ||
5661 oops_in_progress)
5662 return;
5663 if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
5664 return;
5665 prev_jiffy = jiffies;
5666
5667 /* Save this before calling printk(), since that will clobber it: */
5668 preempt_disable_ip = get_preempt_disable_ip(current);
5669
5670 printk(KERN_ERR
5671 "BUG: sleeping function called from invalid context at %s:%d\n",
5672 file, line);
5673 printk(KERN_ERR
5674 "in_atomic(): %d, irqs_disabled(): %d, non_block: %d, pid: %d, name: %s\n",
5675 in_atomic(), irqs_disabled(), current->non_block_count,
5676 current->pid, current->comm);
5677
5678 if (task_stack_end_corrupted(current))
5679 printk(KERN_EMERG "Thread overran stack, or stack corrupted\n");
5680
5681 debug_show_held_locks(current);
5682 if (irqs_disabled())
5683 print_irqtrace_events(current);
5684 #ifdef CONFIG_DEBUG_PREEMPT
5685 if (!preempt_count_equals(preempt_offset)) {
5686 pr_err("Preemption disabled at:");
5687 print_ip_sym(preempt_disable_ip);
5688 pr_cont("\n");
5689 }
5690 #endif
5691 dump_stack();
5692 add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
5693 }
5694 EXPORT_SYMBOL(___might_sleep);
5695
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[zen-kernel-zen-kernel:5.14/prjc 115/209] kernel/sched/alt_core.c:6838:5: warning: no previous prototype for 'sched_group_set_shares'
by kernel test robot
tree: https://github.com/zen-kernel/zen-kernel 5.14/prjc
head: d549588e3d79002f0c4b567b49644318af78a3db
commit: f39855f79e9734c35dc7c4fac4c68ad7ab895ea3 [115/209] sched/alt: Implement fake cpu.shares for CGROUP
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/zen-kernel/zen-kernel/commit/f39855f79e9734c35dc7c4fac...
git remote add zen-kernel-zen-kernel https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen-kernel-zen-kernel 5.14/prjc
git checkout f39855f79e9734c35dc7c4fac4c68ad7ab895ea3
# save the attached .config to linux build tree
make W=1 ARCH=um SUBARCH=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 >>):
kernel/sched/alt_core.c:4005:21: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
4005 | prev_state = prev->state;
| ^~~~~
| __state
kernel/sched/alt_core.c:4006:52: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
4006 | if (!preempt && prev_state && prev_state == prev->state) {
| ^~~~~
| __state
kernel/sched/alt_core.c:4008:10: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
4008 | prev->state = TASK_RUNNING;
| ^~~~~
| __state
kernel/sched/alt_core.c: In function 'sched_submit_work':
kernel/sched/alt_core.c:4109:12: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
4109 | if (!tsk->state)
| ^~~~~
| __state
In file included from include/asm-generic/bug.h:7,
from ./arch/um/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/asm-generic/current.h:5,
from ./arch/um/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
from include/linux/kthread.h:6,
from include/trace/events/sched.h:8,
from kernel/sched/alt_core.c:15:
kernel/sched/alt_core.c: In function 'schedule_idle':
kernel/sched/alt_core.c:4184:24: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
4184 | WARN_ON_ONCE(current->state);
| ^~~~~
include/linux/once_lite.h:15:27: note: in definition of macro 'DO_ONCE_LITE_IF'
15 | bool __ret_do_once = !!(condition); \
| ^~~~~~~~~
kernel/sched/alt_core.c:4184:2: note: in expansion of macro 'WARN_ON_ONCE'
4184 | WARN_ON_ONCE(current->state);
| ^~~~~~~~~~~~
kernel/sched/alt_core.c: In function '__sched_setscheduler':
kernel/sched/alt_core.c:4713:39: error: 'MAX_USER_RT_PRIO' undeclared (first use in this function); did you mean 'MAX_RT_PRIO'?
4713 | (p->mm && attr->sched_priority > MAX_USER_RT_PRIO - 1) ||
| ^~~~~~~~~~~~~~~~
| MAX_RT_PRIO
kernel/sched/alt_core.c:4713:39: note: each undeclared identifier is reported only once for each function it appears in
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:5473:13: error: redefinition of '_cond_resched'
5473 | int __sched _cond_resched(void)
| ^~~~~~~~~~~~~
In file included from include/linux/kthread.h:6,
from include/trace/events/sched.h:8,
from kernel/sched/alt_core.c:15:
include/linux/sched.h:1957:19: note: previous definition of '_cond_resched' was here
1957 | static inline int _cond_resched(void)
| ^~~~~~~~~~~~~
kernel/sched/alt_core.c: In function '__do_sys_sched_get_priority_max':
kernel/sched/alt_core.c:5626:9: error: 'MAX_USER_RT_PRIO' undeclared (first use in this function); did you mean 'MAX_RT_PRIO'?
5626 | ret = MAX_USER_RT_PRIO-1;
| ^~~~~~~~~~~~~~~~
| MAX_RT_PRIO
kernel/sched/alt_core.c: In function 'sched_show_task':
kernel/sched/alt_core.c:5736:9: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5736 | if (p->state == TASK_RUNNING)
| ^~~~~
| __state
kernel/sched/alt_core.c: In function 'state_filter_match':
kernel/sched/alt_core.c:5765:11: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5765 | if (!(p->state & state_filter))
| ^~~~~
| __state
kernel/sched/alt_core.c:5772:49: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5772 | if (state_filter == TASK_UNINTERRUPTIBLE && p->state == TASK_IDLE)
| ^~~~~
| __state
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:5779:6: error: conflicting types for 'show_state_filter'
5779 | void show_state_filter(unsigned long state_filter)
| ^~~~~~~~~~~~~~~~~
In file included from kernel/sched/alt_sched.h:9,
from kernel/sched/sched.h:6,
from kernel/sched/alt_core.c:18:
include/linux/sched/debug.h:17:13: note: previous declaration of 'show_state_filter' was here
17 | extern void show_state_filter(unsigned int state_filter);
| ^~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c: In function 'init_idle':
kernel/sched/alt_core.c:5838:8: error: 'struct task_struct' has no member named 'state'; did you mean '__state'?
5838 | idle->state = TASK_RUNNING;
| ^~~~~
| __state
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:6740:20: warning: no previous prototype for 'sched_create_group' [-Wmissing-prototypes]
6740 | struct task_group *sched_create_group(struct task_group *parent)
| ^~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6751:6: warning: no previous prototype for 'sched_online_group' [-Wmissing-prototypes]
6751 | void sched_online_group(struct task_group *tg, struct task_group *parent)
| ^~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6762:6: warning: no previous prototype for 'sched_destroy_group' [-Wmissing-prototypes]
6762 | void sched_destroy_group(struct task_group *tg)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6768:6: warning: no previous prototype for 'sched_offline_group' [-Wmissing-prototypes]
6768 | void sched_offline_group(struct task_group *tg)
| ^~~~~~~~~~~~~~~~~~~
>> kernel/sched/alt_core.c:6838:5: warning: no previous prototype for 'sched_group_set_shares' [-Wmissing-prototypes]
6838 | int sched_group_set_shares(struct task_group *tg, unsigned long shares)
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6907:20: warning: initialized field overwritten [-Woverride-init]
6907 | .legacy_cftypes = cpu_legacy_files,
| ^~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6907:20: note: (near initialization for 'cpu_cgrp_subsys.legacy_cftypes')
cc1: some warnings being treated as errors
vim +/sched_group_set_shares +6838 kernel/sched/alt_core.c
6750
> 6751 void sched_online_group(struct task_group *tg, struct task_group *parent)
6752 {
6753 }
6754
6755 /* rcu callback to free various structures associated with a task group */
6756 static void sched_free_group_rcu(struct rcu_head *rhp)
6757 {
6758 /* Now it should be safe to free those cfs_rqs */
6759 sched_free_group(container_of(rhp, struct task_group, rcu));
6760 }
6761
6762 void sched_destroy_group(struct task_group *tg)
6763 {
6764 /* Wait for possible concurrent references to cfs_rqs complete */
6765 call_rcu(&tg->rcu, sched_free_group_rcu);
6766 }
6767
6768 void sched_offline_group(struct task_group *tg)
6769 {
6770 }
6771
6772 static inline struct task_group *css_tg(struct cgroup_subsys_state *css)
6773 {
6774 return css ? container_of(css, struct task_group, css) : NULL;
6775 }
6776
6777 static struct cgroup_subsys_state *
6778 cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
6779 {
6780 struct task_group *parent = css_tg(parent_css);
6781 struct task_group *tg;
6782
6783 if (!parent) {
6784 /* This is early initialization for the top cgroup */
6785 return &root_task_group.css;
6786 }
6787
6788 tg = sched_create_group(parent);
6789 if (IS_ERR(tg))
6790 return ERR_PTR(-ENOMEM);
6791 return &tg->css;
6792 }
6793
6794 /* Expose task group only after completing cgroup initialization */
6795 static int cpu_cgroup_css_online(struct cgroup_subsys_state *css)
6796 {
6797 struct task_group *tg = css_tg(css);
6798 struct task_group *parent = css_tg(css->parent);
6799
6800 if (parent)
6801 sched_online_group(tg, parent);
6802 return 0;
6803 }
6804
6805 static void cpu_cgroup_css_released(struct cgroup_subsys_state *css)
6806 {
6807 struct task_group *tg = css_tg(css);
6808
6809 sched_offline_group(tg);
6810 }
6811
6812 static void cpu_cgroup_css_free(struct cgroup_subsys_state *css)
6813 {
6814 struct task_group *tg = css_tg(css);
6815
6816 /*
6817 * Relies on the RCU grace period between css_released() and this.
6818 */
6819 sched_free_group(tg);
6820 }
6821
6822 static void cpu_cgroup_fork(struct task_struct *task)
6823 {
6824 }
6825
6826 static int cpu_cgroup_can_attach(struct cgroup_taskset *tset)
6827 {
6828 return 0;
6829 }
6830
6831 static void cpu_cgroup_attach(struct cgroup_taskset *tset)
6832 {
6833 }
6834
6835 #ifdef CONFIG_FAIR_GROUP_SCHED
6836 static DEFINE_MUTEX(shares_mutex);
6837
> 6838 int sched_group_set_shares(struct task_group *tg, unsigned long shares)
6839 {
6840 /*
6841 * We can't change the weight of the root cgroup.
6842 */
6843 if (&root_task_group == tg)
6844 return -EINVAL;
6845
6846 shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES));
6847
6848 mutex_lock(&shares_mutex);
6849 if (tg->shares == shares)
6850 goto done;
6851
6852 tg->shares = shares;
6853 done:
6854 mutex_unlock(&shares_mutex);
6855 return 0;
6856 }
6857
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
include/linux/atomic/atomic-arch-fallback.h:60:32: error: implicit declaration of function 'arch_cmpxchg64'; did you mean 'arch_cmpxchg'?
by kernel test robot
Hi Mark,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c605c39677b9842b0566013e0cf30bc13e90bdbc
commit: e3d18cee258b898017b298b5b93f8134dd62aee3 locking/atomic: centralize generated headers
date: 8 weeks ago
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e3d18cee258b898017b298b5b93f8134dd62aee3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.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 errors (new ones prefixed by >>):
In file included from include/linux/atomic.h:80,
from drivers/iommu/io-pgtable-arm.c:12:
drivers/iommu/io-pgtable-arm.c: In function 'arm_lpae_install_table':
>> include/linux/atomic/atomic-arch-fallback.h:60:32: error: implicit declaration of function 'arch_cmpxchg64'; did you mean 'arch_cmpxchg'? [-Werror=implicit-function-declaration]
60 | #define arch_cmpxchg64_relaxed arch_cmpxchg64
| ^~~~~~~~~~~~~~
include/linux/atomic/atomic-instrumented.h:1261:9: note: in expansion of macro 'arch_cmpxchg64_relaxed'
1261 | arch_cmpxchg64_relaxed(__ai_ptr, __VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/iommu/io-pgtable-arm.c:320:15: note: in expansion of macro 'cmpxchg64_relaxed'
320 | old = cmpxchg64_relaxed(ptep, curr, new);
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +60 include/linux/atomic/atomic-arch-fallback.h
37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 56
37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 57 #ifndef arch_cmpxchg64_relaxed
37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 58 #define arch_cmpxchg64_acquire arch_cmpxchg64
37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 59 #define arch_cmpxchg64_release arch_cmpxchg64
29f006fdefe6f8 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-08-29 @60 #define arch_cmpxchg64_relaxed arch_cmpxchg64
37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 61 #else /* arch_cmpxchg64_relaxed */
37f8173dd84936 include/linux/atomic-arch-fallback.h Peter Zijlstra 2020-01-24 62
:::::: The code at line 60 was first introduced by commit
:::::: 29f006fdefe6f88abde973a0b0f20d2704e93fd4 asm-generic/atomic: Add try_cmpxchg() fallbacks
:::::: TO: Peter Zijlstra <peterz(a)infradead.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[rui:amd-pstate-dev-v1 5/19] drivers/cpufreq/amd-pstate.c:243 amd_pstate_adjust_perf() error: uninitialized symbol 'amd_des_perf'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rui/linux.git amd-pstate-dev-v1
head: abfcbc164c1aa0c63d5e256854bad977a9645586
commit: 54beca4738acc38c08710cfcb1c3312755000cf6 [5/19] cpufreq: amd: add fast switch function for amd-pstate module
config: i386-randconfig-m021-20210912 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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/cpufreq/amd-pstate.c:243 amd_pstate_adjust_perf() error: uninitialized symbol 'amd_des_perf'.
drivers/cpufreq/amd-pstate.c:270 amd_pstate_fast_switch() warn: should 'amd_des_perf << 10' be a 64 bit type?
Old smatch warnings:
drivers/cpufreq/amd-pstate.c:301 amd_get_max_freq() warn: should 'max_perf << 10' be a 64 bit type?
drivers/cpufreq/amd-pstate.c:342 amd_get_lowest_nonlinear_freq() warn: should 'lowest_nonlinear_perf << 10' be a 64 bit type?
vim +/amd_des_perf +243 drivers/cpufreq/amd-pstate.c
54beca4738acc3 Huang Rui 2021-08-13 215 static void amd_pstate_adjust_perf(unsigned int cpu,
54beca4738acc3 Huang Rui 2021-08-13 216 unsigned long min_perf,
54beca4738acc3 Huang Rui 2021-08-13 217 unsigned long target_perf,
54beca4738acc3 Huang Rui 2021-08-13 218 unsigned long capacity)
54beca4738acc3 Huang Rui 2021-08-13 219 {
54beca4738acc3 Huang Rui 2021-08-13 220 unsigned long amd_max_perf, amd_min_perf, amd_des_perf,
54beca4738acc3 Huang Rui 2021-08-13 221 amd_cap_perf, lowest_nonlinear_perf;
54beca4738acc3 Huang Rui 2021-08-13 222 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
54beca4738acc3 Huang Rui 2021-08-13 223 struct amd_cpudata *cpudata = policy->driver_data;
54beca4738acc3 Huang Rui 2021-08-13 224
54beca4738acc3 Huang Rui 2021-08-13 225 amd_cap_perf = READ_ONCE(cpudata->highest_perf);
54beca4738acc3 Huang Rui 2021-08-13 226 lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf);
54beca4738acc3 Huang Rui 2021-08-13 227
54beca4738acc3 Huang Rui 2021-08-13 228 if (target_perf < capacity)
54beca4738acc3 Huang Rui 2021-08-13 229 amd_des_perf = DIV_ROUND_UP(amd_cap_perf * target_perf,
54beca4738acc3 Huang Rui 2021-08-13 230 capacity);
Not initialized on else path.
54beca4738acc3 Huang Rui 2021-08-13 231
54beca4738acc3 Huang Rui 2021-08-13 232 amd_min_perf = READ_ONCE(cpudata->highest_perf);
54beca4738acc3 Huang Rui 2021-08-13 233 if (min_perf < capacity)
54beca4738acc3 Huang Rui 2021-08-13 234 amd_min_perf = DIV_ROUND_UP(amd_cap_perf * min_perf, capacity);
54beca4738acc3 Huang Rui 2021-08-13 235
54beca4738acc3 Huang Rui 2021-08-13 236 if (amd_min_perf < lowest_nonlinear_perf)
54beca4738acc3 Huang Rui 2021-08-13 237 amd_min_perf = lowest_nonlinear_perf;
54beca4738acc3 Huang Rui 2021-08-13 238
54beca4738acc3 Huang Rui 2021-08-13 239 amd_max_perf = amd_cap_perf;
54beca4738acc3 Huang Rui 2021-08-13 240 if (amd_max_perf < amd_min_perf)
54beca4738acc3 Huang Rui 2021-08-13 241 amd_max_perf = amd_min_perf;
54beca4738acc3 Huang Rui 2021-08-13 242
54beca4738acc3 Huang Rui 2021-08-13 @243 amd_des_perf = clamp_t(unsigned long, amd_des_perf,
^^^^^^^^^^^^
Uninitialized.
54beca4738acc3 Huang Rui 2021-08-13 244 amd_min_perf, amd_max_perf);
54beca4738acc3 Huang Rui 2021-08-13 245
54beca4738acc3 Huang Rui 2021-08-13 246 amd_pstate_update(cpudata, amd_min_perf, amd_des_perf,
54beca4738acc3 Huang Rui 2021-08-13 247 amd_max_perf, true);
54beca4738acc3 Huang Rui 2021-08-13 248 }
54beca4738acc3 Huang Rui 2021-08-13 249
54beca4738acc3 Huang Rui 2021-08-13 250 static unsigned int amd_pstate_fast_switch(struct cpufreq_policy *policy,
54beca4738acc3 Huang Rui 2021-08-13 251 unsigned int target_freq)
54beca4738acc3 Huang Rui 2021-08-13 252 {
54beca4738acc3 Huang Rui 2021-08-13 253 u64 ratio;
54beca4738acc3 Huang Rui 2021-08-13 254 struct amd_cpudata *cpudata = policy->driver_data;
54beca4738acc3 Huang Rui 2021-08-13 255 unsigned long amd_max_perf, amd_min_perf, amd_des_perf, nominal_perf;
54beca4738acc3 Huang Rui 2021-08-13 256
54beca4738acc3 Huang Rui 2021-08-13 257 if (!cpudata->max_freq)
54beca4738acc3 Huang Rui 2021-08-13 258 return -ENODEV;
54beca4738acc3 Huang Rui 2021-08-13 259
54beca4738acc3 Huang Rui 2021-08-13 260 amd_max_perf = READ_ONCE(cpudata->highest_perf);
54beca4738acc3 Huang Rui 2021-08-13 261 amd_min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf);
54beca4738acc3 Huang Rui 2021-08-13 262
54beca4738acc3 Huang Rui 2021-08-13 263 amd_des_perf = DIV_ROUND_UP(target_freq * amd_max_perf,
54beca4738acc3 Huang Rui 2021-08-13 264 cpudata->max_freq);
54beca4738acc3 Huang Rui 2021-08-13 265
54beca4738acc3 Huang Rui 2021-08-13 266 amd_pstate_update(cpudata, amd_min_perf, amd_des_perf,
54beca4738acc3 Huang Rui 2021-08-13 267 amd_max_perf, true);
54beca4738acc3 Huang Rui 2021-08-13 268
54beca4738acc3 Huang Rui 2021-08-13 269 nominal_perf = READ_ONCE(cpudata->nominal_perf);
54beca4738acc3 Huang Rui 2021-08-13 @270 ratio = div_u64(amd_des_perf << SCHED_CAPACITY_SHIFT, nominal_perf);
Should amd_des_perf be a u64? Does that matter on 32 bit systems?
54beca4738acc3 Huang Rui 2021-08-13 271
54beca4738acc3 Huang Rui 2021-08-13 272 return cpudata->nominal_freq * ratio >> SCHED_CAPACITY_SHIFT;
54beca4738acc3 Huang Rui 2021-08-13 273 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[rui:amd-pstate-dev-v1 4/19] drivers/cpufreq/amd-pstate.c:241 amd_get_max_freq() warn: should 'max_perf << 10' be a 64 bit type?
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rui/linux.git amd-pstate-dev-v1
head: abfcbc164c1aa0c63d5e256854bad977a9645586
commit: df9ad0b99a9f0e3371aa94e49fe92a2c2a9fa95d [4/19] cpufreq: amd: introduce a new amd pstate driver to support future processors
config: i386-randconfig-m021-20210912 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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:
drivers/cpufreq/amd-pstate.c:241 amd_get_max_freq() warn: should 'max_perf << 10' be a 64 bit type?
drivers/cpufreq/amd-pstate.c:282 amd_get_lowest_nonlinear_freq() warn: should 'lowest_nonlinear_perf << 10' be a 64 bit type?
vim +241 drivers/cpufreq/amd-pstate.c
df9ad0b99a9f0e Huang Rui 2021-06-10 227 static int amd_get_max_freq(struct amd_cpudata *cpudata)
df9ad0b99a9f0e Huang Rui 2021-06-10 228 {
df9ad0b99a9f0e Huang Rui 2021-06-10 229 struct cppc_perf_caps cppc_perf;
df9ad0b99a9f0e Huang Rui 2021-06-10 230 u32 max_perf, max_freq, nominal_freq, nominal_perf;
df9ad0b99a9f0e Huang Rui 2021-06-10 231 u64 boost_ratio;
df9ad0b99a9f0e Huang Rui 2021-06-10 232
df9ad0b99a9f0e Huang Rui 2021-06-10 233 int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf);
df9ad0b99a9f0e Huang Rui 2021-06-10 234 if (ret)
df9ad0b99a9f0e Huang Rui 2021-06-10 235 return ret;
df9ad0b99a9f0e Huang Rui 2021-06-10 236
df9ad0b99a9f0e Huang Rui 2021-06-10 237 nominal_freq = cppc_perf.nominal_freq;
df9ad0b99a9f0e Huang Rui 2021-06-10 238 nominal_perf = READ_ONCE(cpudata->nominal_perf);
df9ad0b99a9f0e Huang Rui 2021-06-10 239 max_perf = READ_ONCE(cpudata->highest_perf);
df9ad0b99a9f0e Huang Rui 2021-06-10 240
df9ad0b99a9f0e Huang Rui 2021-06-10 @241 boost_ratio = div_u64(max_perf << SCHED_CAPACITY_SHIFT,
df9ad0b99a9f0e Huang Rui 2021-06-10 242 nominal_perf);
Presumably the max_perf << SCHED_CAPACITY_SHIFT shift can wrap. The
"max_perf" variable should probably be declared as a u64. I will also
create a new static checker warning specifically for when div_u64() is
used on a u32.
df9ad0b99a9f0e Huang Rui 2021-06-10 243
df9ad0b99a9f0e Huang Rui 2021-06-10 244 max_freq = nominal_freq * boost_ratio >> SCHED_CAPACITY_SHIFT;
df9ad0b99a9f0e Huang Rui 2021-06-10 245
df9ad0b99a9f0e Huang Rui 2021-06-10 246 /* Switch to khz */
df9ad0b99a9f0e Huang Rui 2021-06-10 247 return max_freq * 1000;
df9ad0b99a9f0e Huang Rui 2021-06-10 248 }
df9ad0b99a9f0e Huang Rui 2021-06-10 249
df9ad0b99a9f0e Huang Rui 2021-06-10 250 static int amd_get_nominal_freq(struct amd_cpudata *cpudata)
df9ad0b99a9f0e Huang Rui 2021-06-10 251 {
df9ad0b99a9f0e Huang Rui 2021-06-10 252 struct cppc_perf_caps cppc_perf;
df9ad0b99a9f0e Huang Rui 2021-06-10 253 u32 nominal_freq;
df9ad0b99a9f0e Huang Rui 2021-06-10 254
df9ad0b99a9f0e Huang Rui 2021-06-10 255 int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf);
df9ad0b99a9f0e Huang Rui 2021-06-10 256 if (ret)
df9ad0b99a9f0e Huang Rui 2021-06-10 257 return ret;
df9ad0b99a9f0e Huang Rui 2021-06-10 258
df9ad0b99a9f0e Huang Rui 2021-06-10 259 nominal_freq = cppc_perf.nominal_freq;
df9ad0b99a9f0e Huang Rui 2021-06-10 260
df9ad0b99a9f0e Huang Rui 2021-06-10 261 /* Switch to khz */
df9ad0b99a9f0e Huang Rui 2021-06-10 262 return nominal_freq * 1000;
df9ad0b99a9f0e Huang Rui 2021-06-10 263 }
df9ad0b99a9f0e Huang Rui 2021-06-10 264
df9ad0b99a9f0e Huang Rui 2021-06-10 265 static int amd_get_lowest_nonlinear_freq(struct amd_cpudata *cpudata)
df9ad0b99a9f0e Huang Rui 2021-06-10 266 {
df9ad0b99a9f0e Huang Rui 2021-06-10 267 struct cppc_perf_caps cppc_perf;
df9ad0b99a9f0e Huang Rui 2021-06-10 268 u32 lowest_nonlinear_freq, lowest_nonlinear_perf,
df9ad0b99a9f0e Huang Rui 2021-06-10 269 nominal_freq, nominal_perf;
df9ad0b99a9f0e Huang Rui 2021-06-10 270 u64 lowest_nonlinear_ratio;
df9ad0b99a9f0e Huang Rui 2021-06-10 271
df9ad0b99a9f0e Huang Rui 2021-06-10 272 int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf);
df9ad0b99a9f0e Huang Rui 2021-06-10 273 if (ret)
df9ad0b99a9f0e Huang Rui 2021-06-10 274 return ret;
df9ad0b99a9f0e Huang Rui 2021-06-10 275
df9ad0b99a9f0e Huang Rui 2021-06-10 276 nominal_freq = cppc_perf.nominal_freq;
df9ad0b99a9f0e Huang Rui 2021-06-10 277 nominal_perf = READ_ONCE(cpudata->nominal_perf);
df9ad0b99a9f0e Huang Rui 2021-06-10 278
df9ad0b99a9f0e Huang Rui 2021-06-10 279 lowest_nonlinear_perf = cppc_perf.lowest_nonlinear_perf;
df9ad0b99a9f0e Huang Rui 2021-06-10 280
df9ad0b99a9f0e Huang Rui 2021-06-10 281 lowest_nonlinear_ratio = div_u64(lowest_nonlinear_perf <<
df9ad0b99a9f0e Huang Rui 2021-06-10 @282 SCHED_CAPACITY_SHIFT, nominal_perf);
Same.
df9ad0b99a9f0e Huang Rui 2021-06-10 283
df9ad0b99a9f0e Huang Rui 2021-06-10 284 lowest_nonlinear_freq = nominal_freq * lowest_nonlinear_ratio >> SCHED_CAPACITY_SHIFT;
df9ad0b99a9f0e Huang Rui 2021-06-10 285
df9ad0b99a9f0e Huang Rui 2021-06-10 286 /* Switch to khz */
df9ad0b99a9f0e Huang Rui 2021-06-10 287 return lowest_nonlinear_freq * 1000;
df9ad0b99a9f0e Huang Rui 2021-06-10 288 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[zen-kernel-zen-kernel:5.14/cacule 1/2] kernel/sched/fair.c:708:38: error: 'struct rq' has no member named 'cfs_tasks'
by kernel test robot
tree: https://github.com/zen-kernel/zen-kernel 5.14/cacule
head: 4430be30ae5bf7d608eb292aa8680a2dc82ca847
commit: 9e3f9e4d524cfe1d20d03a731930e4d6ebacbfd8 [1/2] CacULE 5.14
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/zen-kernel/zen-kernel/commit/9e3f9e4d524cfe1d20d03a731...
git remote add zen-kernel-zen-kernel https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen-kernel-zen-kernel 5.14/cacule
git checkout 9e3f9e4d524cfe1d20d03a731930e4d6ebacbfd8
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash
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/fair.c: In function 'update_IS':
>> kernel/sched/fair.c:708:38: error: 'struct rq' has no member named 'cfs_tasks'
708 | struct list_head *tasks = &rq->cfs_tasks;
| ^~
kernel/sched/fair.c: At top level:
kernel/sched/fair.c:842:5: warning: no previous prototype for 'sched_update_scaling' [-Wmissing-prototypes]
842 | int sched_update_scaling(void)
| ^~~~~~~~~~~~~~~~~~~~
vim +708 kernel/sched/fair.c
704
705 #ifdef CONFIG_CACULE_RDB
706 static void update_IS(struct rq *rq)
707 {
> 708 struct list_head *tasks = &rq->cfs_tasks;
709 struct task_struct *p, *to_migrate = NULL;
710 unsigned int max_IS = ~0, temp_IS;
711
712 list_for_each_entry(p, tasks, se.group_node) {
713 if (task_running(rq, p))
714 continue;
715
716 temp_IS = calc_interactivity(sched_clock(), &p->se.cacule_node);
717 if (temp_IS < max_IS) {
718 to_migrate = p;
719 max_IS = temp_IS;
720 }
721 }
722
723 if (to_migrate) {
724 WRITE_ONCE(rq->max_IS_score, max_IS);
725 WRITE_ONCE(rq->to_migrate_task, to_migrate);
726 } else if (rq->max_IS_score != ~0) {
727 WRITE_ONCE(rq->max_IS_score, ~0);
728 WRITE_ONCE(rq->to_migrate_task, NULL);
729 }
730 }
731 #endif
732
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year