[PATCH] hwrng: xiphera-trng: fix platform_no_drv_owner.cocci warnings
by kernel test robot
From: kernel test robot <lkp(a)intel.com>
drivers/char/hw_random/xiphera-trng.c:141:3-8: No need to set .owner here. The core will do it.
Remove .owner field if calls are used which set it automatically
Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
CC: Atte Tommiska <atte.tommiska(a)xiphera.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
url: https://github.com/0day-ci/linux/commits/Atte-Tommiska/hwrng-add-support-...
base: bc752d2f345bf55d71b3422a6a24890ea03168dc
xiphera-trng.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/char/hw_random/xiphera-trng.c
+++ b/drivers/char/hw_random/xiphera-trng.c
@@ -138,7 +138,6 @@ MODULE_DEVICE_TABLE(of, xiphera_trng_of_
static struct platform_driver xiphera_trng_driver = {
.driver = {
.name = "xiphera-trng",
- .owner = THIS_MODULE,
.of_match_table = xiphera_trng_of_match,
},
.probe = xiphera_trng_probe,
2 years, 1 month
include/linux/string.h:377:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
by kernel test robot
Hi Karsten,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7eac66d0456fe12a462e5c14c68e97c7460989da
commit: f3811fd7bc97587b142fed9edf8c726694220cb2 net/smc: send DELETE_LINK, ALL message and wait for send to complete
date: 4 months ago
config: arm-randconfig-r006-20200820 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout f3811fd7bc97587b142fed9edf8c726694220cb2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
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 >>):
net/smc/smc_llc.c: In function 'smc_llc_cli_conf_link':
net/smc/smc_llc.c:754:31: warning: variable 'del_llc' set but not used [-Wunused-but-set-variable]
754 | struct smc_llc_msg_del_link *del_llc;
| ^~~~~~~
net/smc/smc_llc.c: In function 'smc_llc_process_srv_delete_link':
net/smc/smc_llc.c:1301:33: warning: variable 'del_llc_resp' set but not used [-Wunused-but-set-variable]
1301 | struct smc_llc_msg_del_link *del_llc_resp;
| ^~~~~~~~~~~~
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/net/tcp.h:19,
from net/smc/smc_llc.c:13:
net/smc/smc_llc.c: In function 'smc_llc_add_pending_send':
include/linux/compiler.h:350:38: error: call to '__compiletime_assert_240' declared with attribute error: must increase SMC_WR_BUF_SIZE to at least sizeof(struct smc_llc_msg)
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
331 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
net/smc/smc_llc.c:348:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
348 | BUILD_BUG_ON_MSG(
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:350:38: error: call to '__compiletime_assert_241' declared with attribute error: must adapt SMC_WR_TX_SIZE to sizeof(struct smc_llc_msg); if not all smc_wr upper layer protocols use the same message size any more, must start to set link->wr_tx_sges[i].length on each individual smc_wr_tx_send()
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
331 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
net/smc/smc_llc.c:351:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
351 | BUILD_BUG_ON_MSG(
| ^~~~~~~~~~~~~~~~
In file included from include/linux/bitmap.h:9,
from include/linux/nodemask.h:95,
from include/linux/mmzone.h:17,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from include/linux/bvec.h:13,
from include/linux/skbuff.h:17,
from include/linux/tcp.h:17,
from include/net/tcp.h:20,
from net/smc/smc_llc.c:13:
In function 'memcpy',
inlined from 'smc_llc_send_message_wait' at net/smc/smc_llc.c:578:2,
inlined from 'smc_llc_send_link_delete_all' at net/smc/smc_llc.c:1255:8:
>> include/linux/string.h:377:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
377 | __read_overflow2();
| ^~~~~~~~~~~~~~~~~~
# 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 f3811fd7bc97587b142fed9edf8c726694220cb2
vim +/__read_overflow2 +377 include/linux/string.h
6974f0c4555e285 Daniel Micay 2017-07-12 368
6974f0c4555e285 Daniel Micay 2017-07-12 369 __FORTIFY_INLINE void *memcpy(void *p, const void *q, __kernel_size_t size)
6974f0c4555e285 Daniel Micay 2017-07-12 370 {
6974f0c4555e285 Daniel Micay 2017-07-12 371 size_t p_size = __builtin_object_size(p, 0);
6974f0c4555e285 Daniel Micay 2017-07-12 372 size_t q_size = __builtin_object_size(q, 0);
6974f0c4555e285 Daniel Micay 2017-07-12 373 if (__builtin_constant_p(size)) {
6974f0c4555e285 Daniel Micay 2017-07-12 374 if (p_size < size)
6974f0c4555e285 Daniel Micay 2017-07-12 375 __write_overflow();
6974f0c4555e285 Daniel Micay 2017-07-12 376 if (q_size < size)
6974f0c4555e285 Daniel Micay 2017-07-12 @377 __read_overflow2();
6974f0c4555e285 Daniel Micay 2017-07-12 378 }
6974f0c4555e285 Daniel Micay 2017-07-12 379 if (p_size < size || q_size < size)
6974f0c4555e285 Daniel Micay 2017-07-12 380 fortify_panic(__func__);
6974f0c4555e285 Daniel Micay 2017-07-12 381 return __builtin_memcpy(p, q, size);
6974f0c4555e285 Daniel Micay 2017-07-12 382 }
6974f0c4555e285 Daniel Micay 2017-07-12 383
:::::: The code at line 377 was first introduced by commit
:::::: 6974f0c4555e285ab217cee58b6e874f776ff409 include/linux/string.h: add the option of fortified string.h functions
:::::: TO: Daniel Micay <danielmicay(a)gmail.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/firmware/tegra/bpmp-debugfs.c:422:4: warning: 'strncat' output truncated before terminating nul copying as many bytes from a string as its length
by kernel test robot
Hi Jon,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7eac66d0456fe12a462e5c14c68e97c7460989da
commit: 5e37b9c137ee5a3a9dc2815ca51f71746c2609a6 firmware: tegra: Add support for in-band debug
date: 5 weeks ago
config: arm64-randconfig-r012-20200820 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 5e37b9c137ee5a3a9dc2815ca51f71746c2609a6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/firmware/tegra/bpmp-debugfs.c: In function 'bpmp_populate_debugfs_inband':
>> drivers/firmware/tegra/bpmp-debugfs.c:422:4: warning: 'strncat' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
422 | strncat(pathbuf, name, strlen(name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 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 5e37b9c137ee5a3a9dc2815ca51f71746c2609a6
vim +/strncat +422 drivers/firmware/tegra/bpmp-debugfs.c
364
365 static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp,
366 struct dentry *parent,
367 char *ppath)
368 {
369 const size_t pathlen = SZ_256;
370 const size_t bufsize = SZ_16K;
371 uint32_t dsize, attrs = 0;
372 struct dentry *dentry;
373 struct seqbuf seqbuf;
374 char *buf, *pathbuf;
375 const char *name;
376 int err = 0;
377
378 if (!bpmp || !parent || !ppath)
379 return -EINVAL;
380
381 buf = kmalloc(bufsize, GFP_KERNEL);
382 if (!buf)
383 return -ENOMEM;
384
385 pathbuf = kzalloc(pathlen, GFP_KERNEL);
386 if (!pathbuf) {
387 kfree(buf);
388 return -ENOMEM;
389 }
390
391 err = mrq_debug_read(bpmp, ppath, buf, bufsize, &dsize);
392 if (err)
393 goto out;
394
395 seqbuf_init(&seqbuf, buf, dsize);
396
397 while (!seqbuf_eof(&seqbuf)) {
398 err = seqbuf_read_u32(&seqbuf, &attrs);
399 if (err)
400 goto out;
401
402 err = seqbuf_read_str(&seqbuf, &name);
403 if (err < 0)
404 goto out;
405
406 if (attrs & DEBUGFS_S_ISDIR) {
407 size_t len;
408
409 dentry = debugfs_create_dir(name, parent);
410 if (IS_ERR(dentry)) {
411 err = PTR_ERR(dentry);
412 goto out;
413 }
414
415 len = strlen(ppath) + strlen(name) + 1;
416 if (len >= pathlen) {
417 err = -EINVAL;
418 goto out;
419 }
420
421 strncpy(pathbuf, ppath, pathlen);
> 422 strncat(pathbuf, name, strlen(name));
423 strcat(pathbuf, "/");
424
425 err = bpmp_populate_debugfs_inband(bpmp, dentry,
426 pathbuf);
427 if (err < 0)
428 goto out;
429 } else {
430 umode_t mode;
431
432 mode = attrs & DEBUGFS_S_IRUSR ? 0400 : 0;
433 mode |= attrs & DEBUGFS_S_IWUSR ? 0200 : 0;
434 dentry = debugfs_create_file(name, mode, parent, bpmp,
435 &bpmp_debug_fops);
436 if (!dentry) {
437 err = -ENOMEM;
438 goto out;
439 }
440 }
441 }
442
443 out:
444 kfree(pathbuf);
445 kfree(buf);
446
447 return err;
448 }
449
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[mlankhorst:locking-rework 2402/2434] drivers/gpu/drm/qxl/qxl_display.c:189:9: sparse: sparse: macro "DRM_MODESET_LOCK_ALL_END" requires 3 arguments, but only 2 given
by kernel test robot
tree: git://people.freedesktop.org/~mlankhorst/linux locking-rework
head: 40540066096b53fb00aba9eb6151d3f2ffd573ce
commit: 0376d0313d62b1cab545d1a19e7a91c42a19259f [2402/2434] Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm-tip
:::::: branch date: 4 hours ago
:::::: commit date: 34 hours ago
config: x86_64-randconfig-s022-20200819 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-183-gaa6ede3b-dirty
git checkout 0376d0313d62b1cab545d1a19e7a91c42a19259f
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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/gpu/drm/qxl/qxl_display.c:189:9: sparse: sparse: macro "DRM_MODESET_LOCK_ALL_END" requires 3 arguments, but only 2 given
drivers/gpu/drm/qxl/qxl_display.c:434:9: sparse: sparse: macro "DRM_MODESET_LOCK_ALL_END" requires 3 arguments, but only 2 given
drivers/gpu/drm/qxl/qxl_display.c:187:9: sparse: sparse: undefined identifier 'drm_drv_uses_atomic_modeset'
>> drivers/gpu/drm/qxl/qxl_display.c:187:9: sparse: sparse: label 'modeset_lock_fail' was not declared
drivers/gpu/drm/qxl/qxl_display.c:189:9: sparse: sparse: undefined identifier 'DRM_MODESET_LOCK_ALL_END'
drivers/gpu/drm/qxl/qxl_display.c:411:9: sparse: sparse: undefined identifier 'drm_drv_uses_atomic_modeset'
drivers/gpu/drm/qxl/qxl_display.c:411:9: sparse: sparse: label 'modeset_lock_fail' was not declared
drivers/gpu/drm/qxl/qxl_display.c:434:9: sparse: sparse: undefined identifier 'DRM_MODESET_LOCK_ALL_END'
git remote add mlankhorst git://people.freedesktop.org/~mlankhorst/linux
git fetch --no-tags mlankhorst locking-rework
git checkout 0376d0313d62b1cab545d1a19e7a91c42a19259f
vim +/DRM_MODESET_LOCK_ALL_END +189 drivers/gpu/drm/qxl/qxl_display.c
7dea0941f8806e Dave Airlie 2014-10-28 161
f64122c1f6ade3 Dave Airlie 2013-02-25 162 void qxl_display_read_client_monitors_config(struct qxl_device *qdev)
f64122c1f6ade3 Dave Airlie 2013-02-25 163 {
cbdded7f8a633e Gabriel Krisman Bertazi 2017-01-26 164 struct drm_device *dev = &qdev->ddev;
bbaac1354cc984 Sidong Yang 2020-05-24 165 struct drm_modeset_acquire_ctx ctx;
bbaac1354cc984 Sidong Yang 2020-05-24 166 int status, retries, ret;
9e3b317839298a Christophe Fergeau 2016-11-08 167
9062155de0dfdc Gerd Hoffmann 2017-03-01 168 for (retries = 0; retries < 10; retries++) {
9e3b317839298a Christophe Fergeau 2016-11-08 169 status = qxl_display_copy_rom_client_monitors_config(qdev);
9062155de0dfdc Gerd Hoffmann 2017-03-01 170 if (status != MONITORS_CONFIG_BAD_CRC)
9062155de0dfdc Gerd Hoffmann 2017-03-01 171 break;
9062155de0dfdc Gerd Hoffmann 2017-03-01 172 udelay(5);
9062155de0dfdc Gerd Hoffmann 2017-03-01 173 }
66e0c8a5bcfd29 Anton Vasilyev 2018-07-27 174 if (status == MONITORS_CONFIG_ERROR) {
66e0c8a5bcfd29 Anton Vasilyev 2018-07-27 175 DRM_DEBUG_KMS("ignoring client monitors config: error");
66e0c8a5bcfd29 Anton Vasilyev 2018-07-27 176 return;
66e0c8a5bcfd29 Anton Vasilyev 2018-07-27 177 }
9062155de0dfdc Gerd Hoffmann 2017-03-01 178 if (status == MONITORS_CONFIG_BAD_CRC) {
9062155de0dfdc Gerd Hoffmann 2017-03-01 179 DRM_DEBUG_KMS("ignoring client monitors config: bad crc");
9062155de0dfdc Gerd Hoffmann 2017-03-01 180 return;
9e3b317839298a Christophe Fergeau 2016-11-08 181 }
9e3b317839298a Christophe Fergeau 2016-11-08 182 if (status == MONITORS_CONFIG_UNCHANGED) {
9062155de0dfdc Gerd Hoffmann 2017-03-01 183 DRM_DEBUG_KMS("ignoring client monitors config: unchanged");
9e3b317839298a Christophe Fergeau 2016-11-08 184 return;
f64122c1f6ade3 Dave Airlie 2013-02-25 185 }
4fdb086924db46 Marc-André Lureau 2013-10-18 186
bbaac1354cc984 Sidong Yang 2020-05-24 @187 DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret);
7dea0941f8806e Dave Airlie 2014-10-28 188 qxl_update_offset_props(qdev);
bbaac1354cc984 Sidong Yang 2020-05-24 @189 DRM_MODESET_LOCK_ALL_END(ctx, ret);
cbdded7f8a633e Gabriel Krisman Bertazi 2017-01-26 190 if (!drm_helper_hpd_irq_event(dev)) {
4fdb086924db46 Marc-André Lureau 2013-10-18 191 /* notify that the monitor configuration changed, to
4fdb086924db46 Marc-André Lureau 2013-10-18 192 adjust at the arbitrary resolution */
cbdded7f8a633e Gabriel Krisman Bertazi 2017-01-26 193 drm_kms_helper_hotplug_event(dev);
4fdb086924db46 Marc-André Lureau 2013-10-18 194 }
f64122c1f6ade3 Dave Airlie 2013-02-25 195 }
f64122c1f6ade3 Dave Airlie 2013-02-25 196
:::::: The code at line 189 was first introduced by commit
:::::: bbaac1354cc98415e5b4c3830d796c583ca71907 drm/qxl: Replace deprecated function in qxl_display
:::::: TO: Sidong Yang <realwakka(a)gmail.com>
:::::: CC: Gerd Hoffmann <kraxel(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/gpu/drm/ast/ast_cursor.c:250:26: sparse: sparse: multiple address spaces given: __iomem & __iomem
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 06a4ec1d9dc652e17ee3ac2ceb6c7cf6c2b75cdd
commit: 0d384eec10ea723f39df9736a04966e047850cfb drm/ast: Keep cursor HW BOs mapped
date: 6 weeks ago
:::::: branch date: 16 hours ago
:::::: commit date: 6 weeks ago
config: i386-randconfig-s002-20200818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-183-gaa6ede3b-dirty
git checkout 0d384eec10ea723f39df9736a04966e047850cfb
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/ast/ast_cursor.c:250:26: sparse: sparse: duplicate [noderef]
>> drivers/gpu/drm/ast/ast_cursor.c:250:26: sparse: sparse: multiple address spaces given: __iomem & __iomem
# 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 0d384eec10ea723f39df9736a04966e047850cfb
vim +250 drivers/gpu/drm/ast/ast_cursor.c
81039adc92cd7a Thomas Zimmermann 2020-07-02 245
0d384eec10ea72 Thomas Zimmermann 2020-07-02 246 void ast_cursor_show(struct ast_private *ast, int x, int y,
81039adc92cd7a Thomas Zimmermann 2020-07-02 247 unsigned int offset_x, unsigned int offset_y)
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 248 {
81039adc92cd7a Thomas Zimmermann 2020-07-02 249 u8 x_offset, y_offset;
0d384eec10ea72 Thomas Zimmermann 2020-07-02 @250 u8 __iomem *dst, __iomem *sig;
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 251 u8 jreg;
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 252
0d384eec10ea72 Thomas Zimmermann 2020-07-02 253 dst = ast->cursor.vaddr[ast->cursor.next_index];
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 254
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 255 sig = dst + AST_HWC_SIZE;
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 256 writel(x, sig + AST_HWC_SIGNATURE_X);
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 257 writel(y, sig + AST_HWC_SIGNATURE_Y);
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 258
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 259 if (x < 0) {
81039adc92cd7a Thomas Zimmermann 2020-07-02 260 x_offset = (-x) + offset_x;
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 261 x = 0;
81039adc92cd7a Thomas Zimmermann 2020-07-02 262 } else {
81039adc92cd7a Thomas Zimmermann 2020-07-02 263 x_offset = offset_x;
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 264 }
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 265 if (y < 0) {
81039adc92cd7a Thomas Zimmermann 2020-07-02 266 y_offset = (-y) + offset_y;
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 267 y = 0;
81039adc92cd7a Thomas Zimmermann 2020-07-02 268 } else {
81039adc92cd7a Thomas Zimmermann 2020-07-02 269 y_offset = offset_y;
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 270 }
81039adc92cd7a Thomas Zimmermann 2020-07-02 271
81039adc92cd7a Thomas Zimmermann 2020-07-02 272 ast_cursor_set_location(ast, x, y, x_offset, y_offset);
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 273
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 274 /* dummy write to fire HWC */
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 275 jreg = 0x02 |
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 276 0x01; /* enable ARGB4444 cursor */
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 277 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xcb, 0xfc, jreg);
2ccebf561e4a90 Thomas Zimmermann 2020-07-02 278 }
c91eadd110463f Thomas Zimmermann 2020-07-02 279
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[linux-next:master 1967/2546] drivers/staging/hikey9xx/hisi-spmi-controller.c:183:24: sparse: sparse: cast to restricted __be32
by kernel test robot
Hi Mauro,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 605cbf3d5f20470ec303b79feda3202935f4a142
commit: 1747938a37d1dfa9faa397507f88627158b3d806 [1967/2546] staging: spmi: hisi-spmi-controller: add it to the building system
config: h8300-randconfig-s032-20200820 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.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.2-191-g10164920-dirty
git checkout 1747938a37d1dfa9faa397507f88627158b3d806
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=h8300
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/staging/hikey9xx/hisi-spmi-controller.c:183:24: sparse: sparse: cast to restricted __be32
>> drivers/staging/hikey9xx/hisi-spmi-controller.c:257:25: sparse: sparse: cast from restricted __be32
drivers/staging/hikey9xx/hisi-spmi-controller.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
# 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 1747938a37d1dfa9faa397507f88627158b3d806
vim +183 drivers/staging/hikey9xx/hisi-spmi-controller.c
70f59c90c8199e8 Mayulong 2020-08-17 134
70f59c90c8199e8 Mayulong 2020-08-17 135 static int spmi_read_cmd(struct spmi_controller *ctrl,
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 136 u8 opc, u8 sid, u16 addr, u8 *__buf, size_t bc)
70f59c90c8199e8 Mayulong 2020-08-17 137 {
70f59c90c8199e8 Mayulong 2020-08-17 138 struct spmi_controller_dev *spmi_controller = dev_get_drvdata(&ctrl->dev);
70f59c90c8199e8 Mayulong 2020-08-17 139 unsigned long flags;
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 140 u8 *buf = __buf;
70f59c90c8199e8 Mayulong 2020-08-17 141 u32 cmd, data;
70f59c90c8199e8 Mayulong 2020-08-17 142 int rc;
70f59c90c8199e8 Mayulong 2020-08-17 143 u32 chnl_ofst = SPMI_CHANNEL_OFFSET * spmi_controller->channel;
70f59c90c8199e8 Mayulong 2020-08-17 144 u8 op_code, i;
70f59c90c8199e8 Mayulong 2020-08-17 145
70f59c90c8199e8 Mayulong 2020-08-17 146 if (bc > SPMI_CONTROLLER_MAX_TRANS_BYTES) {
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 147 dev_err(&ctrl->dev,
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 148 "spmi_controller supports 1..%d bytes per trans, but:%ld requested",
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 149 SPMI_CONTROLLER_MAX_TRANS_BYTES, bc);
70f59c90c8199e8 Mayulong 2020-08-17 150 return -EINVAL;
70f59c90c8199e8 Mayulong 2020-08-17 151 }
70f59c90c8199e8 Mayulong 2020-08-17 152
70f59c90c8199e8 Mayulong 2020-08-17 153 /* Check the opcode */
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 154 if (opc == SPMI_CMD_READ) {
70f59c90c8199e8 Mayulong 2020-08-17 155 op_code = SPMI_CMD_REG_READ;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 156 } else if (opc == SPMI_CMD_EXT_READ) {
70f59c90c8199e8 Mayulong 2020-08-17 157 op_code = SPMI_CMD_EXT_REG_READ;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 158 } else if (opc == SPMI_CMD_EXT_READL) {
70f59c90c8199e8 Mayulong 2020-08-17 159 op_code = SPMI_CMD_EXT_REG_READ_L;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 160 } else {
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 161 dev_err(&ctrl->dev, "invalid read cmd 0x%x", opc);
70f59c90c8199e8 Mayulong 2020-08-17 162 return -EINVAL;
70f59c90c8199e8 Mayulong 2020-08-17 163 }
70f59c90c8199e8 Mayulong 2020-08-17 164
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 165 cmd = SPMI_APB_SPMI_CMD_EN |
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 166 (op_code << SPMI_APB_SPMI_CMD_TYPE_OFFSET) |
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 167 ((bc - 1) << SPMI_APB_SPMI_CMD_LENGTH_OFFSET) |
70f59c90c8199e8 Mayulong 2020-08-17 168 ((sid & 0xf) << SPMI_APB_SPMI_CMD_SLAVEID_OFFSET) | /* slvid */
70f59c90c8199e8 Mayulong 2020-08-17 169 ((addr & 0xffff) << SPMI_APB_SPMI_CMD_ADDR_OFFSET); /* slave_addr */
70f59c90c8199e8 Mayulong 2020-08-17 170
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 171 spin_lock_irqsave(&spmi_controller->lock, flags);
70f59c90c8199e8 Mayulong 2020-08-17 172
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 173 writel(cmd, spmi_controller->base + chnl_ofst + SPMI_APB_SPMI_CMD_BASE_ADDR);
70f59c90c8199e8 Mayulong 2020-08-17 174
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 175 rc = spmi_controller_wait_for_done(&ctrl->dev, spmi_controller,
8788a30c12c7884 Mauro Carvalho Chehab 2020-08-17 176 spmi_controller->base, sid, addr);
70f59c90c8199e8 Mayulong 2020-08-17 177 if (rc)
70f59c90c8199e8 Mayulong 2020-08-17 178 goto done;
70f59c90c8199e8 Mayulong 2020-08-17 179
70f59c90c8199e8 Mayulong 2020-08-17 180 i = 0;
70f59c90c8199e8 Mayulong 2020-08-17 181 do {
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 182 data = readl(spmi_controller->base + chnl_ofst + SPMI_SLAVE_OFFSET * sid + SPMI_APB_SPMI_RDATA0_BASE_ADDR + i * SPMI_PER_DATAREG_BYTE);
8788a30c12c7884 Mauro Carvalho Chehab 2020-08-17 @183 data = be32_to_cpu((__be32)data);
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 184 if ((bc - i * SPMI_PER_DATAREG_BYTE) >> 2) {
70f59c90c8199e8 Mayulong 2020-08-17 185 memcpy(buf, &data, sizeof(data));
70f59c90c8199e8 Mayulong 2020-08-17 186 buf += sizeof(data);
70f59c90c8199e8 Mayulong 2020-08-17 187 } else {
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 188 memcpy(buf, &data, bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 Mayulong 2020-08-17 189 buf += (bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 Mayulong 2020-08-17 190 }
70f59c90c8199e8 Mayulong 2020-08-17 191 i++;
70f59c90c8199e8 Mayulong 2020-08-17 192 } while (bc > i * SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 Mayulong 2020-08-17 193
70f59c90c8199e8 Mayulong 2020-08-17 194 done:
70f59c90c8199e8 Mayulong 2020-08-17 195 spin_unlock_irqrestore(&spmi_controller->lock, flags);
70f59c90c8199e8 Mayulong 2020-08-17 196 if (rc)
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 197 dev_err(&ctrl->dev,
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 198 "spmi read wait timeout op:0x%x sid:%d addr:0x%x bc:%ld\n",
70f59c90c8199e8 Mayulong 2020-08-17 199 opc, sid, addr, bc + 1);
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 200 else
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 201 dev_dbg(&ctrl->dev, "%s: id:%d addr:0x%x, read value: %*ph\n",
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 202 __func__, sid, addr, (int)bc, __buf);
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 203
70f59c90c8199e8 Mayulong 2020-08-17 204 return rc;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 205 }
70f59c90c8199e8 Mayulong 2020-08-17 206
70f59c90c8199e8 Mayulong 2020-08-17 207 static int spmi_write_cmd(struct spmi_controller *ctrl,
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 208 u8 opc, u8 sid, u16 addr, const u8 *__buf, size_t bc)
70f59c90c8199e8 Mayulong 2020-08-17 209 {
70f59c90c8199e8 Mayulong 2020-08-17 210 struct spmi_controller_dev *spmi_controller = dev_get_drvdata(&ctrl->dev);
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 211 const u8 *buf = __buf;
70f59c90c8199e8 Mayulong 2020-08-17 212 unsigned long flags;
8788a30c12c7884 Mauro Carvalho Chehab 2020-08-17 213 u32 cmd, data;
70f59c90c8199e8 Mayulong 2020-08-17 214 int rc;
70f59c90c8199e8 Mayulong 2020-08-17 215 u32 chnl_ofst = SPMI_CHANNEL_OFFSET * spmi_controller->channel;
70f59c90c8199e8 Mayulong 2020-08-17 216 u8 op_code, i;
70f59c90c8199e8 Mayulong 2020-08-17 217
70f59c90c8199e8 Mayulong 2020-08-17 218 if (bc > SPMI_CONTROLLER_MAX_TRANS_BYTES) {
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 219 dev_err(&ctrl->dev,
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 220 "spmi_controller supports 1..%d bytes per trans, but:%ld requested",
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 221 SPMI_CONTROLLER_MAX_TRANS_BYTES, bc);
70f59c90c8199e8 Mayulong 2020-08-17 222 return -EINVAL;
70f59c90c8199e8 Mayulong 2020-08-17 223 }
70f59c90c8199e8 Mayulong 2020-08-17 224
70f59c90c8199e8 Mayulong 2020-08-17 225 /* Check the opcode */
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 226 if (opc == SPMI_CMD_WRITE) {
70f59c90c8199e8 Mayulong 2020-08-17 227 op_code = SPMI_CMD_REG_WRITE;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 228 } else if (opc == SPMI_CMD_EXT_WRITE) {
70f59c90c8199e8 Mayulong 2020-08-17 229 op_code = SPMI_CMD_EXT_REG_WRITE;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 230 } else if (opc == SPMI_CMD_EXT_WRITEL) {
70f59c90c8199e8 Mayulong 2020-08-17 231 op_code = SPMI_CMD_EXT_REG_WRITE_L;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 232 } else {
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 233 dev_err(&ctrl->dev, "invalid write cmd 0x%x", opc);
70f59c90c8199e8 Mayulong 2020-08-17 234 return -EINVAL;
70f59c90c8199e8 Mayulong 2020-08-17 235 }
70f59c90c8199e8 Mayulong 2020-08-17 236
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 237 cmd = SPMI_APB_SPMI_CMD_EN |
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 238 (op_code << SPMI_APB_SPMI_CMD_TYPE_OFFSET) |
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 239 ((bc - 1) << SPMI_APB_SPMI_CMD_LENGTH_OFFSET) |
70f59c90c8199e8 Mayulong 2020-08-17 240 ((sid & 0xf) << SPMI_APB_SPMI_CMD_SLAVEID_OFFSET) | /* slvid */
70f59c90c8199e8 Mayulong 2020-08-17 241 ((addr & 0xffff) << SPMI_APB_SPMI_CMD_ADDR_OFFSET); /* slave_addr */
70f59c90c8199e8 Mayulong 2020-08-17 242
70f59c90c8199e8 Mayulong 2020-08-17 243 /* Write data to FIFOs */
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 244 spin_lock_irqsave(&spmi_controller->lock, flags);
70f59c90c8199e8 Mayulong 2020-08-17 245
70f59c90c8199e8 Mayulong 2020-08-17 246 i = 0;
70f59c90c8199e8 Mayulong 2020-08-17 247 do {
8788a30c12c7884 Mauro Carvalho Chehab 2020-08-17 248 data = 0;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 249 if ((bc - i * SPMI_PER_DATAREG_BYTE) >> 2) {
70f59c90c8199e8 Mayulong 2020-08-17 250 memcpy(&data, buf, sizeof(data));
70f59c90c8199e8 Mayulong 2020-08-17 251 buf += sizeof(data);
70f59c90c8199e8 Mayulong 2020-08-17 252 } else {
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 253 memcpy(&data, buf, bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 Mayulong 2020-08-17 254 buf += (bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 Mayulong 2020-08-17 255 }
70f59c90c8199e8 Mayulong 2020-08-17 256
8788a30c12c7884 Mauro Carvalho Chehab 2020-08-17 @257 writel((u32)cpu_to_be32(data),
8788a30c12c7884 Mauro Carvalho Chehab 2020-08-17 258 spmi_controller->base + chnl_ofst + SPMI_APB_SPMI_WDATA0_BASE_ADDR + SPMI_PER_DATAREG_BYTE * i);
70f59c90c8199e8 Mayulong 2020-08-17 259 i++;
70f59c90c8199e8 Mayulong 2020-08-17 260 } while (bc > i * SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 Mayulong 2020-08-17 261
70f59c90c8199e8 Mayulong 2020-08-17 262 /* Start the transaction */
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 263 writel(cmd, spmi_controller->base + chnl_ofst + SPMI_APB_SPMI_CMD_BASE_ADDR);
70f59c90c8199e8 Mayulong 2020-08-17 264
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 265 rc = spmi_controller_wait_for_done(&ctrl->dev, spmi_controller,
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 266 spmi_controller->base, sid, addr);
70f59c90c8199e8 Mayulong 2020-08-17 267 spin_unlock_irqrestore(&spmi_controller->lock, flags);
70f59c90c8199e8 Mayulong 2020-08-17 268
70f59c90c8199e8 Mayulong 2020-08-17 269 if (rc)
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 270 dev_err(&ctrl->dev, "spmi write wait timeout op:0x%x sid:%d addr:0x%x bc:%ld\n",
70f59c90c8199e8 Mayulong 2020-08-17 271 opc, sid, addr, bc);
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 272 else
4d914a8c480c312 Mauro Carvalho Chehab 2020-08-17 273 dev_dbg(&ctrl->dev, "%s: id:%d addr:0x%x, wrote value: %*ph\n",
6af364501949d99 Mauro Carvalho Chehab 2020-08-17 274 __func__, sid, addr, (int)bc, __buf);
70f59c90c8199e8 Mayulong 2020-08-17 275
70f59c90c8199e8 Mayulong 2020-08-17 276 return rc;
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 277 }
2ea3f6a03b155f4 Mauro Carvalho Chehab 2020-08-17 278
:::::: The code at line 183 was first introduced by commit
:::::: 8788a30c12c78846c153bea06125296111f53ece staging: spmi: hisi-spmi-controller: use le32 macros where needed
:::::: TO: Mauro Carvalho Chehab <mchehab+huawei(a)kernel.org>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH v32 11/12] LRNG - add interface for gathering of raw entropy
by kernel test robot
Hi "Stephan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on cryptodev/master crypto/master v5.9-rc1 next-20200820]
[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/Stephan-M-ller/dev-random-a-new-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git d162219c655c8cf8003128a13840d6c1e183fb80
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/char/lrng/lrng_testing.c:255:15: warning: initialized field overwritten [-Woverride-init]
255 | .rb_reader = 0,
| ^
drivers/char/lrng/lrng_testing.c:255:15: note: (near initialization for 'lrng_raw_hires.rb_reader')
drivers/char/lrng/lrng_testing.c:295:15: warning: initialized field overwritten [-Woverride-init]
295 | .rb_reader = 0,
| ^
drivers/char/lrng/lrng_testing.c:295:15: note: (near initialization for 'lrng_raw_jiffies.rb_reader')
drivers/char/lrng/lrng_testing.c:336:15: warning: initialized field overwritten [-Woverride-init]
336 | .rb_reader = 0,
| ^
drivers/char/lrng/lrng_testing.c:336:15: note: (near initialization for 'lrng_raw_irq.rb_reader')
drivers/char/lrng/lrng_testing.c:376:15: warning: initialized field overwritten [-Woverride-init]
376 | .rb_reader = 0,
| ^
drivers/char/lrng/lrng_testing.c:376:15: note: (near initialization for 'lrng_raw_irqflags.rb_reader')
drivers/char/lrng/lrng_testing.c:417:15: warning: initialized field overwritten [-Woverride-init]
417 | .rb_reader = 0,
| ^
drivers/char/lrng/lrng_testing.c:417:15: note: (near initialization for 'lrng_raw_retip.rb_reader')
drivers/char/lrng/lrng_testing.c:457:15: warning: initialized field overwritten [-Woverride-init]
457 | .rb_reader = 0,
| ^
drivers/char/lrng/lrng_testing.c:457:15: note: (near initialization for 'lrng_raw_array.rb_reader')
drivers/char/lrng/lrng_testing.c:497:15: warning: initialized field overwritten [-Woverride-init]
497 | .rb_reader = 0,
| ^
drivers/char/lrng/lrng_testing.c:497:15: note: (near initialization for 'lrng_irq_perf.rb_reader')
# https://github.com/0day-ci/linux/commit/89b15c614286cea77d633ade2a9045060...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Stephan-M-ller/dev-random-a-new-approach-with-full-SP800-90B-compliance/20200820-165712
git checkout 89b15c614286cea77d633ade2a9045060a492149
vim +255 drivers/char/lrng/lrng_testing.c
252
253 static struct lrng_testing lrng_raw_hires = {
254 .rb_reader = 0,
> 255 .rb_reader = 0,
256 .lock = __SPIN_LOCK_UNLOCKED(lrng_raw_hires.lock),
257 .read_wait = __WAIT_QUEUE_HEAD_INITIALIZER(lrng_raw_hires.read_wait)
258 };
259
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH v32 07/12] LRNG - add kernel crypto API PRNG extension
by kernel test robot
Hi "Stephan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on cryptodev/master crypto/master v5.9-rc1 next-20200820]
[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/Stephan-M-ller/dev-random-a-new-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git d162219c655c8cf8003128a13840d6c1e183fb80
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/char/lrng/lrng_kcapi.c:295:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
295 | const static struct lrng_crypto_cb lrng_kcapi_crypto_cb = {
| ^~~~~
# https://github.com/0day-ci/linux/commit/808fe83c881534a108058461be3f9a070...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Stephan-M-ller/dev-random-a-new-approach-with-full-SP800-90B-compliance/20200820-165712
git checkout 808fe83c881534a108058461be3f9a0706d0c423
vim +/static +295 drivers/char/lrng/lrng_kcapi.c
294
> 295 const static struct lrng_crypto_cb lrng_kcapi_crypto_cb = {
296 .lrng_drng_name = lrng_kcapi_drng_name,
297 .lrng_hash_name = lrng_kcapi_pool_hash,
298 .lrng_drng_alloc = lrng_kcapi_drng_alloc,
299 .lrng_drng_dealloc = lrng_kcapi_drng_dealloc,
300 .lrng_drng_seed_helper = lrng_kcapi_drng_seed_helper,
301 .lrng_drng_generate_helper = lrng_kcapi_drng_generate_helper,
302 .lrng_hash_alloc = lrng_kcapi_hash_alloc,
303 .lrng_hash_dealloc = lrng_kcapi_hash_dealloc,
304 .lrng_hash_digestsize = lrng_kcapi_hash_digestsize,
305 .lrng_hash_buffer = lrng_kcapi_hash_buffer,
306 };
307
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH v32 01/12] Linux Random Number Generator
by kernel test robot
Hi "Stephan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on cryptodev/master crypto/master v5.9-rc1 next-20200820]
[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/Stephan-M-ller/dev-random-a-new-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git d162219c655c8cf8003128a13840d6c1e183fb80
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/char/lrng/lrng_interfaces.c:120:6: warning: no previous prototype for 'add_hwgenerator_randomness' [-Wmissing-prototypes]
120 | void add_hwgenerator_randomness(const char *buffer, size_t count,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/char/lrng/lrng_interfaces.c:297:6: warning: no previous prototype for 'get_random_bytes_full' [-Wmissing-prototypes]
297 | void get_random_bytes_full(void *buf, int nbytes)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/char/lrng/lrng_interfaces.c:37:18: warning: array 'random_table' assumed to have one element
37 | struct ctl_table random_table[];
| ^~~~~~~~~~~~
# https://github.com/0day-ci/linux/commit/866aae82856f1fba6af5c4b19a3905800...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Stephan-M-ller/dev-random-a-new-approach-with-full-SP800-90B-compliance/20200820-165712
git checkout 866aae82856f1fba6af5c4b19a3905800cab4563
vim +/add_hwgenerator_randomness +120 drivers/char/lrng/lrng_interfaces.c
107
108 /**
109 * add_hwgenerator_randomness() - Interface for in-kernel drivers of true
110 * hardware RNGs.
111 *
112 * Those devices may produce endless random bits and will be throttled
113 * when our pool is full.
114 *
115 * @buffer: buffer holding the entropic data from HW noise sources to be used to
116 * insert into entropy pool.
117 * @count: length of buffer
118 * @entropy_bits: amount of entropy in buffer (value is in bits)
119 */
> 120 void add_hwgenerator_randomness(const char *buffer, size_t count,
121 size_t entropy_bits)
122 {
123 /*
124 * Suspend writing if we are fully loaded with entropy.
125 * We'll be woken up again once below lrng_write_wakeup_thresh,
126 * or when the calling thread is about to terminate.
127 */
128 wait_event_interruptible(lrng_write_wait,
129 lrng_need_entropy() ||
130 lrng_state_exseed_allow(lrng_noise_source_hw) ||
131 kthread_should_stop());
132 lrng_state_exseed_set(lrng_noise_source_hw, false);
133 lrng_pool_lfsr_nonaligned(buffer, count);
134 lrng_pool_add_entropy(entropy_bits);
135 }
136 EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);
137
138 /**
139 * add_bootloader_randomness() - Handle random seed passed by bootloader.
140 *
141 * If the seed is trustworthy, it would be regarded as hardware RNGs. Otherwise
142 * it would be regarded as device data.
143 * The decision is controlled by CONFIG_RANDOM_TRUST_BOOTLOADER.
144 *
145 * @buf: buffer holding the entropic data from HW noise sources to be used to
146 * insert into entropy pool.
147 * @size: length of buffer
148 */
149 void add_bootloader_randomness(const void *buf, unsigned int size)
150 {
151 if (IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER))
152 add_hwgenerator_randomness(buf, size, size * 8);
153 else
154 add_device_randomness(buf, size);
155 }
156 EXPORT_SYMBOL_GPL(add_bootloader_randomness);
157
158 /*
159 * Callback for HID layer -- use the HID event values to stir the entropy pool
160 */
161 void add_input_randomness(unsigned int type, unsigned int code,
162 unsigned int value)
163 {
164 static unsigned char last_value;
165
166 /* ignore autorepeat and the like */
167 if (value == last_value)
168 return;
169
170 last_value = value;
171
172 lrng_pool_lfsr_u32((type << 4) ^ code ^ (code >> 4) ^ value);
173 }
174 EXPORT_SYMBOL_GPL(add_input_randomness);
175
176 /**
177 * add_device_randomness() - Add device- or boot-specific data to the entropy
178 * pool to help initialize it.
179 *
180 * None of this adds any entropy; it is meant to avoid the problem of
181 * the entropy pool having similar initial state across largely
182 * identical devices.
183 *
184 * @buf: buffer holding the entropic data from HW noise sources to be used to
185 * insert into entropy pool.
186 * @size: length of buffer
187 */
188 void add_device_randomness(const void *buf, unsigned int size)
189 {
190 lrng_pool_lfsr_nonaligned((u8 *)buf, size);
191 lrng_pool_lfsr_u32(random_get_entropy());
192 lrng_pool_lfsr_u32(jiffies);
193 }
194 EXPORT_SYMBOL(add_device_randomness);
195
196 #ifdef CONFIG_BLOCK
197 void rand_initialize_disk(struct gendisk *disk) { }
198 void add_disk_randomness(struct gendisk *disk) { }
199 EXPORT_SYMBOL(add_disk_randomness);
200 #endif
201
202 /**
203 * del_random_ready_callback() - Delete a previously registered readiness
204 * callback function.
205 *
206 * @rdy: callback definition that was registered initially
207 */
208 void del_random_ready_callback(struct random_ready_callback *rdy)
209 {
210 unsigned long flags;
211 struct module *owner = NULL;
212
213 spin_lock_irqsave(&lrng_ready_list_lock, flags);
214 if (!list_empty(&rdy->list)) {
215 list_del_init(&rdy->list);
216 owner = rdy->owner;
217 }
218 spin_unlock_irqrestore(&lrng_ready_list_lock, flags);
219
220 module_put(owner);
221 }
222 EXPORT_SYMBOL(del_random_ready_callback);
223
224 /**
225 * add_random_ready_callback() - Add a callback function that will be invoked
226 * when the DRNG is mimimally seeded.
227 *
228 * @rdy: callback definition to be invoked when the LRNG is seeded
229 *
230 * Return:
231 * * 0 if callback is successfully added
232 * * -EALREADY if pool is already initialised (callback not called)
233 * * -ENOENT if module for callback is not alive
234 */
235 int add_random_ready_callback(struct random_ready_callback *rdy)
236 {
237 struct module *owner;
238 unsigned long flags;
239 int err = -EALREADY;
240
241 if (likely(lrng_state_min_seeded()))
242 return err;
243
244 owner = rdy->owner;
245 if (!try_module_get(owner))
246 return -ENOENT;
247
248 spin_lock_irqsave(&lrng_ready_list_lock, flags);
249 if (lrng_state_min_seeded())
250 goto out;
251
252 owner = NULL;
253
254 list_add(&rdy->list, &lrng_ready_list);
255 err = 0;
256
257 out:
258 spin_unlock_irqrestore(&lrng_ready_list_lock, flags);
259
260 module_put(owner);
261
262 return err;
263 }
264 EXPORT_SYMBOL(add_random_ready_callback);
265
266 /*********************** LRNG kernel output interfaces ************************/
267
268 /**
269 * get_random_bytes() - Provider of cryptographic strong random numbers for
270 * kernel-internal usage.
271 *
272 * This function is appropriate for all in-kernel use cases. However,
273 * it will always use the ChaCha20 DRNG.
274 *
275 * @buf: buffer to store the random bytes
276 * @nbytes: size of the buffer
277 */
278 void get_random_bytes(void *buf, int nbytes)
279 {
280 lrng_drng_get_atomic((u8 *)buf, (u32)nbytes);
281 lrng_debug_report_seedlevel("get_random_bytes");
282 }
283 EXPORT_SYMBOL(get_random_bytes);
284
285 /**
286 * get_random_bytes_full() - Provider of cryptographic strong random numbers
287 * for kernel-internal usage.
288 *
289 * This function is appropriate only for non-atomic use cases as this
290 * function may sleep. Though, it provides access to the full functionality
291 * of LRNG including the switchable DRNG support, that may support other
292 * DRNGs such as the SP800-90A DRBG.
293 *
294 * @buf: buffer to store the random bytes
295 * @nbytes: size of the buffer
296 */
> 297 void get_random_bytes_full(void *buf, int nbytes)
298 {
299 lrng_drng_get_sleep((u8 *)buf, (u32)nbytes);
300 lrng_debug_report_seedlevel("get_random_bytes_full");
301 }
302 EXPORT_SYMBOL(get_random_bytes_full);
303
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month