arch/mips/ralink/mt7621.c:123:22: warning: '__builtin_memcmp' reading between 1 and 4 bytes from a region of size 0
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 99613159ad749543621da8238acf1a122880144e
commit: 139c949f7f0ac0dd1c0da132675be80e6d76c65d MIPS: ralink: mt7621: add memory detection support
date: 10 months ago
config: mips-randconfig-r036-20220119 (https://download.01.org/0day-ci/archive/20220119/202201191557.OISJHNMi-lk...)
compiler: mipsel-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://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 139c949f7f0ac0dd1c0da132675be80e6d76c65d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash arch/mips/ralink/
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 include/linux/kernel.h:10,
from arch/mips/ralink/mt7621.c:8:
arch/mips/ralink/mt7621.c: In function 'mt7621_memory_detect':
>> arch/mips/ralink/mt7621.c:123:22: warning: '__builtin_memcmp' reading between 1 and 4 bytes from a region of size 0 [-Wstringop-overread]
123 | if (!__builtin_memcmp(dm, dm + size, sizeof(detect_magic)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
arch/mips/ralink/mt7621.c:123:17: note: in expansion of macro 'if'
123 | if (!__builtin_memcmp(dm, dm + size, sizeof(detect_magic)))
| ^~
arch/mips/ralink/mt7621.c:54:14: note: at offset 33554432 into source object 'detect_magic' of size 4
54 | static void *detect_magic __initdata = detect_memory_region;
| ^~~~~~~~~~~~
In file included from include/linux/kernel.h:10,
from arch/mips/ralink/mt7621.c:8:
arch/mips/ralink/mt7621.c:129:13: warning: '__builtin_memcmp' reading between 1 and 4 bytes from a region of size 0 [-Wstringop-overread]
129 | __builtin_memcmp(dm, dm + size, sizeof(detect_magic))) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:69:10: note: in definition of macro '__trace_if_value'
69 | (cond) ? \
| ^~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
arch/mips/ralink/mt7621.c:127:9: note: in expansion of macro 'if'
127 | if ((size == 256 * SZ_1M) &&
| ^~
arch/mips/ralink/mt7621.c:54:14: note: at offset 268435456 into source object 'detect_magic' of size 4
54 | static void *detect_magic __initdata = detect_memory_region;
| ^~~~~~~~~~~~
{standard input}: Assembler messages:
{standard input}:127: Error: found '(', expected: ')'
{standard input}:127: Error: found '(', expected: ')'
{standard input}:127: Error: non-constant expression in ".if" statement
{standard input}:127: Error: junk at end of line, first unrecognized character is `('
{standard input}:154: Error: found '(', expected: ')'
{standard input}:154: Error: found '(', expected: ')'
{standard input}:154: Error: non-constant expression in ".if" statement
{standard input}:154: Error: junk at end of line, first unrecognized character is `('
vim +/__builtin_memcmp +123 arch/mips/ralink/mt7621.c
116
117 static void __init mt7621_memory_detect(void)
118 {
119 void *dm = &detect_magic;
120 phys_addr_t size;
121
122 for (size = 32 * SZ_1M; size < 256 * SZ_1M; size <<= 1) {
> 123 if (!__builtin_memcmp(dm, dm + size, sizeof(detect_magic)))
124 break;
125 }
126
127 if ((size == 256 * SZ_1M) &&
128 (CPHYSADDR(dm + size) < MT7621_LOWMEM_MAX_SIZE) &&
129 __builtin_memcmp(dm, dm + size, sizeof(detect_magic))) {
130 memblock_add(MT7621_LOWMEM_BASE, MT7621_LOWMEM_MAX_SIZE);
131 memblock_add(MT7621_HIGHMEM_BASE, MT7621_HIGHMEM_SIZE);
132 } else {
133 memblock_add(MT7621_LOWMEM_BASE, size);
134 }
135 }
136
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[esmil:visionfive 75/80] drivers/soc/sifive/sifive_l2_cache.c:157:17: error: implicit declaration of function 'writeq'; did you mean 'writeb'?
by kernel test robot
tree: https://github.com/esmil/linux visionfive
head: e46c3a7e373e6faa03399f1a41c29cf7546c37cb
commit: 37af0be028777ba2227a48b8d94ff92f52f7aba7 [75/80] RISC-V: Enable SIFIVE_L2_FLUSH for StarFive SoCs
config: riscv-randconfig-r002-20220118 (https://download.01.org/0day-ci/archive/20220119/202201191446.e8ud7CAP-lk...)
compiler: riscv32-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/esmil/linux/commit/37af0be028777ba2227a48b8d94ff92f52f...
git remote add esmil https://github.com/esmil/linux
git fetch --no-tags esmil visionfive
git checkout 37af0be028777ba2227a48b8d94ff92f52f7aba7
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv 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 >>):
drivers/soc/sifive/sifive_l2_cache.c: In function 'sifive_l2_flush64_range':
>> drivers/soc/sifive/sifive_l2_cache.c:157:17: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Werror=implicit-function-declaration]
157 | writeq(line, l2_base + SIFIVE_L2_FLUSH64);
| ^~~~~~
| writeb
cc1: some warnings being treated as errors
vim +157 drivers/soc/sifive/sifive_l2_cache.c
a967a289f16969 arch/riscv/mm/sifive_l2_cache.c Yash Shah 2019-05-06 125
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 126 #ifdef CONFIG_SIFIVE_L2_FLUSH
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 127 void sifive_l2_flush64_range(unsigned long start, unsigned long len)
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 128 {
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 129 unsigned long line;
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 130
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 131 if(!l2_base) {
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 132 pr_warn("L2CACHE: base addr invalid, skipping flush\n");
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 133 return;
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 134 }
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 135
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 136 /* TODO: if (len == 0), skipping flush or going on? */
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 137 if(!len) {
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 138 pr_debug("L2CACHE: flush64 range @ 0x%lx(len:0)\n", start);
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 139 return;
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 140 }
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 141
09426958620627 drivers/soc/sifive/sifive_l2_cache.c Atish Patra 2021-06-12 142 len = len + (start % SIFIVE_L2_FLUSH64_LINE_LEN);
09426958620627 drivers/soc/sifive/sifive_l2_cache.c Atish Patra 2021-06-12 143 start = ALIGN_DOWN(start, SIFIVE_L2_FLUSH64_LINE_LEN);
09426958620627 drivers/soc/sifive/sifive_l2_cache.c Atish Patra 2021-06-12 144
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 145 /* make sure the address is in the range */
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 146 if(start < CONFIG_SIFIVE_L2_FLUSH_START ||
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 147 (start + len) > (CONFIG_SIFIVE_L2_FLUSH_START +
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 148 CONFIG_SIFIVE_L2_FLUSH_SIZE)) {
36921b04361a57 drivers/soc/sifive/sifive_l2_cache.c Geert Uytterhoeven 2021-05-21 149 WARN(1, "L2CACHE: flush64 out of range: %lx(%lx), skip flush\n",
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 150 start, len);
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 151 return;
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 152 }
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 153
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 154 mb(); /* sync */
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 155 for (line = start; line < start + len;
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 156 line += SIFIVE_L2_FLUSH64_LINE_LEN) {
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 @157 writeq(line, l2_base + SIFIVE_L2_FLUSH64);
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 158 mb();
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 159 }
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 160 }
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 161 EXPORT_SYMBOL_GPL(sifive_l2_flush64_range);
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 162 #endif
d21f24663c127e drivers/soc/sifive/sifive_l2_cache.c Tom 2021-01-08 163
:::::: The code at line 157 was first introduced by commit
:::::: d21f24663c127ec288f925cd991a1d767e1dd609 sifive/sifive_l2_cache: Add sifive_l2_flush64_range function
:::::: TO: Tom <support(a)vamrs.com>
:::::: CC: Emil Renner Berthing <kernel(a)esmil.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[chrome-os:chromeos-5.10 9987/9999] drivers/gpu/arm/valhall/backend/gpu/mali_kbase_irq_linux.c:182:13: warning: no previous prototype for 'kbase_gpu_irq_test_handler'
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: d2945e83762685e27b20286924d8e59daa10233f
commit: 79b0a1f26446bb3026f29a6cc0cf40d82112ca85 [9987/9999] CHROMIUM: gpu: mali: Apply Valhall r32p0 EAC release
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20220119/202201191307.IKuVnor0-lk...)
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 chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout 79b0a1f26446bb3026f29a6cc0cf40d82112ca85
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/arm/valhall/
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 >>):
cc1: warning: kbuild/src/consumer/drivers/gpu/arm/valhall: No such file or directory [-Wmissing-include-dirs]
drivers/gpu/arm/valhall/mali_kbase_jd_debugfs.c: In function 'kbase_jd_debugfs_fence_info':
>> drivers/gpu/arm/valhall/mali_kbase_jd_debugfs.c:78:46: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'u64' {aka 'long long unsigned int'} [-Wformat=]
78 | "Sd(%llu#%u: %s) ",
| ~^
| |
| unsigned int
| %llu
79 | #endif
80 | fence->context, fence->seqno,
| ~~~~~~~~~~~~
| |
| u64 {aka long long unsigned int}
drivers/gpu/arm/valhall/mali_kbase_jd_debugfs.c:97:46: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'u64' {aka 'long long unsigned int'} [-Wformat=]
97 | "Wd(%llu#%u: %s) ",
| ~^
| |
| unsigned int
| %llu
98 | #endif
99 | fence->context, fence->seqno,
| ~~~~~~~~~~~~
| |
| u64 {aka long long unsigned int}
--
cc1: warning: kbuild/src/consumer/drivers/gpu/arm/valhall: No such file or directory [-Wmissing-include-dirs]
>> drivers/gpu/arm/valhall/backend/gpu/mali_kbase_irq_linux.c:182:13: warning: no previous prototype for 'kbase_gpu_irq_test_handler' [-Wmissing-prototypes]
182 | irqreturn_t kbase_gpu_irq_test_handler(int irq, void *data, u32 val)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/arm/valhall/backend/gpu/mali_kbase_irq_linux.c:210:5: warning: no previous prototype for 'kbase_set_custom_irq_handler' [-Wmissing-prototypes]
210 | int kbase_set_custom_irq_handler(struct kbase_device *kbdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/kbase_gpu_irq_test_handler +182 drivers/gpu/arm/valhall/backend/gpu/mali_kbase_irq_linux.c
f38632197c49e65 Nicolas Boichat 2020-04-18 168
f38632197c49e65 Nicolas Boichat 2020-04-18 169 /**
f38632197c49e65 Nicolas Boichat 2020-04-18 170 * kbase_gpu_irq_test_handler - Variant (for test) of kbase_gpu_irq_handler()
f38632197c49e65 Nicolas Boichat 2020-04-18 171 * @irq: IRQ number
f38632197c49e65 Nicolas Boichat 2020-04-18 172 * @data: Data associated with this IRQ (i.e. kbdev)
f38632197c49e65 Nicolas Boichat 2020-04-18 173 * @val: Value of the GPU_CONTROL_REG(GPU_IRQ_STATUS)
f38632197c49e65 Nicolas Boichat 2020-04-18 174 *
f38632197c49e65 Nicolas Boichat 2020-04-18 175 * Handle the GPU device interrupt source requests reflected in the
f38632197c49e65 Nicolas Boichat 2020-04-18 176 * given source bit-pattern. The test code caller is responsible for
f38632197c49e65 Nicolas Boichat 2020-04-18 177 * undertaking the required device power maintenace.
f38632197c49e65 Nicolas Boichat 2020-04-18 178 *
f38632197c49e65 Nicolas Boichat 2020-04-18 179 * Return: IRQ_HANDLED if the requests are from the GPU device,
f38632197c49e65 Nicolas Boichat 2020-04-18 180 * IRQ_NONE otherwise
f38632197c49e65 Nicolas Boichat 2020-04-18 181 */
10cd017481f1fa5 Fei Shao 2021-06-17 @182 irqreturn_t kbase_gpu_irq_test_handler(int irq, void *data, u32 val)
f38632197c49e65 Nicolas Boichat 2020-04-18 183 {
f38632197c49e65 Nicolas Boichat 2020-04-18 184 struct kbase_device *kbdev = kbase_untag(data);
f38632197c49e65 Nicolas Boichat 2020-04-18 185
f38632197c49e65 Nicolas Boichat 2020-04-18 186 if (!val)
f38632197c49e65 Nicolas Boichat 2020-04-18 187 return IRQ_NONE;
f38632197c49e65 Nicolas Boichat 2020-04-18 188
f38632197c49e65 Nicolas Boichat 2020-04-18 189 dev_dbg(kbdev->dev, "%s: irq %d irqstatus 0x%x\n", __func__, irq, val);
f38632197c49e65 Nicolas Boichat 2020-04-18 190
f38632197c49e65 Nicolas Boichat 2020-04-18 191 kbase_gpu_interrupt(kbdev, val);
f38632197c49e65 Nicolas Boichat 2020-04-18 192
f38632197c49e65 Nicolas Boichat 2020-04-18 193 return IRQ_HANDLED;
f38632197c49e65 Nicolas Boichat 2020-04-18 194 }
f38632197c49e65 Nicolas Boichat 2020-04-18 195
:::::: The code at line 182 was first introduced by commit
:::::: 10cd017481f1fa5fd8308956be32117a4103519f CHROMIUM: MALI: Include kutf modules
:::::: TO: Fei Shao <fshao(a)chromium.org>
:::::: CC: Commit Bot <commit-bot(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
drivers/misc/habanalabs/common/command_submission.c:2457 hl_cs_poll_fences() error: we previously assumed 'fence' could be null (see line 2430)
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 99613159ad749543621da8238acf1a122880144e
commit: e2558f0f84d85bfe2407b91d57798f133d8ad32a habanalabs: prevent wait if CS in multi-CS list completed
config: s390-randconfig-m031-20220117 (https://download.01.org/0day-ci/archive/20220119/202201190048.qRDA3uFx-lk...)
compiler: s390-linux-gcc (GCC) 11.2.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/misc/habanalabs/common/command_submission.c:2457 hl_cs_poll_fences() error: we previously assumed 'fence' could be null (see line 2430)
vim +/fence +2457 drivers/misc/habanalabs/common/command_submission.c
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2383 static int hl_cs_poll_fences(struct multi_cs_data *mcs_data, struct multi_cs_completion *mcs_compl)
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2384 {
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2385 struct hl_fence **fence_ptr = mcs_data->fence_arr;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2386 struct hl_device *hdev = mcs_data->ctx->hdev;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2387 int i, rc, arr_len = mcs_data->arr_len;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2388 u64 *seq_arr = mcs_data->seq_arr;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2389 ktime_t max_ktime, first_cs_time;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2390 enum hl_cs_wait_status status;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2391
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2392 memset(fence_ptr, 0, arr_len * sizeof(*fence_ptr));
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2393
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2394 /* get all fences under the same lock */
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2395 rc = hl_ctx_get_fences(mcs_data->ctx, seq_arr, fence_ptr, arr_len);
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2396 if (rc)
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2397 return rc;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2398
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2399 /*
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2400 * re-initialize the completion here to handle 2 possible cases:
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2401 * 1. CS will complete the multi-CS prior clearing the completion. in which
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2402 * case the fence iteration is guaranteed to catch the CS completion.
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2403 * 2. the completion will occur after re-init of the completion.
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2404 * in which case we will wake up immediately in wait_for_completion.
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2405 */
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2406 reinit_completion(&mcs_compl->completion);
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2407
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2408 /*
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2409 * set to maximum time to verify timestamp is valid: if at the end
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2410 * this value is maintained- no timestamp was updated
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2411 */
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2412 max_ktime = ktime_set(KTIME_SEC_MAX, 0);
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2413 first_cs_time = max_ktime;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2414
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2415 for (i = 0; i < arr_len; i++, fence_ptr++) {
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2416 struct hl_fence *fence = *fence_ptr;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2417
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2418 /*
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2419 * In order to prevent case where we wait until timeout even though a CS associated
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2420 * with the multi-CS actually completed we do things in the below order:
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2421 * 1. for each fence set it's QID map in the multi-CS completion QID map. This way
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2422 * any CS can, potentially, complete the multi CS for the specific QID (note
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2423 * that once completion is initialized, calling complete* and then wait on the
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2424 * completion will cause it to return at once)
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2425 * 2. only after allowing multi-CS completion for the specific QID we check whether
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2426 * the specific CS already completed (and thus the wait for completion part will
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2427 * be skipped). if the CS not completed it is guaranteed that completing CS will
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2428 * wake up the completion.
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2429 */
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 @2430 if (fence)
^^^^^
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2431 mcs_compl->stream_master_qid_map |= fence->stream_master_qid_map;
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2432
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2433 /*
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2434 * function won't sleep as it is called with timeout 0 (i.e.
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2435 * poll the fence)
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2436 */
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2437 rc = hl_wait_for_fence(mcs_data->ctx, seq_arr[i], fence,
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2438 &status, 0, NULL);
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2439 if (rc) {
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2440 dev_err(hdev->dev,
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2441 "wait_for_fence error :%d for CS seq %llu\n",
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2442 rc, seq_arr[i]);
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2443 break;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2444 }
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2445
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2446 switch (status) {
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2447 case CS_WAIT_STATUS_BUSY:
e2558f0f84d85b drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-12-07 2448 /* CS did not finished, QID to wait on already stored */
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2449 break;
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2450 case CS_WAIT_STATUS_COMPLETED:
ea6eb91c09cd4f drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-03 2451 /*
ea6eb91c09cd4f drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-03 2452 * Using mcs_handling_done to avoid possibility of mcs_data
ea6eb91c09cd4f drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-03 2453 * returns to user indicating CS completed before it finished
ea6eb91c09cd4f drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-03 2454 * all of its mcs handling, to avoid race the next time the
ea6eb91c09cd4f drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-03 2455 * user waits for mcs.
ea6eb91c09cd4f drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-03 2456 */
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 @2457 if (!fence->mcs_handling_done)
^^^^^^^
Unchecked derereference
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2458 break;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2459
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2460 mcs_data->completion_bitmap |= BIT(i);
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2461 /*
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2462 * For all completed CSs we take the earliest timestamp.
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2463 * For this we have to validate that the timestamp is
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2464 * earliest of all timestamps so far.
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2465 */
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2466 if (mcs_data->update_ts &&
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2467 (ktime_compare(fence->timestamp, first_cs_time) < 0))
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2468 first_cs_time = fence->timestamp;
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2469 break;
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2470 case CS_WAIT_STATUS_GONE:
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2471 mcs_data->update_ts = false;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2472 mcs_data->gone_cs = true;
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2473 /*
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2474 * It is possible to get an old sequence numbers from user
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2475 * which related to already completed CSs and their fences
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2476 * already gone. In this case, CS set as completed but
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2477 * no need to consider its QID for mcs completion.
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2478 */
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2479 mcs_data->completion_bitmap |= BIT(i);
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2480 break;
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2481 default:
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2482 dev_err(hdev->dev, "Invalid fence status\n");
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2483 return -EINVAL;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2484 }
b2faac3887df87 drivers/misc/habanalabs/common/command_submission.c Dani Liberman 2021-10-12 2485
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2486 }
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2487
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2488 hl_fences_put(mcs_data->fence_arr, arr_len);
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2489
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2490 if (mcs_data->update_ts &&
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2491 (ktime_compare(first_cs_time, max_ktime) != 0))
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2492 mcs_data->timestamp = ktime_to_ns(first_cs_time);
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2493
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2494 return rc;
215f0c1775d550 drivers/misc/habanalabs/common/command_submission.c Ohad Sharabi 2021-06-14 2495 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
fs/ext4/super.c:5656 ext4_fill_super() error: we previously assumed 'sbi' could be null (see line 5648)
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fe81ba137ebcc7f236780996a0b375732c07e85c
commit: cebe85d570cf84804e848332d6721bc9e5300e07 ext4: switch to the new mount api
config: s390-randconfig-m031-20220117 (https://download.01.org/0day-ci/archive/20220118/202201182249.eXYOFfs9-lk...)
compiler: s390-linux-gcc (GCC) 11.2.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:
fs/ext4/super.c:5656 ext4_fill_super() error: we previously assumed 'sbi' could be null (see line 5648)
Old smatch warnings:
fs/ext4/super.c:4165 ext4_register_li_request() error: we previously assumed 'ext4_li_info' could be null (see line 4147)
vim +/sbi +5656 fs/ext4/super.c
cebe85d570cf84 Lukas Czerner 2021-10-27 5640 static int ext4_fill_super(struct super_block *sb, struct fs_context *fc)
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5641 {
cebe85d570cf84 Lukas Czerner 2021-10-27 5642 struct ext4_fs_context *ctx = fc->fs_private;
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5643 struct ext4_sb_info *sbi;
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5644 const char *descr;
cebe85d570cf84 Lukas Czerner 2021-10-27 5645 int ret;
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5646
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5647 sbi = ext4_alloc_sbi(sb);
cebe85d570cf84 Lukas Czerner 2021-10-27 @5648 if (!sbi)
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5649 ret = -ENOMEM;
Presumably this should be "return -ENOMEM;"
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5650
cebe85d570cf84 Lukas Czerner 2021-10-27 5651 fc->s_fs_info = sbi;
cebe85d570cf84 Lukas Czerner 2021-10-27 5652
cebe85d570cf84 Lukas Czerner 2021-10-27 5653 /* Cleanup superblock name */
cebe85d570cf84 Lukas Czerner 2021-10-27 5654 strreplace(sb->s_id, '/', '!');
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5655
7edfd85b1ffd36 Lukas Czerner 2021-10-27 @5656 sbi->s_sb_block = 1; /* Default super block location */
^^^^^
cebe85d570cf84 Lukas Czerner 2021-10-27 5657 if (ctx->spec & EXT4_SPEC_s_sb_block)
cebe85d570cf84 Lukas Czerner 2021-10-27 5658 sbi->s_sb_block = ctx->s_sb_block;
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5659
cebe85d570cf84 Lukas Czerner 2021-10-27 5660 ret = __ext4_fill_super(fc, sb, fc->sb_flags & SB_SILENT);
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5661 if (ret < 0)
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5662 goto free_sbi;
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5663
cebe85d570cf84 Lukas Czerner 2021-10-27 5664 if (sbi->s_journal) {
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5665 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5666 descr = " journalled data mode";
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5667 else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5668 descr = " ordered data mode";
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5669 else
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5670 descr = " writeback data mode";
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5671 } else
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5672 descr = "out journal";
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5673
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5674 if (___ratelimit(&ext4_mount_msg_ratelimit, "EXT4-fs mount"))
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5675 ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. "
cebe85d570cf84 Lukas Czerner 2021-10-27 5676 "Quota mode: %s.", descr, ext4_quota_mode(sb));
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5677
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5678 return 0;
cebe85d570cf84 Lukas Czerner 2021-10-27 5679
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5680 free_sbi:
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5681 ext4_free_sbi(sbi);
cebe85d570cf84 Lukas Czerner 2021-10-27 5682 fc->s_fs_info = NULL;
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5683 return ret;
7edfd85b1ffd36 Lukas Czerner 2021-10-27 5684 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
by Dan Carpenter
Hi Xie,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 79e06c4c4950be2abd8ca5d2428a8c915aa62c24
commit: c8a6153b6c59d95c0e091f053f6f180952ade91e vduse: Introduce VDUSE - vDPA Device in Userspace
config: arm-randconfig-m031-20220116 (https://download.01.org/0day-ci/archive/20220117/202201171409.rqbXNHlz-lk...)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type?
vim +305 drivers/vdpa/vdpa_user/iova_domain.c
8c773d53fb7b64 Xie Yongji 2021-08-31 287 static dma_addr_t
8c773d53fb7b64 Xie Yongji 2021-08-31 288 vduse_domain_alloc_iova(struct iova_domain *iovad,
8c773d53fb7b64 Xie Yongji 2021-08-31 289 unsigned long size, unsigned long limit)
8c773d53fb7b64 Xie Yongji 2021-08-31 290 {
8c773d53fb7b64 Xie Yongji 2021-08-31 291 unsigned long shift = iova_shift(iovad);
8c773d53fb7b64 Xie Yongji 2021-08-31 292 unsigned long iova_len = iova_align(iovad, size) >> shift;
8c773d53fb7b64 Xie Yongji 2021-08-31 293 unsigned long iova_pfn;
8c773d53fb7b64 Xie Yongji 2021-08-31 294
8c773d53fb7b64 Xie Yongji 2021-08-31 295 /*
8c773d53fb7b64 Xie Yongji 2021-08-31 296 * Freeing non-power-of-two-sized allocations back into the IOVA caches
8c773d53fb7b64 Xie Yongji 2021-08-31 297 * will come back to bite us badly, so we have to waste a bit of space
8c773d53fb7b64 Xie Yongji 2021-08-31 298 * rounding up anything cacheable to make sure that can't happen. The
8c773d53fb7b64 Xie Yongji 2021-08-31 299 * order of the unadjusted size will still match upon freeing.
8c773d53fb7b64 Xie Yongji 2021-08-31 300 */
8c773d53fb7b64 Xie Yongji 2021-08-31 301 if (iova_len < (1 << (IOVA_RANGE_CACHE_MAX_SIZE - 1)))
8c773d53fb7b64 Xie Yongji 2021-08-31 302 iova_len = roundup_pow_of_two(iova_len);
8c773d53fb7b64 Xie Yongji 2021-08-31 303 iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
8c773d53fb7b64 Xie Yongji 2021-08-31 304
8c773d53fb7b64 Xie Yongji 2021-08-31 @305 return iova_pfn << shift;
I feel like iova_pfn should probably be declared as dma_addr_t?
8c773d53fb7b64 Xie Yongji 2021-08-31 306 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months