Re: [PATCH 4/8] mm: thp: only regular file could be THP eligible
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220228235741.102941-5-shy828301(a)gmail.com>
References: <20220228235741.102941-5-shy828301(a)gmail.com>
TO: Yang Shi <shy828301(a)gmail.com>
TO: vbabka(a)suse.cz
TO: kirill.shutemov(a)linux.intel.com
TO: songliubraving(a)fb.com
TO: linmiaohe(a)huawei.com
TO: riel(a)surriel.com
TO: willy(a)infradead.org
TO: ziy(a)nvidia.com
TO: akpm(a)linux-foundation.org
TO: tytso(a)mit.edu
TO: adilger.kernel(a)dilger.ca
TO: darrick.wong(a)oracle.com
CC: linux-mm(a)kvack.org
CC: linux-fsdevel(a)vger.kernel.org
CC: linux-ext4(a)vger.kernel.org
CC: linux-xfs(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
Hi Yang,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tytso-ext4/dev]
[also build test WARNING on xfs-linux/for-next linus/master v5.17-rc6 next-20220301]
[cannot apply to hnaz-mm/master]
[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/Yang-Shi/Make-khugepaged-collaps...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
:::::: branch date: 17 hours ago
:::::: commit date: 17 hours ago
config: arm64-randconfig-m031-20220227 (https://download.01.org/0day-ci/archive/20220302/202203020034.2Ii9kTrs-lk...)
compiler: aarch64-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:
include/linux/huge_mm.h:179 file_thp_enabled() warn: variable dereferenced before check 'vma->vm_file' (see line 177)
mm/khugepaged.c:468 hugepage_vma_check() error: we previously assumed 'vma->vm_file' could be null (see line 455)
include/linux/huge_mm.h:179 file_thp_enabled() warn: variable dereferenced before check 'vma->vm_file' (see line 177)
vim +179 include/linux/huge_mm.h
16981d763501c0 Dan Williams 2017-07-10 174
2224ed1155c07b Yang Shi 2022-02-28 175 static inline bool file_thp_enabled(struct vm_area_struct *vma)
2224ed1155c07b Yang Shi 2022-02-28 176 {
2224ed1155c07b Yang Shi 2022-02-28 @177 struct inode *inode = vma->vm_file->f_inode;
2224ed1155c07b Yang Shi 2022-02-28 178
2224ed1155c07b Yang Shi 2022-02-28 @179 return (IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS)) && vma->vm_file &&
2224ed1155c07b Yang Shi 2022-02-28 180 (vma->vm_flags & VM_EXEC) &&
2224ed1155c07b Yang Shi 2022-02-28 181 !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode);
2224ed1155c07b Yang Shi 2022-02-28 182 }
2224ed1155c07b Yang Shi 2022-02-28 183
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 1 week
[linux-next:master 3357/9592] drivers/soc/rockchip/dtpm.c:15:12: sparse: sparse: obsolete array initializer, use C99 syntax
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Daniel Lezcano <daniel.lezcano(a)linaro.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: e6ada6df471f847da3b09b357e246c62335bc0bb
commit: b9d6c47a2be8d273ecc063afda6e9fd66a35116d [3357/9592] rockchip/soc/drivers: Add DTPM description for rk3399
:::::: branch date: 2 hours ago
:::::: commit date: 4 weeks ago
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20220301/202203012019.rJHP6aue-lk...)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# 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 b9d6c47a2be8d273ecc063afda6e9fd66a35116d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/soc/rockchip/
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 >>)
>> drivers/soc/rockchip/dtpm.c:15:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:17:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:20:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:23:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:26:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:29:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:32:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:35:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:38:12: sparse: sparse: obsolete array initializer, use C99 syntax
drivers/soc/rockchip/dtpm.c:41:12: sparse: sparse: obsolete array initializer, use C99 syntax
vim +15 drivers/soc/rockchip/dtpm.c
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 13
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 14 static struct dtpm_node __initdata rk3399_hierarchy[] = {
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 @15 [0]{ .name = "rk3399",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 16 .type = DTPM_NODE_VIRTUAL },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 17 [1]{ .name = "package",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 18 .type = DTPM_NODE_VIRTUAL,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 19 .parent = &rk3399_hierarchy[0] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 20 [2]{ .name = "/cpus/cpu@0",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 21 .type = DTPM_NODE_DT,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 22 .parent = &rk3399_hierarchy[1] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 23 [3]{ .name = "/cpus/cpu@1",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 24 .type = DTPM_NODE_DT,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 25 .parent = &rk3399_hierarchy[1] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 26 [4]{ .name = "/cpus/cpu@2",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 27 .type = DTPM_NODE_DT,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 28 .parent = &rk3399_hierarchy[1] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 29 [5]{ .name = "/cpus/cpu@3",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 30 .type = DTPM_NODE_DT,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 31 .parent = &rk3399_hierarchy[1] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 32 [6]{ .name = "/cpus/cpu@100",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 33 .type = DTPM_NODE_DT,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 34 .parent = &rk3399_hierarchy[1] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 35 [7]{ .name = "/cpus/cpu@101",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 36 .type = DTPM_NODE_DT,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 37 .parent = &rk3399_hierarchy[1] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 38 [8]{ .name = "/gpu@ff9a0000",
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 39 .type = DTPM_NODE_DT,
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 40 .parent = &rk3399_hierarchy[1] },
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 41 [9]{ /* sentinel */ }
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 42 };
b9d6c47a2be8d2 Daniel Lezcano 2022-01-28 43
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 1 week
[linux-next:master 4037/9295] drivers/mtd/nand/raw/nand_base.c:348:3-9: preceding lock on line 345
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Sean Nyekjaer <sean(a)geanix.com>
CC: Miquel Raynal <miquel.raynal(a)bootlin.com>
CC: Boris Brezillon <bbrezillon(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6705cd745adbbeac6b13002c7a30060f7b2568a5
commit: 8cba323437a49a45756d661f500b324fc2d486fe [4037/9295] mtd: rawnand: protect access to rawnand devices while in suspend
:::::: branch date: 19 hours ago
:::::: commit date: 3 weeks ago
config: parisc-randconfig-c024-20220301 (https://download.01.org/0day-ci/archive/20220301/202203011846.QlcQbD94-lk...)
compiler: hppa64-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: Julia Lawall <julia.lawall(a)lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/mtd/nand/raw/nand_base.c:348:3-9: preceding lock on line 345
vim +348 drivers/mtd/nand/raw/nand_base.c
99f3351a6d6e03a Boris Brezillon 2018-11-11 332
99f3351a6d6e03a Boris Brezillon 2018-11-11 333 /**
99f3351a6d6e03a Boris Brezillon 2018-11-11 334 * nand_get_device - [GENERIC] Get chip for selected access
99f3351a6d6e03a Boris Brezillon 2018-11-11 335 * @chip: NAND chip structure
99f3351a6d6e03a Boris Brezillon 2018-11-11 336 *
013e6292aaf5e4b Boris Brezillon 2018-11-20 337 * Lock the device and its controller for exclusive access
013e6292aaf5e4b Boris Brezillon 2018-11-20 338 *
013e6292aaf5e4b Boris Brezillon 2018-11-20 339 * Return: -EBUSY if the chip has been suspended, 0 otherwise
99f3351a6d6e03a Boris Brezillon 2018-11-11 340 */
8cba323437a49a4 Sean Nyekjaer 2022-02-08 341 static void nand_get_device(struct nand_chip *chip)
99f3351a6d6e03a Boris Brezillon 2018-11-11 342 {
8cba323437a49a4 Sean Nyekjaer 2022-02-08 343 /* Wait until the device is resumed. */
8cba323437a49a4 Sean Nyekjaer 2022-02-08 344 while (1) {
013e6292aaf5e4b Boris Brezillon 2018-11-20 @345 mutex_lock(&chip->lock);
8cba323437a49a4 Sean Nyekjaer 2022-02-08 346 if (!chip->suspended) {
013e6292aaf5e4b Boris Brezillon 2018-11-20 347 mutex_lock(&chip->controller->lock);
8cba323437a49a4 Sean Nyekjaer 2022-02-08 @348 return;
8cba323437a49a4 Sean Nyekjaer 2022-02-08 349 }
8cba323437a49a4 Sean Nyekjaer 2022-02-08 350 mutex_unlock(&chip->lock);
013e6292aaf5e4b Boris Brezillon 2018-11-20 351
8cba323437a49a4 Sean Nyekjaer 2022-02-08 352 wait_event(chip->resume_wq, !chip->suspended);
8cba323437a49a4 Sean Nyekjaer 2022-02-08 353 }
99f3351a6d6e03a Boris Brezillon 2018-11-11 354 }
99f3351a6d6e03a Boris Brezillon 2018-11-11 355
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 1 week
[mcgrof:modules-testing 1/14] kernel/module/main.c:2335 simplify_symbols() warn: passing zero to 'PTR_ERR'
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Aaron Tomlin <atomlin(a)redhat.com>
CC: Luis Chamberlain <mcgrof(a)kernel.org>
CC: Christophe Leroy <christophe.leroy(a)csgroup.eu>
Hi Aaron,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git modules-testing
head: 8ca5e1dab7c3e51c63f07cd86e004a4df9ac7e76
commit: ca05e0ce6be41fb4fa3afabd6f6ca7a4af54260d [1/14] module: Move all into module/
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: i386-randconfig-m021-20220228 (https://download.01.org/0day-ci/archive/20220301/202203011513.U7wMTzND-lk...)
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:
kernel/module/main.c:2335 simplify_symbols() warn: passing zero to 'PTR_ERR'
vim +/PTR_ERR +2335 kernel/module/main.c
ebfac7b778fac8b kernel/module.c Fangrui Song 2021-01-15 2281
9a4b9708f1f2eaf kernel/module.c Matti Linnanvuori 2007-11-08 2282 /* Change all symbols so that st_value encodes the pointer directly. */
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2283 static int simplify_symbols(struct module *mod, const struct load_info *info)
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2284 {
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2285 Elf_Shdr *symsec = &info->sechdrs[info->index.sym];
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2286 Elf_Sym *sym = (void *)symsec->sh_addr;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2287 unsigned long secbase;
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2288 unsigned int i;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2289 int ret = 0;
414fd31b2553aaf kernel/module.c Tim Abbott 2008-12-05 2290 const struct kernel_symbol *ksym;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2291
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2292 for (i = 1; i < symsec->sh_size / sizeof(Elf_Sym); i++) {
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2293 const char *name = info->strtab + sym[i].st_name;
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2294
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2295 switch (sym[i].st_shndx) {
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2296 case SHN_COMMON:
80375980f1608f4 kernel/module.c Joe Mario 2014-02-08 2297 /* Ignore common symbols */
80375980f1608f4 kernel/module.c Joe Mario 2014-02-08 2298 if (!strncmp(name, "__gnu_lto", 9))
80375980f1608f4 kernel/module.c Joe Mario 2014-02-08 2299 break;
80375980f1608f4 kernel/module.c Joe Mario 2014-02-08 2300
24b9f0d22081455 kernel/module.c Sergey Shtylyov 2020-11-07 2301 /*
24b9f0d22081455 kernel/module.c Sergey Shtylyov 2020-11-07 2302 * We compiled with -fno-common. These are not
24b9f0d22081455 kernel/module.c Sergey Shtylyov 2020-11-07 2303 * supposed to happen.
24b9f0d22081455 kernel/module.c Sergey Shtylyov 2020-11-07 2304 */
5e12416927975aa kernel/module.c Jim Cromie 2011-12-06 2305 pr_debug("Common symbol: %s\n", name);
6da0b565150b323 kernel/module.c Ionut Alexa 2014-11-10 2306 pr_warn("%s: please compile with -fno-common\n",
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2307 mod->name);
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2308 ret = -ENOEXEC;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2309 break;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2310
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2311 case SHN_ABS:
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2312 /* Don't need to do anything */
5e12416927975aa kernel/module.c Jim Cromie 2011-12-06 2313 pr_debug("Absolute symbol: 0x%08lx\n",
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2314 (long)sym[i].st_value);
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2315 break;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2316
1ce15ef4f60529c kernel/module.c Jessica Yu 2016-03-22 2317 case SHN_LIVEPATCH:
1ce15ef4f60529c kernel/module.c Jessica Yu 2016-03-22 2318 /* Livepatch symbols are resolved by livepatch */
1ce15ef4f60529c kernel/module.c Jessica Yu 2016-03-22 2319 break;
1ce15ef4f60529c kernel/module.c Jessica Yu 2016-03-22 2320
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2321 case SHN_UNDEF:
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2322 ksym = resolve_symbol_wait(mod, info, name);
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2323 /* Ok if resolved. */
9bea7f23952d594 kernel/module.c Rusty Russell 2010-06-05 2324 if (ksym && !IS_ERR(ksym)) {
7290d58095712a8 kernel/module.c Ard Biesheuvel 2018-08-21 2325 sym[i].st_value = kernel_symbol_value(ksym);
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2326 break;
414fd31b2553aaf kernel/module.c Tim Abbott 2008-12-05 2327 }
414fd31b2553aaf kernel/module.c Tim Abbott 2008-12-05 2328
ebfac7b778fac8b kernel/module.c Fangrui Song 2021-01-15 2329 /* Ok if weak or ignored. */
ebfac7b778fac8b kernel/module.c Fangrui Song 2021-01-15 2330 if (!ksym &&
ebfac7b778fac8b kernel/module.c Fangrui Song 2021-01-15 2331 (ELF_ST_BIND(sym[i].st_info) == STB_WEAK ||
ebfac7b778fac8b kernel/module.c Fangrui Song 2021-01-15 2332 ignore_undef_symbol(info->hdr->e_machine, name)))
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2333 break;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2334
9bea7f23952d594 kernel/module.c Rusty Russell 2010-06-05 @2335 ret = PTR_ERR(ksym) ?: -ENOENT;
62267e0ecc9c00a kernel/module.c Jason A. Donenfeld 2018-06-22 2336 pr_warn("%s: Unknown symbol %s (err %d)\n",
62267e0ecc9c00a kernel/module.c Jason A. Donenfeld 2018-06-22 2337 mod->name, name, ret);
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2338 break;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2339
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2340 default:
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2341 /* Divert to percpu allocation if a percpu var. */
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2342 if (sym[i].st_shndx == info->index.pcpu)
259354deaaf03d4 kernel/module.c Tejun Heo 2010-03-10 2343 secbase = (unsigned long)mod_percpu(mod);
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2344 else
49668688dd5a5f4 kernel/module.c Rusty Russell 2010-08-05 2345 secbase = info->sechdrs[sym[i].st_shndx].sh_addr;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2346 sym[i].st_value += secbase;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2347 break;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2348 }
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2349 }
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2350
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2351 return ret;
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2352 }
^1da177e4c3f415 kernel/module.c Linus Torvalds 2005-04-16 2353
:::::: The code at line 2335 was first introduced by commit
:::::: 9bea7f23952d5948f8e5dfdff4de09bb9981fb5f module: fix bne2 "gave up waiting for init of module libcrc32c"
:::::: TO: Rusty Russell <rusty(a)rustcorp.com.au>
:::::: CC: Rusty Russell <rusty(a)rustcorp.com.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 1 week
drivers/net/can/usb/etas_es58x/es58x_core.c:1158:23: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Vincent Mailhol <mailhol.vincent(a)wanadoo.fr>
CC: "Marc Kleine-Budde" <mkl(a)pengutronix.de>
CC: Arunachalam Santhanam <arunachalam.santhanam(a)in.bosch.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 719fce7539cd3e186598e2aed36325fe892150cf
commit: 8537257874e949a59c834cecfd5a063e11b64b0b can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces
date: 11 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 11 months ago
config: mips-randconfig-c004-20220227 (https://download.01.org/0day-ci/archive/20220301/202203011222.JwdUA95o-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# 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 8537257874e949a59c834cecfd5a063e11b64b0b
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
12 warnings generated.
drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c:373:4: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = 0;
^ ~
drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c:373:4: note: Value stored to 'err' is never read
err = 0;
^ ~
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
11 warnings generated.
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
12 warnings generated.
Suppressed 12 warnings (12 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
11 warnings generated.
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
12 warnings generated.
drivers/net/can/usb/usb_8dev.c:569:9: warning: Access to field 'priv' results in a dereference of a null pointer (loaded from variable 'context') [clang-analyzer-core.NullDereference]
priv = context->priv;
^~~~~~~
drivers/net/can/usb/usb_8dev.c:563:2: note: 'context' initialized here
struct usb_8dev_tx_urb_context *context = urb->context;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/usb/usb_8dev.c:567:9: note: Assuming 'context' is null
BUG_ON(!context);
^
arch/mips/include/asm/bug.h:34:44: note: expanded from macro 'BUG_ON'
#define BUG_ON(C) __BUG_ON((unsigned long)(C))
^
drivers/net/can/usb/usb_8dev.c:569:9: note: Access to field 'priv' results in a dereference of a null pointer (loaded from variable 'context')
priv = context->priv;
^~~~~~~
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
12 warnings generated.
drivers/net/can/usb/ems_usb.c:500:8: warning: Access to field 'dev' results in a dereference of a null pointer (loaded from variable 'context') [clang-analyzer-core.NullDereference]
dev = context->dev;
^~~~~~~
drivers/net/can/usb/ems_usb.c:494:2: note: 'context' initialized here
struct ems_tx_urb_context *context = urb->context;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/usb/ems_usb.c:498:9: note: Assuming 'context' is null
BUG_ON(!context);
^
arch/mips/include/asm/bug.h:34:44: note: expanded from macro 'BUG_ON'
#define BUG_ON(C) __BUG_ON((unsigned long)(C))
^
drivers/net/can/usb/ems_usb.c:500:8: note: Access to field 'dev' results in a dereference of a null pointer (loaded from variable 'context')
dev = context->dev;
^~~~~~~
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
13 warnings generated.
drivers/net/can/usb/etas_es58x/es58x_core.c:839:28: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
netdev->stats.rx_bytes += cf->can_dlc;
^~~~~~~~~~~
drivers/net/can/usb/etas_es58x/es58x_core.c:649:6: note: Assuming the condition is false
if (!netif_running(netdev)) {
^~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/usb/etas_es58x/es58x_core.c:649:2: note: Taking false branch
if (!netif_running(netdev)) {
^
drivers/net/can/usb/etas_es58x/es58x_core.c:657:6: note: Assuming 'error' is not equal to ES58X_ERR_OK
if (error == ES58X_ERR_OK && event == ES58X_EVENT_OK) {
^~~~~~~~~~~~~~~~~~~~~
drivers/net/can/usb/etas_es58x/es58x_core.c:657:28: note: Left side of '&&' is false
if (error == ES58X_ERR_OK && event == ES58X_EVENT_OK) {
^
drivers/net/can/usb/etas_es58x/es58x_core.c:663:8: note: Value assigned to 'cf'
skb = alloc_can_err_skb(netdev, &cf);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/usb/etas_es58x/es58x_core.c:665:2: note: Control jumps to 'case ES58X_ERR_PROT_UNSPEC:' at line 727
switch (error) {
^
drivers/net/can/usb/etas_es58x/es58x_core.c:728:7: note: Assuming the condition is false
if (net_ratelimit())
^~~~~~~~~~~~~~~
drivers/net/can/usb/etas_es58x/es58x_core.c:728:3: note: Taking false branch
if (net_ratelimit())
^
drivers/net/can/usb/etas_es58x/es58x_core.c:730:7: note: Assuming 'cf' is null
if (cf)
^~
drivers/net/can/usb/etas_es58x/es58x_core.c:730:3: note: Taking false branch
if (cf)
^
drivers/net/can/usb/etas_es58x/es58x_core.c:732:3: note: Execution continues on line 744
break;
^
drivers/net/can/usb/etas_es58x/es58x_core.c:744:2: note: Control jumps to 'case ES58X_EVENT_OK:' at line 745
switch (event) {
^
drivers/net/can/usb/etas_es58x/es58x_core.c:746:3: note: Execution continues on line 838
break;
^
drivers/net/can/usb/etas_es58x/es58x_core.c:839:28: note: Dereference of null pointer
netdev->stats.rx_bytes += cf->can_dlc;
^~~~~~~~~~~
>> drivers/net/can/usb/etas_es58x/es58x_core.c:1158:23: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
const struct device *dev = es58x_dev->dev;
^~~ ~~~~~~~~~~~~~~
drivers/net/can/usb/etas_es58x/es58x_core.c:1158:23: note: Value stored to 'dev' during its initialization is never read
const struct device *dev = es58x_dev->dev;
^~~ ~~~~~~~~~~~~~~
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
12 warnings generated.
net/core/datagram.c:305:5: warning: 5th function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
!__skb_wait_for_more_packets(sk, sk_queue, err,
^
net/core/datagram.c:318:17: note: Assuming 'noblock' is 0
flags | (noblock ? MSG_DONTWAIT : 0),
^~~~~~~
net/core/datagram.c:318:17: note: '?' condition is false
net/core/datagram.c:317:9: note: Calling '__skb_recv_datagram'
return __skb_recv_datagram(sk, &sk->sk_receive_queue,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/datagram.c:291:24: note: 'last' declared without an initial value
struct sk_buff *skb, *last;
^~~~
net/core/datagram.c:294:10: note: Calling 'sock_rcvtimeo'
timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/net/sock.h:2378:9: note: Assuming 'noblock' is false
return noblock ? 0 : sk->sk_rcvtimeo;
^~~~~~~
include/net/sock.h:2378:9: note: '?' condition is false
include/net/sock.h:2378:2: note: Returning value, which participates in a condition later
return noblock ? 0 : sk->sk_rcvtimeo;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/datagram.c:294:10: note: Returning from 'sock_rcvtimeo'
timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/datagram.c:297:9: note: Calling '__skb_try_recv_datagram'
skb = __skb_try_recv_datagram(sk, sk_queue, flags, off, err,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/datagram.c:254:6: note: Assuming 'error' is not equal to 0
if (error)
^~~~~
net/core/datagram.c:254:2: note: Taking true branch
if (error)
^
net/core/datagram.c:255:3: note: Control jumps to line 282
goto no_packet;
^
net/core/datagram.c:283:2: note: Returning without writing to '*'
return NULL;
^
net/core/datagram.c:283:2: note: Returning null pointer, which participates in a condition later
return NULL;
^~~~~~~~~~~
net/core/datagram.c:297:9: note: Returning from '__skb_try_recv_datagram'
skb = __skb_try_recv_datagram(sk, sk_queue, flags, off, err,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/datagram.c:299:7: note: 'skb' is null
if (skb)
^~~
net/core/datagram.c:299:3: note: Taking false branch
if (skb)
^
net/core/datagram.c:302:7: note: Assuming the condition is false
if (*err != -EAGAIN)
^~~~~~~~~~~~~~~
net/core/datagram.c:302:3: note: Taking false branch
if (*err != -EAGAIN)
^
net/core/datagram.c:304:11: note: Assuming 'timeo' is not equal to 0
} while (timeo &&
^~~~~
net/core/datagram.c:304:11: note: Left side of '&&' is true
net/core/datagram.c:305:5: note: 5th function call argument is an uninitialized value
!__skb_wait_for_more_packets(sk, sk_queue, err,
^
Suppressed 11 warnings (11 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
13 warnings generated.
drivers/net/can/usb/gs_usb.c:326:8: warning: Array access (via field 'canch') results in a null pointer dereference [clang-analyzer-core.NullDereference]
dev = usbcan->canch[hf->channel];
^ ~~~~~
drivers/net/can/usb/gs_usb.c:299:2: note: 'usbcan' initialized here
struct gs_usb *usbcan = urb->context;
^~~~~~~~~~~~~~~~~~~~~
drivers/net/can/usb/gs_usb.c:309:9: note: Assuming 'usbcan' is null
BUG_ON(!usbcan);
^
arch/mips/include/asm/bug.h:34:44: note: expanded from macro 'BUG_ON'
#define BUG_ON(C) __BUG_ON((unsigned long)(C))
^
drivers/net/can/usb/gs_usb.c:311:2: note: Control jumps to 'case 0:' at line 312
switch (urb->status) {
^
drivers/net/can/usb/gs_usb.c:313:3: note: Execution continues on line 323
break;
^
drivers/net/can/usb/gs_usb.c:323:6: note: Assuming field 'channel' is < GS_MAX_INTF
if (hf->channel >= GS_MAX_INTF)
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/usb/gs_usb.c:323:2: note: Taking false branch
if (hf->channel >= GS_MAX_INTF)
vim +/dev +1158 drivers/net/can/usb/etas_es58x/es58x_core.c
8537257874e949a Vincent Mailhol 2021-04-10 1132
8537257874e949a Vincent Mailhol 2021-04-10 1133 /**
8537257874e949a Vincent Mailhol 2021-04-10 1134 * es58x_check_rx_urb() - Check the length and format of the URB command.
8537257874e949a Vincent Mailhol 2021-04-10 1135 * @es58x_dev: ES58X device.
8537257874e949a Vincent Mailhol 2021-04-10 1136 * @urb_cmd: The URB command received from the ES58X device, might not
8537257874e949a Vincent Mailhol 2021-04-10 1137 * be aligned.
8537257874e949a Vincent Mailhol 2021-04-10 1138 * @urb_actual_len: The actual length of the URB command.
8537257874e949a Vincent Mailhol 2021-04-10 1139 *
8537257874e949a Vincent Mailhol 2021-04-10 1140 * Check if the first message of the received urb is valid, that is to
8537257874e949a Vincent Mailhol 2021-04-10 1141 * say that both the header and the length are coherent.
8537257874e949a Vincent Mailhol 2021-04-10 1142 *
8537257874e949a Vincent Mailhol 2021-04-10 1143 * Return:
8537257874e949a Vincent Mailhol 2021-04-10 1144 * the length of the first message of the URB on success.
8537257874e949a Vincent Mailhol 2021-04-10 1145 *
8537257874e949a Vincent Mailhol 2021-04-10 1146 * -ENODATA if the URB command is incomplete (in which case, the URB
8537257874e949a Vincent Mailhol 2021-04-10 1147 * command should be buffered and combined with the next URB to try to
8537257874e949a Vincent Mailhol 2021-04-10 1148 * reconstitute the URB command).
8537257874e949a Vincent Mailhol 2021-04-10 1149 *
8537257874e949a Vincent Mailhol 2021-04-10 1150 * -EOVERFLOW if the length is bigger than the maximum expected one.
8537257874e949a Vincent Mailhol 2021-04-10 1151 *
8537257874e949a Vincent Mailhol 2021-04-10 1152 * -EBADRQC if the start of frame does not match the expected value.
8537257874e949a Vincent Mailhol 2021-04-10 1153 */
8537257874e949a Vincent Mailhol 2021-04-10 1154 static signed int es58x_check_rx_urb(struct es58x_device *es58x_dev,
8537257874e949a Vincent Mailhol 2021-04-10 1155 const union es58x_urb_cmd *urb_cmd,
8537257874e949a Vincent Mailhol 2021-04-10 1156 u32 urb_actual_len)
8537257874e949a Vincent Mailhol 2021-04-10 1157 {
8537257874e949a Vincent Mailhol 2021-04-10 @1158 const struct device *dev = es58x_dev->dev;
8537257874e949a Vincent Mailhol 2021-04-10 1159 const struct es58x_parameters *param = es58x_dev->param;
8537257874e949a Vincent Mailhol 2021-04-10 1160 u16 sof, msg_len;
8537257874e949a Vincent Mailhol 2021-04-10 1161 signed int urb_cmd_len, ret;
8537257874e949a Vincent Mailhol 2021-04-10 1162
8537257874e949a Vincent Mailhol 2021-04-10 1163 if (urb_actual_len < param->urb_cmd_header_len) {
8537257874e949a Vincent Mailhol 2021-04-10 1164 dev_vdbg(dev,
8537257874e949a Vincent Mailhol 2021-04-10 1165 "%s: Received %d bytes [%*ph]: header incomplete\n",
8537257874e949a Vincent Mailhol 2021-04-10 1166 __func__, urb_actual_len, urb_actual_len,
8537257874e949a Vincent Mailhol 2021-04-10 1167 urb_cmd->raw_cmd);
8537257874e949a Vincent Mailhol 2021-04-10 1168 return -ENODATA;
8537257874e949a Vincent Mailhol 2021-04-10 1169 }
8537257874e949a Vincent Mailhol 2021-04-10 1170
8537257874e949a Vincent Mailhol 2021-04-10 1171 sof = get_unaligned_le16(&urb_cmd->sof);
8537257874e949a Vincent Mailhol 2021-04-10 1172 if (sof != param->rx_start_of_frame) {
8537257874e949a Vincent Mailhol 2021-04-10 1173 dev_err_ratelimited(es58x_dev->dev,
8537257874e949a Vincent Mailhol 2021-04-10 1174 "%s: Expected sequence 0x%04X for start of frame but got 0x%04X.\n",
8537257874e949a Vincent Mailhol 2021-04-10 1175 __func__, param->rx_start_of_frame, sof);
8537257874e949a Vincent Mailhol 2021-04-10 1176 return -EBADRQC;
8537257874e949a Vincent Mailhol 2021-04-10 1177 }
8537257874e949a Vincent Mailhol 2021-04-10 1178
8537257874e949a Vincent Mailhol 2021-04-10 1179 msg_len = es58x_dev->ops->get_msg_len(urb_cmd);
8537257874e949a Vincent Mailhol 2021-04-10 1180 urb_cmd_len = es58x_get_urb_cmd_len(es58x_dev, msg_len);
8537257874e949a Vincent Mailhol 2021-04-10 1181 if (urb_cmd_len > param->rx_urb_cmd_max_len) {
8537257874e949a Vincent Mailhol 2021-04-10 1182 dev_err_ratelimited(es58x_dev->dev,
8537257874e949a Vincent Mailhol 2021-04-10 1183 "%s: Biggest expected size for rx urb_cmd is %u but receive a command of size %d\n",
8537257874e949a Vincent Mailhol 2021-04-10 1184 __func__,
8537257874e949a Vincent Mailhol 2021-04-10 1185 param->rx_urb_cmd_max_len, urb_cmd_len);
8537257874e949a Vincent Mailhol 2021-04-10 1186 return -EOVERFLOW;
8537257874e949a Vincent Mailhol 2021-04-10 1187 } else if (urb_actual_len < urb_cmd_len) {
8537257874e949a Vincent Mailhol 2021-04-10 1188 dev_vdbg(dev, "%s: Received %02d/%02d bytes\n",
8537257874e949a Vincent Mailhol 2021-04-10 1189 __func__, urb_actual_len, urb_cmd_len);
8537257874e949a Vincent Mailhol 2021-04-10 1190 return -ENODATA;
8537257874e949a Vincent Mailhol 2021-04-10 1191 }
8537257874e949a Vincent Mailhol 2021-04-10 1192
8537257874e949a Vincent Mailhol 2021-04-10 1193 ret = es58x_check_crc(es58x_dev, urb_cmd, urb_cmd_len);
8537257874e949a Vincent Mailhol 2021-04-10 1194 if (ret)
8537257874e949a Vincent Mailhol 2021-04-10 1195 return ret;
8537257874e949a Vincent Mailhol 2021-04-10 1196
8537257874e949a Vincent Mailhol 2021-04-10 1197 return urb_cmd_len;
8537257874e949a Vincent Mailhol 2021-04-10 1198 }
8537257874e949a Vincent Mailhol 2021-04-10 1199
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 1 week
[linux-next:master 9116/9295] drivers/scsi/lpfc/lpfc_els.c:7696:38: sparse: sparse: invalid assignment: |=
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: James Smart <jsmart2021(a)gmail.com>
CC: "Martin K. Petersen" <martin.petersen(a)oracle.com>
CC: Justin Tee <justin.tee(a)broadcom.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6705cd745adbbeac6b13002c7a30060f7b2568a5
commit: dfef7e6b4ae0ff773fbb16b0c9741d277d905580 [9116/9295] scsi: lpfc: SLI path split: Refactor base ELS paths and the FLOGI path
:::::: branch date: 12 hours ago
:::::: commit date: 24 hours ago
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220301/202203011136.Db9mdQHJ-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# 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 dfef7e6b4ae0ff773fbb16b0c9741d277d905580
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/scsi/lpfc/
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 >>)
drivers/scsi/lpfc/lpfc_els.c:6521:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:6521:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6522:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6522:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6522:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6533:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6533:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6533:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6550:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6550:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:6550:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6551:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6551:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6551:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6562:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6562:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6562:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6579:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6579:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:6579:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6580:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6580:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6580:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6592:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6592:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6592:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6609:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] function_flags @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6609:39: sparse: expected unsigned int [usertype] function_flags
drivers/scsi/lpfc/lpfc_els.c:6609:39: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6610:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6610:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6610:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6618:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6618:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6618:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6624:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6624:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6624:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6633:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6633:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6633:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6635:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] CorrectedBlocks @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6635:36: sparse: expected unsigned int [usertype] CorrectedBlocks
drivers/scsi/lpfc/lpfc_els.c:6635:36: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6637:40: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] UncorrectableBlocks @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6637:40: sparse: expected unsigned int [usertype] UncorrectableBlocks
drivers/scsi/lpfc/lpfc_els.c:6637:40: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6640:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6640:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6640:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6651:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6651:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6651:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6689:37: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] speed @@ got restricted __be16 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6689:37: sparse: expected unsigned short [usertype] speed
drivers/scsi/lpfc/lpfc_els.c:6689:37: sparse: got restricted __be16 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6717:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] capabilities @@ got restricted __be16 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6717:44: sparse: expected unsigned short [usertype] capabilities
drivers/scsi/lpfc/lpfc_els.c:6717:44: sparse: got restricted __be16 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6718:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6718:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6718:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6727:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6727:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6727:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6735:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6735:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6735:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6744:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] tag @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6744:19: sparse: expected unsigned int [usertype] tag
drivers/scsi/lpfc/lpfc_els.c:6744:19: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6759:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6759:22: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6759:22: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6850:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:6850:25: sparse: expected unsigned int [usertype] length
drivers/scsi/lpfc/lpfc_els.c:6850:25: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:6858:22: sparse: sparse: cast to restricted __le32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:6993:9: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7002:25: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7004:36: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7007:25: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7212:17: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:7217:21: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:7227:17: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:7272:9: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:7272:9: sparse: sparse: cast to restricted __be16
drivers/scsi/lpfc/lpfc_els.c:7416:31: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7419:44: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7516:23: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7577:23: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7630:37: sparse: sparse: cast to restricted __be32
drivers/scsi/lpfc/lpfc_els.c:7691:42: sparse: sparse: cast to restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:7696:38: sparse: sparse: invalid assignment: |=
>> drivers/scsi/lpfc/lpfc_els.c:7696:38: sparse: left side has type unsigned int
>> drivers/scsi/lpfc/lpfc_els.c:7696:38: sparse: right side has type restricted __be32
>> drivers/scsi/lpfc/lpfc_els.c:8207:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] linkFailureCnt @@ got restricted __be32 [usertype] @@
drivers/scsi/lpfc/lpfc_els.c:8207:33: sparse: expected unsigned int [usertype] linkFailureCnt
drivers/scsi/lpfc/lpfc_els.c:8207:33: sparse: got restricted __be32 [usertype]
drivers/scsi/lpfc/lpfc_els.c:8208:30: sparse: sparse: too many warnings
vim +7696 drivers/scsi/lpfc/lpfc_els.c
ddcc50f0f3538e4 James Smart 2008-12-04 7538
e59058c44025d71 James Smart 2008-08-24 7539 /**
3621a710a7dbb2d James Smart 2009-04-06 7540 * lpfc_els_rcv_rscn - Process an unsolicited rscn iocb
e59058c44025d71 James Smart 2008-08-24 7541 * @vport: pointer to a host virtual N_Port data structure.
e59058c44025d71 James Smart 2008-08-24 7542 * @cmdiocb: pointer to lpfc command iocb data structure.
e59058c44025d71 James Smart 2008-08-24 7543 * @ndlp: pointer to a node-list data structure.
e59058c44025d71 James Smart 2008-08-24 7544 *
e59058c44025d71 James Smart 2008-08-24 7545 * This routine processes an unsolicited RSCN (Registration State Change
e59058c44025d71 James Smart 2008-08-24 7546 * Notification) IOCB. First, the payload of the unsolicited RSCN is walked
e59058c44025d71 James Smart 2008-08-24 7547 * to invoke fc_host_post_event() routine to the FC transport layer. If the
e59058c44025d71 James Smart 2008-08-24 7548 * discover state machine is about to begin discovery, it just accepts the
e59058c44025d71 James Smart 2008-08-24 7549 * RSCN and the discovery process will satisfy the RSCN. If this RSCN only
e59058c44025d71 James Smart 2008-08-24 7550 * contains N_Port IDs for other vports on this HBA, it just accepts the
e59058c44025d71 James Smart 2008-08-24 7551 * RSCN and ignore processing it. If the state machine is in the recovery
e59058c44025d71 James Smart 2008-08-24 7552 * state, the fc_rscn_id_list of this @vport is walked and the
e59058c44025d71 James Smart 2008-08-24 7553 * lpfc_rscn_recovery_check() routine is invoked to send recovery event for
e59058c44025d71 James Smart 2008-08-24 7554 * all nodes that match RSCN payload. Otherwise, the lpfc_els_handle_rscn()
e59058c44025d71 James Smart 2008-08-24 7555 * routine is invoked to handle the RSCN event.
e59058c44025d71 James Smart 2008-08-24 7556 *
e59058c44025d71 James Smart 2008-08-24 7557 * Return code
e59058c44025d71 James Smart 2008-08-24 7558 * 0 - Just sent the acc response
e59058c44025d71 James Smart 2008-08-24 7559 * 1 - Sent the acc response and waited for name server completion
e59058c44025d71 James Smart 2008-08-24 7560 **/
dea3101e0a5c897 James Bottomley 2005-04-17 7561 static int
2e0fef85e098f67 James Smart 2007-06-17 7562 lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
51ef4c26891a734 James Smart 2007-08-02 7563 struct lpfc_nodelist *ndlp)
dea3101e0a5c897 James Bottomley 2005-04-17 7564 {
2e0fef85e098f67 James Smart 2007-06-17 7565 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2e0fef85e098f67 James Smart 2007-06-17 7566 struct lpfc_hba *phba = vport->phba;
dea3101e0a5c897 James Bottomley 2005-04-17 7567 struct lpfc_dmabuf *pcmd;
92d7f7b0cde3ad2 James Smart 2007-06-17 7568 uint32_t *lp, *datap;
92d7f7b0cde3ad2 James Smart 2007-06-17 7569 uint32_t payload_len, length, nportid, *cmd;
7f5f3d0d02aa2f1 James Smart 2008-02-08 7570 int rscn_cnt;
92d7f7b0cde3ad2 James Smart 2007-06-17 7571 int rscn_id = 0, hba_id = 0;
2332e6e475b016e James Smart 2019-11-04 7572 int i, tmo;
dea3101e0a5c897 James Bottomley 2005-04-17 7573
dea3101e0a5c897 James Bottomley 2005-04-17 7574 pcmd = (struct lpfc_dmabuf *) cmdiocb->context2;
dea3101e0a5c897 James Bottomley 2005-04-17 7575 lp = (uint32_t *) pcmd->virt;
dea3101e0a5c897 James Bottomley 2005-04-17 7576
92d7f7b0cde3ad2 James Smart 2007-06-17 7577 payload_len = be32_to_cpu(*lp++ & ~ELS_CMD_MASK);
dea3101e0a5c897 James Bottomley 2005-04-17 7578 payload_len -= sizeof(uint32_t); /* take off word 0 */
dea3101e0a5c897 James Bottomley 2005-04-17 7579 /* RSCN received */
e8b62011d88d6fd James Smart 2007-08-02 7580 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
e8b62011d88d6fd James Smart 2007-08-02 7581 "0214 RSCN received Data: x%x x%x x%x x%x\n",
7f5f3d0d02aa2f1 James Smart 2008-02-08 7582 vport->fc_flag, payload_len, *lp,
7f5f3d0d02aa2f1 James Smart 2008-02-08 7583 vport->fc_rscn_id_cnt);
ddcc50f0f3538e4 James Smart 2008-12-04 7584
ddcc50f0f3538e4 James Smart 2008-12-04 7585 /* Send an RSCN event to the management application */
ddcc50f0f3538e4 James Smart 2008-12-04 7586 lpfc_send_rscn_event(vport, cmdiocb);
ddcc50f0f3538e4 James Smart 2008-12-04 7587
d2873e4c1ef293e James Smart 2006-08-18 7588 for (i = 0; i < payload_len/sizeof(uint32_t); i++)
2e0fef85e098f67 James Smart 2007-06-17 7589 fc_host_post_event(shost, fc_get_event_number(),
d2873e4c1ef293e James Smart 2006-08-18 7590 FCH_EVT_RSCN, lp[i]);
d2873e4c1ef293e James Smart 2006-08-18 7591
f60cb93bbfecf1a James Smart 2019-05-14 7592 /* Check if RSCN is coming from a direct-connected remote NPort */
f60cb93bbfecf1a James Smart 2019-05-14 7593 if (vport->fc_flag & FC_PT2PT) {
f60cb93bbfecf1a James Smart 2019-05-14 7594 /* If so, just ACC it, no other action needed for now */
f60cb93bbfecf1a James Smart 2019-05-14 7595 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
f60cb93bbfecf1a James Smart 2019-05-14 7596 "2024 pt2pt RSCN %08x Data: x%x x%x\n",
f60cb93bbfecf1a James Smart 2019-05-14 7597 *lp, vport->fc_flag, payload_len);
f60cb93bbfecf1a James Smart 2019-05-14 7598 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
6f2589f478795c4 James Smart 2019-05-14 7599
a6d10f24a04d658 James Smart 2019-08-14 7600 /* Check to see if we need to NVME rescan this target
a6d10f24a04d658 James Smart 2019-08-14 7601 * remoteport.
a6d10f24a04d658 James Smart 2019-08-14 7602 */
a6d10f24a04d658 James Smart 2019-08-14 7603 if (ndlp->nlp_fc4_type & NLP_FC4_NVME &&
a6d10f24a04d658 James Smart 2019-08-14 7604 ndlp->nlp_type & (NLP_NVME_TARGET | NLP_NVME_DISCOVERY))
6f2589f478795c4 James Smart 2019-05-14 7605 lpfc_nvme_rescan_port(vport, ndlp);
f60cb93bbfecf1a James Smart 2019-05-14 7606 return 0;
f60cb93bbfecf1a James Smart 2019-05-14 7607 }
f60cb93bbfecf1a James Smart 2019-05-14 7608
dea3101e0a5c897 James Bottomley 2005-04-17 7609 /* If we are about to begin discovery, just ACC the RSCN.
dea3101e0a5c897 James Bottomley 2005-04-17 7610 * Discovery processing will satisfy it.
dea3101e0a5c897 James Bottomley 2005-04-17 7611 */
2e0fef85e098f67 James Smart 2007-06-17 7612 if (vport->port_state <= LPFC_NS_QRY) {
858c9f6c19c6f9b James Smart 2007-06-17 7613 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
858c9f6c19c6f9b James Smart 2007-06-17 7614 "RCV RSCN ignore: did:x%x/ste:x%x flg:x%x",
858c9f6c19c6f9b James Smart 2007-06-17 7615 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
858c9f6c19c6f9b James Smart 2007-06-17 7616
51ef4c26891a734 James Smart 2007-08-02 7617 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
c9f8735beadfba4 Jamie Wellnitz 2006-02-28 7618 return 0;
dea3101e0a5c897 James Bottomley 2005-04-17 7619 }
dea3101e0a5c897 James Bottomley 2005-04-17 7620
92d7f7b0cde3ad2 James Smart 2007-06-17 7621 /* If this RSCN just contains NPortIDs for other vports on this HBA,
92d7f7b0cde3ad2 James Smart 2007-06-17 7622 * just ACC and ignore it.
92d7f7b0cde3ad2 James Smart 2007-06-17 7623 */
92d7f7b0cde3ad2 James Smart 2007-06-17 7624 if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) &&
3de2a653a127c46 James Smart 2007-08-02 7625 !(vport->cfg_peer_port_login)) {
92d7f7b0cde3ad2 James Smart 2007-06-17 7626 i = payload_len;
92d7f7b0cde3ad2 James Smart 2007-06-17 7627 datap = lp;
92d7f7b0cde3ad2 James Smart 2007-06-17 7628 while (i > 0) {
92d7f7b0cde3ad2 James Smart 2007-06-17 7629 nportid = *datap++;
92d7f7b0cde3ad2 James Smart 2007-06-17 7630 nportid = ((be32_to_cpu(nportid)) & Mask_DID);
92d7f7b0cde3ad2 James Smart 2007-06-17 7631 i -= sizeof(uint32_t);
92d7f7b0cde3ad2 James Smart 2007-06-17 7632 rscn_id++;
549e55cd2a1b83e James Smart 2007-08-02 7633 if (lpfc_find_vport_by_did(phba, nportid))
92d7f7b0cde3ad2 James Smart 2007-06-17 7634 hba_id++;
92d7f7b0cde3ad2 James Smart 2007-06-17 7635 }
92d7f7b0cde3ad2 James Smart 2007-06-17 7636 if (rscn_id == hba_id) {
92d7f7b0cde3ad2 James Smart 2007-06-17 7637 /* ALL NPortIDs in RSCN are on HBA */
e8b62011d88d6fd James Smart 2007-08-02 7638 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
d7c255b26d8e3f1 James Smart 2008-08-24 7639 "0219 Ignore RSCN "
e8b62011d88d6fd James Smart 2007-08-02 7640 "Data: x%x x%x x%x x%x\n",
e8b62011d88d6fd James Smart 2007-08-02 7641 vport->fc_flag, payload_len,
7f5f3d0d02aa2f1 James Smart 2008-02-08 7642 *lp, vport->fc_rscn_id_cnt);
858c9f6c19c6f9b James Smart 2007-06-17 7643 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
858c9f6c19c6f9b James Smart 2007-06-17 7644 "RCV RSCN vport: did:x%x/ste:x%x flg:x%x",
858c9f6c19c6f9b James Smart 2007-06-17 7645 ndlp->nlp_DID, vport->port_state,
858c9f6c19c6f9b James Smart 2007-06-17 7646 ndlp->nlp_flag);
858c9f6c19c6f9b James Smart 2007-06-17 7647
92d7f7b0cde3ad2 James Smart 2007-06-17 7648 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb,
51ef4c26891a734 James Smart 2007-08-02 7649 ndlp, NULL);
92d7f7b0cde3ad2 James Smart 2007-06-17 7650 return 0;
92d7f7b0cde3ad2 James Smart 2007-06-17 7651 }
92d7f7b0cde3ad2 James Smart 2007-06-17 7652 }
92d7f7b0cde3ad2 James Smart 2007-06-17 7653
7f5f3d0d02aa2f1 James Smart 2008-02-08 7654 spin_lock_irq(shost->host_lock);
7f5f3d0d02aa2f1 James Smart 2008-02-08 7655 if (vport->fc_rscn_flush) {
7f5f3d0d02aa2f1 James Smart 2008-02-08 7656 /* Another thread is walking fc_rscn_id_list on this vport */
7f5f3d0d02aa2f1 James Smart 2008-02-08 7657 vport->fc_flag |= FC_RSCN_DISCOVERY;
979572447686006 James Smart 2009-12-21 7658 spin_unlock_irq(shost->host_lock);
58da1ffb2b1234e James Smart 2008-04-07 7659 /* Send back ACC */
58da1ffb2b1234e James Smart 2008-04-07 7660 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
7f5f3d0d02aa2f1 James Smart 2008-02-08 7661 return 0;
7f5f3d0d02aa2f1 James Smart 2008-02-08 7662 }
7f5f3d0d02aa2f1 James Smart 2008-02-08 7663 /* Indicate we are walking fc_rscn_id_list on this vport */
7f5f3d0d02aa2f1 James Smart 2008-02-08 7664 vport->fc_rscn_flush = 1;
7f5f3d0d02aa2f1 James Smart 2008-02-08 7665 spin_unlock_irq(shost->host_lock);
af901ca181d92aa André Goddard Rosa 2009-11-14 7666 /* Get the array count after successfully have the token */
7f5f3d0d02aa2f1 James Smart 2008-02-08 7667 rscn_cnt = vport->fc_rscn_id_cnt;
dea3101e0a5c897 James Bottomley 2005-04-17 7668 /* If we are already processing an RSCN, save the received
dea3101e0a5c897 James Bottomley 2005-04-17 7669 * RSCN payload buffer, cmdiocb->context2 to process later.
dea3101e0a5c897 James Bottomley 2005-04-17 7670 */
2e0fef85e098f67 James Smart 2007-06-17 7671 if (vport->fc_flag & (FC_RSCN_MODE | FC_NDISC_ACTIVE)) {
858c9f6c19c6f9b James Smart 2007-06-17 7672 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
858c9f6c19c6f9b James Smart 2007-06-17 7673 "RCV RSCN defer: did:x%x/ste:x%x flg:x%x",
858c9f6c19c6f9b James Smart 2007-06-17 7674 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
858c9f6c19c6f9b James Smart 2007-06-17 7675
0937282036d9ae7 James Smart 2008-01-11 7676 spin_lock_irq(shost->host_lock);
92d7f7b0cde3ad2 James Smart 2007-06-17 7677 vport->fc_flag |= FC_RSCN_DEFERRED;
2332e6e475b016e James Smart 2019-11-04 7678
2332e6e475b016e James Smart 2019-11-04 7679 /* Restart disctmo if its already running */
2332e6e475b016e James Smart 2019-11-04 7680 if (vport->fc_flag & FC_DISC_TMO) {
2332e6e475b016e James Smart 2019-11-04 7681 tmo = ((phba->fc_ratov * 3) + 3);
2332e6e475b016e James Smart 2019-11-04 7682 mod_timer(&vport->fc_disctmo,
2332e6e475b016e James Smart 2019-11-04 7683 jiffies + msecs_to_jiffies(1000 * tmo));
2332e6e475b016e James Smart 2019-11-04 7684 }
92d7f7b0cde3ad2 James Smart 2007-06-17 7685 if ((rscn_cnt < FC_MAX_HOLD_RSCN) &&
2e0fef85e098f67 James Smart 2007-06-17 7686 !(vport->fc_flag & FC_RSCN_DISCOVERY)) {
2e0fef85e098f67 James Smart 2007-06-17 7687 vport->fc_flag |= FC_RSCN_MODE;
2e0fef85e098f67 James Smart 2007-06-17 7688 spin_unlock_irq(shost->host_lock);
92d7f7b0cde3ad2 James Smart 2007-06-17 7689 if (rscn_cnt) {
92d7f7b0cde3ad2 James Smart 2007-06-17 7690 cmd = vport->fc_rscn_id_list[rscn_cnt-1]->virt;
92d7f7b0cde3ad2 James Smart 2007-06-17 7691 length = be32_to_cpu(*cmd & ~ELS_CMD_MASK);
92d7f7b0cde3ad2 James Smart 2007-06-17 7692 }
92d7f7b0cde3ad2 James Smart 2007-06-17 7693 if ((rscn_cnt) &&
92d7f7b0cde3ad2 James Smart 2007-06-17 7694 (payload_len + length <= LPFC_BPL_SIZE)) {
92d7f7b0cde3ad2 James Smart 2007-06-17 7695 *cmd &= ELS_CMD_MASK;
7f5f3d0d02aa2f1 James Smart 2008-02-08 @7696 *cmd |= cpu_to_be32(payload_len + length);
92d7f7b0cde3ad2 James Smart 2007-06-17 7697 memcpy(((uint8_t *)cmd) + length, lp,
92d7f7b0cde3ad2 James Smart 2007-06-17 7698 payload_len);
92d7f7b0cde3ad2 James Smart 2007-06-17 7699 } else {
92d7f7b0cde3ad2 James Smart 2007-06-17 7700 vport->fc_rscn_id_list[rscn_cnt] = pcmd;
92d7f7b0cde3ad2 James Smart 2007-06-17 7701 vport->fc_rscn_id_cnt++;
dea3101e0a5c897 James Bottomley 2005-04-17 7702 /* If we zero, cmdiocb->context2, the calling
dea3101e0a5c897 James Bottomley 2005-04-17 7703 * routine will not try to free it.
dea3101e0a5c897 James Bottomley 2005-04-17 7704 */
dea3101e0a5c897 James Bottomley 2005-04-17 7705 cmdiocb->context2 = NULL;
92d7f7b0cde3ad2 James Smart 2007-06-17 7706 }
dea3101e0a5c897 James Bottomley 2005-04-17 7707 /* Deferred RSCN */
e8b62011d88d6fd James Smart 2007-08-02 7708 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
e8b62011d88d6fd James Smart 2007-08-02 7709 "0235 Deferred RSCN "
dea3101e0a5c897 James Bottomley 2005-04-17 7710 "Data: x%x x%x x%x\n",
92d7f7b0cde3ad2 James Smart 2007-06-17 7711 vport->fc_rscn_id_cnt, vport->fc_flag,
2e0fef85e098f67 James Smart 2007-06-17 7712 vport->port_state);
dea3101e0a5c897 James Bottomley 2005-04-17 7713 } else {
2e0fef85e098f67 James Smart 2007-06-17 7714 vport->fc_flag |= FC_RSCN_DISCOVERY;
2e0fef85e098f67 James Smart 2007-06-17 7715 spin_unlock_irq(shost->host_lock);
dea3101e0a5c897 James Bottomley 2005-04-17 7716 /* ReDiscovery RSCN */
e8b62011d88d6fd James Smart 2007-08-02 7717 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
e8b62011d88d6fd James Smart 2007-08-02 7718 "0234 ReDiscovery RSCN "
dea3101e0a5c897 James Bottomley 2005-04-17 7719 "Data: x%x x%x x%x\n",
92d7f7b0cde3ad2 James Smart 2007-06-17 7720 vport->fc_rscn_id_cnt, vport->fc_flag,
2e0fef85e098f67 James Smart 2007-06-17 7721 vport->port_state);
dea3101e0a5c897 James Bottomley 2005-04-17 7722 }
7f5f3d0d02aa2f1 James Smart 2008-02-08 7723 /* Indicate we are done walking fc_rscn_id_list on this vport */
7f5f3d0d02aa2f1 James Smart 2008-02-08 7724 vport->fc_rscn_flush = 0;
dea3101e0a5c897 James Bottomley 2005-04-17 7725 /* Send back ACC */
51ef4c26891a734 James Smart 2007-08-02 7726 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
dea3101e0a5c897 James Bottomley 2005-04-17 7727 /* send RECOVERY event for ALL nodes that match RSCN payload */
2e0fef85e098f67 James Smart 2007-06-17 7728 lpfc_rscn_recovery_check(vport);
c9f8735beadfba4 Jamie Wellnitz 2006-02-28 7729 return 0;
dea3101e0a5c897 James Bottomley 2005-04-17 7730 }
858c9f6c19c6f9b James Smart 2007-06-17 7731 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
858c9f6c19c6f9b James Smart 2007-06-17 7732 "RCV RSCN: did:x%x/ste:x%x flg:x%x",
858c9f6c19c6f9b James Smart 2007-06-17 7733 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
858c9f6c19c6f9b James Smart 2007-06-17 7734
2e0fef85e098f67 James Smart 2007-06-17 7735 spin_lock_irq(shost->host_lock);
2e0fef85e098f67 James Smart 2007-06-17 7736 vport->fc_flag |= FC_RSCN_MODE;
2e0fef85e098f67 James Smart 2007-06-17 7737 spin_unlock_irq(shost->host_lock);
2e0fef85e098f67 James Smart 2007-06-17 7738 vport->fc_rscn_id_list[vport->fc_rscn_id_cnt++] = pcmd;
7f5f3d0d02aa2f1 James Smart 2008-02-08 7739 /* Indicate we are done walking fc_rscn_id_list on this vport */
7f5f3d0d02aa2f1 James Smart 2008-02-08 7740 vport->fc_rscn_flush = 0;
dea3101e0a5c897 James Bottomley 2005-04-17 7741 /*
dea3101e0a5c897 James Bottomley 2005-04-17 7742 * If we zero, cmdiocb->context2, the calling routine will
dea3101e0a5c897 James Bottomley 2005-04-17 7743 * not try to free it.
dea3101e0a5c897 James Bottomley 2005-04-17 7744 */
dea3101e0a5c897 James Bottomley 2005-04-17 7745 cmdiocb->context2 = NULL;
2e0fef85e098f67 James Smart 2007-06-17 7746 lpfc_set_disctmo(vport);
dea3101e0a5c897 James Bottomley 2005-04-17 7747 /* Send back ACC */
51ef4c26891a734 James Smart 2007-08-02 7748 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
dea3101e0a5c897 James Bottomley 2005-04-17 7749 /* send RECOVERY event for ALL nodes that match RSCN payload */
2e0fef85e098f67 James Smart 2007-06-17 7750 lpfc_rscn_recovery_check(vport);
2e0fef85e098f67 James Smart 2007-06-17 7751 return lpfc_els_handle_rscn(vport);
dea3101e0a5c897 James Bottomley 2005-04-17 7752 }
dea3101e0a5c897 James Bottomley 2005-04-17 7753
:::::: The code at line 7696 was first introduced by commit
:::::: 7f5f3d0d02aa2f124e764aee5c775589ce72fd42 [SCSI] lpfc 8.2.5 : Miscellaneous discovery Fixes
:::::: TO: James Smart <James.Smart(a)Emulex.Com>
:::::: CC: James Bottomley <James.Bottomley(a)HansenPartnership.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 1 week
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c:428:11: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Dennis Li <Dennis.Li(a)amd.com>
CC: Alex Deucher <alexander.deucher(a)amd.com>
CC: Hawking Zhang <Hawking.Zhang(a)amd.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 719fce7539cd3e186598e2aed36325fe892150cf
commit: 0e0036c7d13b945260ff1ce8377eca7ea877c008 drm/amdgpu: fix no full coverage issue for gprs initialization
date: 10 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 10 months ago
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>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/arcturus_ppt.c:
>> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c:1559:4: warning: Variable 'num_of_active_display' is modified but its new value is never used. [unreadVariable]
num_of_active_display++;
^
>> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c:168:9: warning: Uninitialized variable: clk_freq [uninitvar]
return clk_freq * 100;
^
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c:182:9: warning: Uninitialized variable: clk_freq [uninitvar]
return clk_freq * 100;
^
--
In file included from drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/smu7_hwmgr.c:
>> drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c:5514:12: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
size += sprintf(buf + size, "%3d %14s %s: %8d %16d %16d %16d %16d %16dn",
^
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c:5525:12: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
size += sprintf(buf + size, "%3d %16s: %8d %16d %16d ",
^
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c:5530:12: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
size += sprintf(buf + size, "%3d %16s: %8s %16s %16s ",
^
>> drivers/gpu/drm/amd/amdgpu/si.c:2489:7: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
if (!disable_plloff_in_l1) {
^
drivers/gpu/drm/amd/amdgpu/si.c:2453:41: note: 'disable_l1' is assigned value 'false' here.
bool disable_l0s = false, disable_l1 = false, disable_plloff_in_l1 = false;
^
drivers/gpu/drm/amd/amdgpu/si.c:2453:71: note: 'disable_plloff_in_l1' is assigned value 'false' here.
bool disable_l0s = false, disable_l1 = false, disable_plloff_in_l1 = false;
^
drivers/gpu/drm/amd/amdgpu/si.c:2483:6: note: outer condition: !disable_l1
if (!disable_l1) {
^
drivers/gpu/drm/amd/amdgpu/si.c:2489:7: note: identical inner condition: !disable_plloff_in_l1
if (!disable_plloff_in_l1) {
^
vim +428 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c
0e0036c7d13b94 Dennis Li 2021-04-27 411
0e0036c7d13b94 Dennis Li 2021-04-27 412 static void gfx_v9_4_2_log_wave_assignment(struct amdgpu_device *adev, uint32_t *wb_ptr)
0e0036c7d13b94 Dennis Li 2021-04-27 413 {
0e0036c7d13b94 Dennis Li 2021-04-27 414 uint32_t se, cu, simd, wave;
0e0036c7d13b94 Dennis Li 2021-04-27 415 uint32_t offset = 0;
0e0036c7d13b94 Dennis Li 2021-04-27 416 char *str;
0e0036c7d13b94 Dennis Li 2021-04-27 417 int size;
0e0036c7d13b94 Dennis Li 2021-04-27 418
0e0036c7d13b94 Dennis Li 2021-04-27 419 str = kmalloc(256, GFP_KERNEL);
0e0036c7d13b94 Dennis Li 2021-04-27 420 if (!str)
0e0036c7d13b94 Dennis Li 2021-04-27 421 return;
0e0036c7d13b94 Dennis Li 2021-04-27 422
0e0036c7d13b94 Dennis Li 2021-04-27 423 dev_dbg(adev->dev, "wave assignment:\n");
0e0036c7d13b94 Dennis Li 2021-04-27 424
0e0036c7d13b94 Dennis Li 2021-04-27 425 for (se = 0; se < adev->gfx.config.max_shader_engines; se++) {
0e0036c7d13b94 Dennis Li 2021-04-27 426 for (cu = 0; cu < CU_ID_MAX; cu++) {
0e0036c7d13b94 Dennis Li 2021-04-27 427 memset(str, 0, 256);
0e0036c7d13b94 Dennis Li 2021-04-27 @428 size = sprintf(str, "SE[%02d]CU[%02d]: ", se, cu);
0e0036c7d13b94 Dennis Li 2021-04-27 429 for (simd = 0; simd < SIMD_ID_MAX; simd++) {
0e0036c7d13b94 Dennis Li 2021-04-27 430 size += sprintf(str + size, "[");
0e0036c7d13b94 Dennis Li 2021-04-27 431 for (wave = 0; wave < WAVE_ID_MAX; wave++) {
0e0036c7d13b94 Dennis Li 2021-04-27 432 size += sprintf(str + size, "%x", wb_ptr[offset]);
0e0036c7d13b94 Dennis Li 2021-04-27 433 offset++;
0e0036c7d13b94 Dennis Li 2021-04-27 434 }
0e0036c7d13b94 Dennis Li 2021-04-27 435 size += sprintf(str + size, "] ");
0e0036c7d13b94 Dennis Li 2021-04-27 436 }
0e0036c7d13b94 Dennis Li 2021-04-27 437 dev_dbg(adev->dev, "%s\n", str);
0e0036c7d13b94 Dennis Li 2021-04-27 438 }
0e0036c7d13b94 Dennis Li 2021-04-27 439 }
0e0036c7d13b94 Dennis Li 2021-04-27 440
0e0036c7d13b94 Dennis Li 2021-04-27 441 kfree(str);
0e0036c7d13b94 Dennis Li 2021-04-27 442 }
0e0036c7d13b94 Dennis Li 2021-04-27 443
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
5 months, 1 week