[skn:for-next/scmi 19/20] drivers/firmware/arm_scmi/clock.c:128:19: sparse: sparse: incorrect type in initializer (different modifiers)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git for-next/scmi
head: 2a3dd29cd558176610c7c9872804465a079b1c8e
commit: f0a2500a2a050ea76fbc16f0b4d22d62f4a7ae05 [19/20] firmware: arm_scmi: Keep the discrete clock rates sorted
config: arm64-randconfig-s032-20200709 (attached as .config)
compiler: aarch64-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-37-gc9676a3b-dirty
git checkout f0a2500a2a050ea76fbc16f0b4d22d62f4a7ae05
# 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=arm64
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/firmware/arm_scmi/clock.c:128:19: sparse: sparse: incorrect type in initializer (different modifiers) @@ expected unsigned long long [usertype] *r1 @@ got void const *_r1 @@
>> drivers/firmware/arm_scmi/clock.c:128:19: sparse: expected unsigned long long [usertype] *r1
>> drivers/firmware/arm_scmi/clock.c:128:19: sparse: got void const *_r1
>> drivers/firmware/arm_scmi/clock.c:128:30: sparse: sparse: incorrect type in initializer (different modifiers) @@ expected unsigned long long [usertype] *r2 @@ got void const *_r2 @@
>> drivers/firmware/arm_scmi/clock.c:128:30: sparse: expected unsigned long long [usertype] *r2
>> drivers/firmware/arm_scmi/clock.c:128:30: sparse: got void const *_r2
vim +128 drivers/firmware/arm_scmi/clock.c
125
126 static int rate_cmp_func(const void *_r1, const void *_r2)
127 {
> 128 u64 *r1 = _r1, *r2 = _r2;
129
130 return r1 - r2;
131 }
132
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[skn:for-next/scmi 19/20] drivers/firmware/arm_scmi/clock.c:128:12: warning: initialization discards 'const' qualifier from pointer target type
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git for-next/scmi
head: 2a3dd29cd558176610c7c9872804465a079b1c8e
commit: f0a2500a2a050ea76fbc16f0b4d22d62f4a7ae05 [19/20] firmware: arm_scmi: Keep the discrete clock rates sorted
config: ia64-randconfig-r031-20200709 (attached as .config)
compiler: ia64-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 f0a2500a2a050ea76fbc16f0b4d22d62f4a7ae05
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/firmware/arm_scmi/clock.c: In function 'rate_cmp_func':
>> drivers/firmware/arm_scmi/clock.c:128:12: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
128 | u64 *r1 = _r1, *r2 = _r2;
| ^~~
drivers/firmware/arm_scmi/clock.c:128:23: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
128 | u64 *r1 = _r1, *r2 = _r2;
| ^~~
vim +/const +128 drivers/firmware/arm_scmi/clock.c
125
126 static int rate_cmp_func(const void *_r1, const void *_r2)
127 {
> 128 u64 *r1 = _r1, *r2 = _r2;
129
130 return r1 - r2;
131 }
132
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [RFC PATCH v1] scsi: ufs: set STATE_ERROR when ufshcd_probe_hba() failed
by kernel test robot
Hi Lee,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on scsi/for-next]
[also build test ERROR on mkp-scsi/for-next v5.8-rc4 next-20200709]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Lee-Sang-Hyun/scsi-ufs-set-STATE...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/async.h:12,
from drivers/scsi/ufs/ufshcd.c:12:
drivers/scsi/ufs/ufshcd.c: In function 'ufshcd_probe_hba':
>> drivers/scsi/ufs/ufshcd.c:7436:43: error: 'flags' undeclared (first use in this function)
7436 | spin_lock_irqsave(hba->host->host_lock, flags);
| ^~~~~
include/linux/typecheck.h:11:9: note: in definition of macro 'typecheck'
11 | typeof(x) __dummy2; \
| ^
include/linux/spinlock.h:383:2: note: in expansion of macro 'raw_spin_lock_irqsave'
383 | raw_spin_lock_irqsave(spinlock_check(lock), flags); \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:7436:3: note: in expansion of macro 'spin_lock_irqsave'
7436 | spin_lock_irqsave(hba->host->host_lock, flags);
| ^~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:7436:43: note: each undeclared identifier is reported only once for each function it appears in
7436 | spin_lock_irqsave(hba->host->host_lock, flags);
| ^~~~~
include/linux/typecheck.h:11:9: note: in definition of macro 'typecheck'
11 | typeof(x) __dummy2; \
| ^
include/linux/spinlock.h:383:2: note: in expansion of macro 'raw_spin_lock_irqsave'
383 | raw_spin_lock_irqsave(spinlock_check(lock), flags); \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:7436:3: note: in expansion of macro 'spin_lock_irqsave'
7436 | spin_lock_irqsave(hba->host->host_lock, flags);
| ^~~~~~~~~~~~~~~~~
include/linux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast
12 | (void)(&__dummy == &__dummy2); \
| ^~
include/linux/spinlock.h:250:3: note: in expansion of macro 'typecheck'
250 | typecheck(unsigned long, flags); \
| ^~~~~~~~~
include/linux/spinlock.h:383:2: note: in expansion of macro 'raw_spin_lock_irqsave'
383 | raw_spin_lock_irqsave(spinlock_check(lock), flags); \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:7436:3: note: in expansion of macro 'spin_lock_irqsave'
7436 | spin_lock_irqsave(hba->host->host_lock, flags);
| ^~~~~~~~~~~~~~~~~
vim +/flags +7436 drivers/scsi/ufs/ufshcd.c
7352
7353 /**
7354 * ufshcd_probe_hba - probe hba to detect device and initialize
7355 * @hba: per-adapter instance
7356 * @async: asynchronous execution or not
7357 *
7358 * Execute link-startup and verify device initialization
7359 */
7360 static int ufshcd_probe_hba(struct ufs_hba *hba, bool async)
7361 {
7362 int ret;
7363 ktime_t start = ktime_get();
7364
7365 ret = ufshcd_link_startup(hba);
7366 if (ret)
7367 goto out;
7368
7369 /* Debug counters initialization */
7370 ufshcd_clear_dbg_ufs_stats(hba);
7371
7372 /* UniPro link is active now */
7373 ufshcd_set_link_active(hba);
7374
7375 /* Verify device initialization by sending NOP OUT UPIU */
7376 ret = ufshcd_verify_dev_init(hba);
7377 if (ret)
7378 goto out;
7379
7380 /* Initiate UFS initialization, and waiting until completion */
7381 ret = ufshcd_complete_dev_init(hba);
7382 if (ret)
7383 goto out;
7384
7385 /*
7386 * Initialize UFS device parameters used by driver, these
7387 * parameters are associated with UFS descriptors.
7388 */
7389 if (async) {
7390 ret = ufshcd_device_params_init(hba);
7391 if (ret)
7392 goto out;
7393 }
7394
7395 ufshcd_tune_unipro_params(hba);
7396
7397 /* UFS device is also active now */
7398 ufshcd_set_ufs_dev_active(hba);
7399 ufshcd_force_reset_auto_bkops(hba);
7400 hba->wlun_dev_clr_ua = true;
7401
7402 /* Gear up to HS gear if supported */
7403 if (hba->max_pwr_info.is_valid) {
7404 /*
7405 * Set the right value to bRefClkFreq before attempting to
7406 * switch to HS gears.
7407 */
7408 if (hba->dev_ref_clk_freq != REF_CLK_FREQ_INVAL)
7409 ufshcd_set_dev_ref_clk(hba);
7410 ret = ufshcd_config_pwr_mode(hba, &hba->max_pwr_info.info);
7411 if (ret) {
7412 dev_err(hba->dev, "%s: Failed setting power mode, err = %d\n",
7413 __func__, ret);
7414 goto out;
7415 }
7416 ufshcd_print_pwr_info(hba);
7417 }
7418
7419 /*
7420 * bActiveICCLevel is volatile for UFS device (as per latest v2.1 spec)
7421 * and for removable UFS card as well, hence always set the parameter.
7422 * Note: Error handler may issue the device reset hence resetting
7423 * bActiveICCLevel as well so it is always safe to set this here.
7424 */
7425 ufshcd_set_active_icc_lvl(hba);
7426
7427 /* set the state as operational after switching to desired gear */
7428 hba->ufshcd_state = UFSHCD_STATE_OPERATIONAL;
7429
7430 ufshcd_wb_config(hba);
7431 /* Enable Auto-Hibernate if configured */
7432 ufshcd_auto_hibern8_enable(hba);
7433
7434 out:
7435 if (ret) {
> 7436 spin_lock_irqsave(hba->host->host_lock, flags);
7437 hba->ufshcd_state = UFSHCD_STATE_ERROR;
7438 spin_unlock_irqrestore(hba->host->host_lock, flags);
7439 }
7440
7441 trace_ufshcd_init(dev_name(hba->dev), ret,
7442 ktime_to_us(ktime_sub(ktime_get(), start)),
7443 hba->curr_dev_pwr_mode, hba->uic_link_state);
7444 return ret;
7445 }
7446
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
fs/orangefs/file.c:424:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0bddd227f3dc55975e2b8dfa7fc6f959b062a2c7
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 3 weeks ago
config: sh-randconfig-s032-20200709 (attached as .config)
compiler: sh4-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-37-gc9676a3b-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# 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=sh
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 >>)
fs/orangefs/file.c:118:32: sparse: sparse: incorrect type in assignment (different base types) @@ expected int open_for_write @@ got restricted fmode_t @@
fs/orangefs/file.c:118:32: sparse: expected int open_for_write
fs/orangefs/file.c:118:32: sparse: got restricted fmode_t
fs/orangefs/file.c:119:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected int open_for_read @@ got restricted fmode_t @@
fs/orangefs/file.c:119:31: sparse: expected int open_for_read
fs/orangefs/file.c:119:31: sparse: got restricted fmode_t
fs/orangefs/file.c:424:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
fs/orangefs/file.c:424:21: sparse: expected int const *__gu_addr
fs/orangefs/file.c:424:21: sparse: got int [noderef] __user *
>> fs/orangefs/file.c:424:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
>> fs/orangefs/file.c:424:21: sparse: expected void const volatile [noderef] __user *
fs/orangefs/file.c:424:21: sparse: got int const *__gu_addr
--
>> net/bluetooth/rfcomm/sock.c:659:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] __user * @@
net/bluetooth/rfcomm/sock.c:659:21: sparse: expected unsigned int const *__gu_addr
>> net/bluetooth/rfcomm/sock.c:659:21: sparse: got unsigned int [noderef] [usertype] __user *
>> net/bluetooth/rfcomm/sock.c:659:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got unsigned int const *__gu_addr @@
>> net/bluetooth/rfcomm/sock.c:659:21: sparse: expected void const volatile [noderef] __user *
net/bluetooth/rfcomm/sock.c:659:21: sparse: got unsigned int const *__gu_addr
net/bluetooth/rfcomm/sock.c:735:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] __user * @@
net/bluetooth/rfcomm/sock.c:735:21: sparse: expected unsigned int const *__gu_addr
net/bluetooth/rfcomm/sock.c:735:21: sparse: got unsigned int [noderef] [usertype] __user *
net/bluetooth/rfcomm/sock.c:735:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got unsigned int const *__gu_addr @@
net/bluetooth/rfcomm/sock.c:735:21: sparse: expected void const volatile [noderef] __user *
net/bluetooth/rfcomm/sock.c:735:21: sparse: got unsigned int const *__gu_addr
>> net/bluetooth/rfcomm/sock.c:767:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/bluetooth/rfcomm/sock.c:767:13: sparse: expected int const *__gu_addr
>> net/bluetooth/rfcomm/sock.c:767:13: sparse: got int [noderef] __user *optlen
>> net/bluetooth/rfcomm/sock.c:767:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/bluetooth/rfcomm/sock.c:767:13: sparse: expected void const volatile [noderef] __user *
net/bluetooth/rfcomm/sock.c:767:13: sparse: got int const *__gu_addr
net/bluetooth/rfcomm/sock.c:845:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/bluetooth/rfcomm/sock.c:845:13: sparse: expected int const *__gu_addr
net/bluetooth/rfcomm/sock.c:845:13: sparse: got int [noderef] __user *optlen
net/bluetooth/rfcomm/sock.c:845:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
net/bluetooth/rfcomm/sock.c:845:13: sparse: expected void const volatile [noderef] __user *
net/bluetooth/rfcomm/sock.c:845:13: sparse: got int const *__gu_addr
--
drivers/rtc/rtc-m41t80.c:736:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
drivers/rtc/rtc-m41t80.c:736:21: sparse: expected int const *__gu_addr
drivers/rtc/rtc-m41t80.c:736:21: sparse: got int [noderef] __user *
>> drivers/rtc/rtc-m41t80.c:736:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user * @@ got int const *__gu_addr @@
>> drivers/rtc/rtc-m41t80.c:736:21: sparse: expected void const volatile [noderef] __user *
drivers/rtc/rtc-m41t80.c:736:21: sparse: got int const *__gu_addr
vim +424 fs/orangefs/file.c
5aca284210ce82 Darrick J. Wong 2019-07-01 393
5db11c21a929cd Mike Marshall 2015-07-17 394 /*
5db11c21a929cd Mike Marshall 2015-07-17 395 * Perform a miscellaneous operation on a file.
5db11c21a929cd Mike Marshall 2015-07-17 396 */
8bb8aefd5afb54 Yi Liu 2015-11-24 397 static long orangefs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
5db11c21a929cd Mike Marshall 2015-07-17 398 {
5aca284210ce82 Darrick J. Wong 2019-07-01 399 struct inode *inode = file_inode(file);
5db11c21a929cd Mike Marshall 2015-07-17 400 int ret = -ENOTTY;
5db11c21a929cd Mike Marshall 2015-07-17 401 __u64 val = 0;
5db11c21a929cd Mike Marshall 2015-07-17 402 unsigned long uval;
5db11c21a929cd Mike Marshall 2015-07-17 403
5db11c21a929cd Mike Marshall 2015-07-17 404 gossip_debug(GOSSIP_FILE_DEBUG,
8bb8aefd5afb54 Yi Liu 2015-11-24 405 "orangefs_ioctl: called with cmd %d\n",
5db11c21a929cd Mike Marshall 2015-07-17 406 cmd);
5db11c21a929cd Mike Marshall 2015-07-17 407
5db11c21a929cd Mike Marshall 2015-07-17 408 /*
5db11c21a929cd Mike Marshall 2015-07-17 409 * we understand some general ioctls on files, such as the immutable
5db11c21a929cd Mike Marshall 2015-07-17 410 * and append flags
5db11c21a929cd Mike Marshall 2015-07-17 411 */
5db11c21a929cd Mike Marshall 2015-07-17 412 if (cmd == FS_IOC_GETFLAGS) {
5aca284210ce82 Darrick J. Wong 2019-07-01 413 ret = orangefs_getflags(inode, &uval);
5aca284210ce82 Darrick J. Wong 2019-07-01 414 if (ret)
5db11c21a929cd Mike Marshall 2015-07-17 415 return ret;
5db11c21a929cd Mike Marshall 2015-07-17 416 gossip_debug(GOSSIP_FILE_DEBUG,
8bb8aefd5afb54 Yi Liu 2015-11-24 417 "orangefs_ioctl: FS_IOC_GETFLAGS: %llu\n",
5db11c21a929cd Mike Marshall 2015-07-17 418 (unsigned long long)uval);
5db11c21a929cd Mike Marshall 2015-07-17 419 return put_user(uval, (int __user *)arg);
5db11c21a929cd Mike Marshall 2015-07-17 420 } else if (cmd == FS_IOC_SETFLAGS) {
5aca284210ce82 Darrick J. Wong 2019-07-01 421 unsigned long old_uval;
5aca284210ce82 Darrick J. Wong 2019-07-01 422
5db11c21a929cd Mike Marshall 2015-07-17 423 ret = 0;
5db11c21a929cd Mike Marshall 2015-07-17 @424 if (get_user(uval, (int __user *)arg))
5db11c21a929cd Mike Marshall 2015-07-17 425 return -EFAULT;
5db11c21a929cd Mike Marshall 2015-07-17 426 /*
8bb8aefd5afb54 Yi Liu 2015-11-24 427 * ORANGEFS_MIRROR_FL is set internally when the mirroring mode
5db11c21a929cd Mike Marshall 2015-07-17 428 * is turned on for a file. The user is not allowed to turn
5db11c21a929cd Mike Marshall 2015-07-17 429 * on this bit, but the bit is present if the user first gets
5db11c21a929cd Mike Marshall 2015-07-17 430 * the flags and then updates the flags with some new
5db11c21a929cd Mike Marshall 2015-07-17 431 * settings. So, we ignore it in the following edit. bligon.
5db11c21a929cd Mike Marshall 2015-07-17 432 */
8bb8aefd5afb54 Yi Liu 2015-11-24 433 if ((uval & ~ORANGEFS_MIRROR_FL) &
5db11c21a929cd Mike Marshall 2015-07-17 434 (~(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NOATIME_FL))) {
8bb8aefd5afb54 Yi Liu 2015-11-24 435 gossip_err("orangefs_ioctl: the FS_IOC_SETFLAGS only supports setting one of FS_IMMUTABLE_FL|FS_APPEND_FL|FS_NOATIME_FL\n");
5db11c21a929cd Mike Marshall 2015-07-17 436 return -EINVAL;
5db11c21a929cd Mike Marshall 2015-07-17 437 }
5aca284210ce82 Darrick J. Wong 2019-07-01 438 ret = orangefs_getflags(inode, &old_uval);
5aca284210ce82 Darrick J. Wong 2019-07-01 439 if (ret)
5aca284210ce82 Darrick J. Wong 2019-07-01 440 return ret;
5aca284210ce82 Darrick J. Wong 2019-07-01 441 ret = vfs_ioc_setflags_prepare(inode, old_uval, uval);
5aca284210ce82 Darrick J. Wong 2019-07-01 442 if (ret)
5aca284210ce82 Darrick J. Wong 2019-07-01 443 return ret;
5db11c21a929cd Mike Marshall 2015-07-17 444 val = uval;
5db11c21a929cd Mike Marshall 2015-07-17 445 gossip_debug(GOSSIP_FILE_DEBUG,
8bb8aefd5afb54 Yi Liu 2015-11-24 446 "orangefs_ioctl: FS_IOC_SETFLAGS: %llu\n",
5db11c21a929cd Mike Marshall 2015-07-17 447 (unsigned long long)val);
5aca284210ce82 Darrick J. Wong 2019-07-01 448 ret = orangefs_inode_setxattr(inode,
5db11c21a929cd Mike Marshall 2015-07-17 449 "user.pvfs2.meta_hint",
555fa0fa618b84 Al Viro 2015-11-11 450 &val, sizeof(val), 0);
5db11c21a929cd Mike Marshall 2015-07-17 451 }
5db11c21a929cd Mike Marshall 2015-07-17 452
5db11c21a929cd Mike Marshall 2015-07-17 453 return ret;
5db11c21a929cd Mike Marshall 2015-07-17 454 }
5db11c21a929cd Mike Marshall 2015-07-17 455
:::::: The code at line 424 was first introduced by commit
:::::: 5db11c21a929cd9d8c0484006efb1014fc723c93 Orangefs: kernel client part 2
:::::: TO: Mike Marshall <hubcap(a)omnibond.com>
:::::: CC: Mike Marshall <hubcap(a)omnibond.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH net-next v2 2/2] net: sched: Lockless Token Bucket (LTB) qdisc
by kernel test robot
Hi Xiangning",
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/YU-Xiangning/Lockless-Token-Buck...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 8cb601f15886f6d05479e46913d954e9ff237312
config: parisc-randconfig-s032-20200709 (attached as .config)
compiler: hppa-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-37-gc9676a3b-dirty
# 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=parisc
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 >>)
>> net/sched/sch_ltb.c:231:35: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
>> net/sched/sch_ltb.c:231:35: sparse: expected void const [noderef] __percpu *__vpp_verify
>> net/sched/sch_ltb.c:231:35: sparse: got struct ltb_pcpu_data *
net/sched/sch_ltb.c:327:35: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:327:35: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:327:35: sparse: got struct ltb_pcpu_data *
>> net/sched/sch_ltb.c:704:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> net/sched/sch_ltb.c:704:17: sparse: struct ltb_class [noderef] __rcu *
>> net/sched/sch_ltb.c:704:17: sparse: struct ltb_class *
net/sched/sch_ltb.c:752:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/sched/sch_ltb.c:752:17: sparse: struct ltb_class [noderef] __rcu *
net/sched/sch_ltb.c:752:17: sparse: struct ltb_class *
net/sched/sch_ltb.c:988:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/sched/sch_ltb.c:988:16: sparse: struct ltb_class [noderef] __rcu *
net/sched/sch_ltb.c:988:16: sparse: struct ltb_class *
net/sched/sch_ltb.c:1000:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:1000:16: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:1000:16: sparse: got struct ltb_pcpu_data *
net/sched/sch_ltb.c:1029:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:1029:16: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:1029:16: sparse: got struct ltb_pcpu_data *
net/sched/sch_ltb.c:1047:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:1047:29: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:1047:29: sparse: got struct ltb_pcpu_data *
net/sched/sch_ltb.c:1072:27: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:1072:27: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:1072:27: sparse: got struct ltb_pcpu_data *
>> net/sched/sch_ltb.c:1080:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got struct ltb_pcpu_data *pcpu_data @@
>> net/sched/sch_ltb.c:1080:24: sparse: expected void [noderef] __percpu *__pdata
>> net/sched/sch_ltb.c:1080:24: sparse: got struct ltb_pcpu_data *pcpu_data
>> net/sched/sch_ltb.c:1122:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ltb_pcpu_data *pcpu_data @@ got struct ltb_pcpu_data [noderef] __percpu * @@
>> net/sched/sch_ltb.c:1122:24: sparse: expected struct ltb_pcpu_data *pcpu_data
>> net/sched/sch_ltb.c:1122:24: sparse: got struct ltb_pcpu_data [noderef] __percpu *
net/sched/sch_ltb.c:1141:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:1141:17: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:1141:17: sparse: got struct ltb_pcpu_data *
net/sched/sch_ltb.c:1142:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:1142:17: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:1142:17: sparse: got struct ltb_pcpu_data *
net/sched/sch_ltb.c:1168:46: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct ltb_pcpu_data * @@
net/sched/sch_ltb.c:1168:46: sparse: expected void const [noderef] __percpu *__vpp_verify
net/sched/sch_ltb.c:1168:46: sparse: got struct ltb_pcpu_data *
net/sched/sch_ltb.c:1176:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got struct ltb_pcpu_data *pcpu_data @@
net/sched/sch_ltb.c:1176:32: sparse: expected void [noderef] __percpu *__pdata
net/sched/sch_ltb.c:1176:32: sparse: got struct ltb_pcpu_data *pcpu_data
vim +231 net/sched/sch_ltb.c
181
182 static int ltb_drain(struct ltb_class *cl)
183 {
184 struct ltb_sched *ltb = qdisc_priv(cl->root_qdisc);
185 struct ltb_pcpu_sched *pcpu_q;
186 bool need_watchdog = false;
187 unsigned int npkts, bytes;
188 unsigned long now = NOW();
189 struct cpumask cpumask;
190 struct sk_buff *skb;
191 s64 timestamp;
192 int cpu;
193
194 npkts = 0;
195 bytes = 0;
196 cpumask_clear(&cpumask);
197 while (kfifo_peek(&cl->drain_queue, &skb) > 0) {
198 int len = qdisc_pkt_len(skb);
199
200 if (cl->curr_interval != now) {
201 cl->curr_interval = now;
202 timestamp = ktime_get_ns();
203 cl->bw_measured = (cl->stat_bytes - cl->last_bytes) *
204 NSEC_PER_SEC / (timestamp - cl->last_timestamp);
205 cl->last_bytes = cl->stat_bytes;
206 cl->last_timestamp = timestamp;
207 cl->bw_used = 0;
208 } else if (len + cl->bw_used > cl->maxbw) {
209 need_watchdog = true;
210 break;
211 }
212 kfifo_skip(&cl->drain_queue);
213 cl->bw_used += len;
214
215 /* Fanout */
216 cpu = ltb_skb_cb(skb)->cpu;
217 ltb_skb_cb(skb)->cpu = 0;
218 if (unlikely(kfifo_put(&cl->fanout_queues[cpu], skb) == 0)) {
219 kfree_skb(skb);
220 atomic64_inc(&cl->stat_drops);
221 } else {
222 /* Account for Generic Segmentation Offload(gso). */
223 cl->stat_bytes += len;
224 cl->stat_packets += skb_is_gso(skb) ?
225 skb_shinfo(skb)->gso_segs : 1;
226 cpumask_set_cpu(cpu, &cpumask);
227 }
228 }
229
230 for_each_cpu(cpu, &cpumask) {
> 231 struct Qdisc *q = per_cpu_ptr(ltb->pcpu_data, cpu)->qdisc;
232
233 pcpu_q = (struct ltb_pcpu_sched *)qdisc_priv(q);
234 if (!(q->state & __QDISC_STATE_SCHED) && !qdisc_is_running(q))
235 irq_work_queue_on(&pcpu_q->fanout_irq_work, cpu);
236 }
237
238 return need_watchdog;
239 }
240
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
drivers/watchdog/wdt_pci.c:103:9: sparse: sparse: cast removes address space '__iomem' of expression
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0bddd227f3dc55975e2b8dfa7fc6f959b062a2c7
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 3 weeks ago
config: riscv-randconfig-s031-20200709 (attached as .config)
compiler: riscv32-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-37-gc9676a3b-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# 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=riscv
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/watchdog/wdt_pci.c:103:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/watchdog/wdt_pci.c:103:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/watchdog/wdt_pci.c:103:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:103:9: sparse: got void *
drivers/watchdog/wdt_pci.c:109:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:109:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:109:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:109:9: sparse: got void *
drivers/watchdog/wdt_pci.c:111:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:111:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:111:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:111:9: sparse: got void *
drivers/watchdog/wdt_pci.c:131:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/watchdog/wdt_pci.c:131:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
>> drivers/watchdog/wdt_pci.c:131:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:131:9: sparse: got void *
drivers/watchdog/wdt_pci.c:135:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:135:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:135:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:135:9: sparse: got void *
drivers/watchdog/wdt_pci.c:137:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:137:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:137:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:137:9: sparse: got void *
drivers/watchdog/wdt_pci.c:139:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:139:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:139:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:139:9: sparse: got void *
drivers/watchdog/wdt_pci.c:141:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:141:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:141:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:141:9: sparse: got void *
drivers/watchdog/wdt_pci.c:143:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:143:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:143:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:143:9: sparse: got void *
drivers/watchdog/wdt_pci.c:145:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:145:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:145:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:145:9: sparse: got void *
drivers/watchdog/wdt_pci.c:147:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:147:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:147:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:147:9: sparse: got void *
drivers/watchdog/wdt_pci.c:158:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:158:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:158:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:158:9: sparse: got void *
drivers/watchdog/wdt_pci.c:177:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:177:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:177:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:177:9: sparse: got void *
drivers/watchdog/wdt_pci.c:197:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:197:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:197:9: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:197:9: sparse: got void *
drivers/watchdog/wdt_pci.c:202:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:202:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:202:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:202:9: sparse: got void *
drivers/watchdog/wdt_pci.c:244:22: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:244:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:244:22: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:244:22: sparse: got void *
drivers/watchdog/wdt_pci.c:279:13: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:279:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:279:13: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:279:13: sparse: got void *
drivers/watchdog/wdt_pci.c:306:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:306:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:306:18: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:306:18: sparse: got void *
drivers/watchdog/wdt_pci.c:313:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/wdt_pci.c:313:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void * @@
drivers/watchdog/wdt_pci.c:313:25: sparse: expected void const volatile [noderef] __iomem *addr
drivers/watchdog/wdt_pci.c:313:25: sparse: got void *
vim +/__iomem +103 drivers/watchdog/wdt_pci.c
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 69
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 70 static int heartbeat = WD_TIMO;
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 71 static int wd_heartbeat;
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 72 module_param(heartbeat, int, 0);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 73 MODULE_PARM_DESC(heartbeat,
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 74 "Watchdog heartbeat in seconds. (0<heartbeat<65536, default="
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 75 __MODULE_STRING(WD_TIMO) ")");
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 76
86a1e1896c2710 drivers/watchdog/wdt_pci.c Wim Van Sebroeck 2012-03-05 77 static bool nowayout = WATCHDOG_NOWAYOUT;
86a1e1896c2710 drivers/watchdog/wdt_pci.c Wim Van Sebroeck 2012-03-05 78 module_param(nowayout, bool, 0);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 79 MODULE_PARM_DESC(nowayout,
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 80 "Watchdog cannot be stopped once started (default="
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 81 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 82
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 83 /* Support for the Fan Tachometer on the PCI-WDT501 */
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 84 static int tachometer;
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 85 module_param(tachometer, int, 0);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 86 MODULE_PARM_DESC(tachometer,
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 87 "PCI-WDT501 Fan Tachometer support (0=disable, default=0)");
9b901ee0cb007e drivers/watchdog/wdt_pci.c Wim Van Sebroeck 2009-06-19 88
9b901ee0cb007e drivers/watchdog/wdt_pci.c Wim Van Sebroeck 2009-06-19 89 static int type = 500;
9b901ee0cb007e drivers/watchdog/wdt_pci.c Wim Van Sebroeck 2009-06-19 90 module_param(type, int, 0);
9b901ee0cb007e drivers/watchdog/wdt_pci.c Wim Van Sebroeck 2009-06-19 91 MODULE_PARM_DESC(type,
9b901ee0cb007e drivers/watchdog/wdt_pci.c Wim Van Sebroeck 2009-06-19 92 "PCI-WDT501 Card type (500 or 501 , default=500)");
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 93
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 94 /*
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 95 * Programming support
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 96 */
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 97
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 98 static void wdtpci_ctr_mode(int ctr, int mode)
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 99 {
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 100 ctr <<= 6;
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 101 ctr |= 0x30;
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 102 ctr |= (mode << 1);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 @103 outb(ctr, WDT_CR);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 104 udelay(8);
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 105 }
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 106
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 107 static void wdtpci_ctr_load(int ctr, int val)
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 108 {
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 109 outb(val & 0xFF, WDT_COUNT0 + ctr);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 110 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 111 outb(val >> 8, WDT_COUNT0 + ctr);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 112 udelay(8);
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 113 }
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 114
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 115 /**
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 116 * wdtpci_start:
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 117 *
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 118 * Start the watchdog driver.
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 119 */
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 120
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 121 static int wdtpci_start(void)
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 122 {
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 123 unsigned long flags;
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 124
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 125 spin_lock_irqsave(&wdtpci_lock, flags);
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 126
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 127 /*
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 128 * "pet" the watchdog, as Access says.
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 129 * This resets the clock outputs.
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 130 */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 @131 inb(WDT_DC); /* Disable watchdog */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 132 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 133 wdtpci_ctr_mode(2, 0); /* Program CTR2 for Mode 0:
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 134 Pulse on Terminal Count */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 135 outb(0, WDT_DC); /* Enable watchdog */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 136 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 137 inb(WDT_DC); /* Disable watchdog */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 138 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 139 outb(0, WDT_CLOCK); /* 2.0833MHz clock */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 140 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 141 inb(WDT_BUZZER); /* disable */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 142 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 143 inb(WDT_OPTONOTRST); /* disable */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 144 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 145 inb(WDT_OPTORST); /* disable */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 146 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 147 inb(WDT_PROGOUT); /* disable */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 148 udelay(8);
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 149 wdtpci_ctr_mode(0, 3); /* Program CTR0 for Mode 3:
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 150 Square Wave Generator */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 151 wdtpci_ctr_mode(1, 2); /* Program CTR1 for Mode 2:
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 152 Rate Generator */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 153 wdtpci_ctr_mode(2, 1); /* Program CTR2 for Mode 1:
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 154 Retriggerable One-Shot */
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 155 wdtpci_ctr_load(0, 20833); /* count at 100Hz */
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 156 wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 157 /* DO NOT LOAD CTR2 on PCI card! -- JPN */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 158 outb(0, WDT_DC); /* Enable watchdog */
9f2d1f0da766f8 drivers/watchdog/wdt_pci.c Alan Cox 2008-08-04 159 udelay(8);
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 160
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 161 spin_unlock_irqrestore(&wdtpci_lock, flags);
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 162 return 0;
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 163 }
^1da177e4c3f41 drivers/char/watchdog/wdt_pci.c Linus Torvalds 2005-04-16 164
:::::: The code at line 103 was first introduced by commit
:::::: 9f2d1f0da766f84fdb96c9bd79ed0f97036635cb wdt: Cleanup and sort out locking and inb_p
:::::: TO: Alan Cox <alan(a)redhat.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, 2 months
Re: [PATCH 3/4] i3c: master: svc: Add Silvaco I3C master driver
by kernel test robot
Hi Miquel,
I love your patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.8-rc4 next-20200709]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Miquel-Raynal/dt-bindings-Add-ve...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386
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/i3c/master/svc-i3c-master.c:189:6: warning: no previous prototype for 'svc_i3c_master_enable_interrupts' [-Wmissing-prototypes]
189 | void svc_i3c_master_enable_interrupts(struct svc_i3c_master *master, u32 mask)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/i3c/master/svc-i3c-master.c:194:6: warning: no previous prototype for 'svc_i3c_master_disable_interrupts' [-Wmissing-prototypes]
194 | void svc_i3c_master_disable_interrupts(struct svc_i3c_master *master)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/i3c/master/svc-i3c-master.c: In function 'svc_i3c_master_bus_init':
drivers/i3c/master/svc-i3c-master.c:456:20: warning: comparison is always false due to limited range of data type [-Wtype-limits]
456 | if (info.dyn_addr < 0)
| ^
drivers/i3c/master/svc-i3c-master.c: In function 'svc_i3c_master_do_daa_locked':
drivers/i3c/master/svc-i3c-master.c:691:21: warning: comparison is always false due to limited range of data type [-Wtype-limits]
691 | if (addrs[dev_nb] < 0)
| ^
vim +/svc_i3c_master_enable_interrupts +189 drivers/i3c/master/svc-i3c-master.c
188
> 189 void svc_i3c_master_enable_interrupts(struct svc_i3c_master *master, u32 mask)
190 {
191 writel(mask, master->regs + SVC_I3C_MINTSET);
192 }
193
> 194 void svc_i3c_master_disable_interrupts(struct svc_i3c_master *master)
195 {
196 u32 mask = readl(master->regs + SVC_I3C_MINTSET);
197
198 writel(mask, master->regs + SVC_I3C_MINTCLR);
199 }
200
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH bpf-next v3 2/4] bpf: Implement bpf_local_storage for inodes
by kernel test robot
Hi KP,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/KP-Singh/Generalizing-bpf_local_...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: mips-allyesconfig (attached as .config)
compiler: mips-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=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> kernel/bpf/bpf_inode_storage.c:274:17: warning: no previous prototype for 'inode_storage_map_alloc' [-Wmissing-prototypes]
274 | struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/bpf_inode_storage.c:286:6: warning: no previous prototype for 'inode_storage_map_free' [-Wmissing-prototypes]
286 | void inode_storage_map_free(struct bpf_map *map)
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/inode_storage_map_alloc +274 kernel/bpf/bpf_inode_storage.c
273
> 274 struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr)
275 {
276 struct bpf_local_storage_map *smap;
277
278 smap = bpf_local_storage_map_alloc(attr);
279 if (IS_ERR(smap))
280 return ERR_CAST(smap);
281
282 smap->cache_idx = cache_idx_get_inode();
283 return &smap->map;
284 }
285
> 286 void inode_storage_map_free(struct bpf_map *map)
287 {
288 struct bpf_local_storage_map *smap;
289
290 smap = (struct bpf_local_storage_map *)map;
291 cache_idx_free_inode(smap->cache_idx);
292 bpf_local_storage_map_free(smap);
293 }
294
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH bpf-next v3 1/4] bpf: Generalize bpf_sk_storage
by kernel test robot
Hi KP,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/KP-Singh/Generalizing-bpf_local_...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> net/core/bpf_sk_storage.c:170:6: warning: no previous prototype for 'bpf_sk_storage_free' [-Wmissing-prototypes]
170 | void bpf_sk_storage_free(struct sock *sk)
| ^~~~~~~~~~~~~~~~~~~
>> net/core/bpf_sk_storage.c:280:5: warning: no previous prototype for 'bpf_sk_storage_clone' [-Wmissing-prototypes]
280 | int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk)
| ^~~~~~~~~~~~~~~~~~~~
>> net/core/bpf_sk_storage.c:401:17: warning: no previous prototype for 'sk_storage_map_alloc' [-Wmissing-prototypes]
401 | struct bpf_map *sk_storage_map_alloc(union bpf_attr *attr)
| ^~~~~~~~~~~~~~~~~~~~
>> net/core/bpf_sk_storage.c:413:6: warning: no previous prototype for 'sk_storage_map_free' [-Wmissing-prototypes]
413 | void sk_storage_map_free(struct bpf_map *map)
| ^~~~~~~~~~~~~~~~~~~
>> net/core/bpf_sk_storage.c:483:6: warning: no previous prototype for 'bpf_sk_storage_diag_free' [-Wmissing-prototypes]
483 | void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag)
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> net/core/bpf_sk_storage.c:511:1: warning: no previous prototype for 'bpf_sk_storage_diag_alloc' [-Wmissing-prototypes]
511 | bpf_sk_storage_diag_alloc(const struct nlattr *nla_stgs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> net/core/bpf_sk_storage.c:658:5: warning: no previous prototype for 'bpf_sk_storage_diag_put' [-Wmissing-prototypes]
658 | int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
| ^~~~~~~~~~~~~~~~~~~~~~~
vim +/bpf_sk_storage_free +170 net/core/bpf_sk_storage.c
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 168
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 169 /* Called by __sk_destruct() & bpf_sk_storage_clone() */
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 @170 void bpf_sk_storage_free(struct sock *sk)
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 171 {
9af362a775d83f KP Singh 2020-07-09 172 struct bpf_local_storage_elem *selem;
9af362a775d83f KP Singh 2020-07-09 173 struct bpf_local_storage *sk_storage;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 174 bool free_sk_storage = false;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 175 struct hlist_node *n;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 176
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 177 rcu_read_lock();
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 178 sk_storage = rcu_dereference(sk->sk_bpf_storage);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 179 if (!sk_storage) {
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 180 rcu_read_unlock();
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 181 return;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 182 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 183
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 184 /* Netiher the bpf_prog nor the bpf-map's syscall
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 185 * could be modifying the sk_storage->list now.
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 186 * Thus, no elem can be added-to or deleted-from the
9af362a775d83f KP Singh 2020-07-09 187 * local_storage->list by the bpf_prog or by the bpf-map's syscall.
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 188 *
9af362a775d83f KP Singh 2020-07-09 189 * It is racing with bpf_local_storage_map_free() alone
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 190 * when unlinking elem from the sk_storage->list and
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 191 * the map's bucket->list.
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 192 */
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 193 raw_spin_lock_bh(&sk_storage->lock);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 194 hlist_for_each_entry_safe(selem, n, &sk_storage->list, snode) {
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 195 /* Always unlink from map before unlinking from
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 196 * sk_storage.
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 197 */
9af362a775d83f KP Singh 2020-07-09 198 bpf_selem_unlink_map(selem);
9af362a775d83f KP Singh 2020-07-09 199 free_sk_storage = bpf_selem_unlink(sk_storage, selem, true);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 200 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 201 raw_spin_unlock_bh(&sk_storage->lock);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 202 rcu_read_unlock();
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 203
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 204 if (free_sk_storage)
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 205 kfree_rcu(sk_storage, rcu);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 206 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 207
9af362a775d83f KP Singh 2020-07-09 208 static void *bpf_sk_storage_lookup_elem(struct bpf_map *map, void *key)
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 209 {
9af362a775d83f KP Singh 2020-07-09 210 struct bpf_local_storage_data *sdata;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 211 struct socket *sock;
9af362a775d83f KP Singh 2020-07-09 212 int fd, err = -EINVAL;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 213
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 214 fd = *(int *)key;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 215 sock = sockfd_lookup(fd, &err);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 216 if (sock) {
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 217 sdata = sk_storage_lookup(sock->sk, map, true);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 218 sockfd_put(sock);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 219 return sdata ? sdata->data : NULL;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 220 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 221
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 222 return ERR_PTR(err);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 223 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 224
9af362a775d83f KP Singh 2020-07-09 225 static int bpf_sk_storage_update_elem(struct bpf_map *map, void *key,
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 226 void *value, u64 map_flags)
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 227 {
9af362a775d83f KP Singh 2020-07-09 228 struct bpf_local_storage_data *sdata;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 229 struct socket *sock;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 230 int fd, err;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 231
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 232 fd = *(int *)key;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 233 sock = sockfd_lookup(fd, &err);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 234 if (sock) {
9af362a775d83f KP Singh 2020-07-09 235 sdata = map->ops->map_local_storage_update(sock->sk, map, value,
9af362a775d83f KP Singh 2020-07-09 236 map_flags);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 237 sockfd_put(sock);
71f150f4c2af5f YueHaibing 2019-04-29 238 return PTR_ERR_OR_ZERO(sdata);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 239 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 240
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 241 return err;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 242 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 243
9af362a775d83f KP Singh 2020-07-09 244 static int bpf_sk_storage_delete_elem(struct bpf_map *map, void *key)
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 245 {
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 246 struct socket *sock;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 247 int fd, err;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 248
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 249 fd = *(int *)key;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 250 sock = sockfd_lookup(fd, &err);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 251 if (sock) {
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 252 err = sk_storage_delete(sock->sk, map);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 253 sockfd_put(sock);
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 254 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 255
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 256 return err;
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 257 }
6ac99e8f23d4b1 Martin KaFai Lau 2019-04-26 258
9af362a775d83f KP Singh 2020-07-09 259 static struct bpf_local_storage_elem *
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 260 bpf_sk_storage_clone_elem(struct sock *newsk,
9af362a775d83f KP Singh 2020-07-09 261 struct bpf_local_storage_map *smap,
9af362a775d83f KP Singh 2020-07-09 262 struct bpf_local_storage_elem *selem)
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 263 {
9af362a775d83f KP Singh 2020-07-09 264 struct bpf_local_storage_elem *copy_selem;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 265
9af362a775d83f KP Singh 2020-07-09 266 copy_selem = sk_selem_alloc(smap, newsk, NULL, true);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 267 if (!copy_selem)
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 268 return NULL;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 269
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 270 if (map_value_has_spin_lock(&smap->map))
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 271 copy_map_value_locked(&smap->map, SDATA(copy_selem)->data,
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 272 SDATA(selem)->data, true);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 273 else
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 274 copy_map_value(&smap->map, SDATA(copy_selem)->data,
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 275 SDATA(selem)->data);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 276
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 277 return copy_selem;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 278 }
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 279
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 @280 int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk)
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 281 {
9af362a775d83f KP Singh 2020-07-09 282 struct bpf_local_storage *new_sk_storage = NULL;
9af362a775d83f KP Singh 2020-07-09 283 struct bpf_local_storage *sk_storage;
9af362a775d83f KP Singh 2020-07-09 284 struct bpf_local_storage_elem *selem;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 285 int ret = 0;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 286
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 287 RCU_INIT_POINTER(newsk->sk_bpf_storage, NULL);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 288
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 289 rcu_read_lock();
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 290 sk_storage = rcu_dereference(sk->sk_bpf_storage);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 291
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 292 if (!sk_storage || hlist_empty(&sk_storage->list))
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 293 goto out;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 294
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 295 hlist_for_each_entry_rcu(selem, &sk_storage->list, snode) {
9af362a775d83f KP Singh 2020-07-09 296 struct bpf_local_storage_elem *copy_selem;
9af362a775d83f KP Singh 2020-07-09 297 struct bpf_local_storage_map *smap;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 298 struct bpf_map *map;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 299
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 300 smap = rcu_dereference(SDATA(selem)->smap);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 301 if (!(smap->map.map_flags & BPF_F_CLONE))
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 302 continue;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 303
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 304 /* Note that for lockless listeners adding new element
9af362a775d83f KP Singh 2020-07-09 305 * here can race with cleanup in bpf_local_storage_map_free.
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 306 * Try to grab map refcnt to make sure that it's still
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 307 * alive and prevent concurrent removal.
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 308 */
1e0bd5a091e5d9 Andrii Nakryiko 2019-11-17 309 map = bpf_map_inc_not_zero(&smap->map);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 310 if (IS_ERR(map))
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 311 continue;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 312
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 313 copy_selem = bpf_sk_storage_clone_elem(newsk, smap, selem);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 314 if (!copy_selem) {
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 315 ret = -ENOMEM;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 316 bpf_map_put(map);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 317 goto out;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 318 }
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 319
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 320 if (new_sk_storage) {
9af362a775d83f KP Singh 2020-07-09 321 bpf_selem_link_map(smap, copy_selem);
9af362a775d83f KP Singh 2020-07-09 322 bpf_selem_link(new_sk_storage, copy_selem);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 323 } else {
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 324 ret = sk_storage_alloc(newsk, smap, copy_selem);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 325 if (ret) {
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 326 kfree(copy_selem);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 327 atomic_sub(smap->elem_size,
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 328 &newsk->sk_omem_alloc);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 329 bpf_map_put(map);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 330 goto out;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 331 }
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 332
9af362a775d83f KP Singh 2020-07-09 333 new_sk_storage =
9af362a775d83f KP Singh 2020-07-09 334 rcu_dereference(copy_selem->local_storage);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 335 }
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 336 bpf_map_put(map);
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 337 }
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 338
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 339 out:
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 340 rcu_read_unlock();
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 341
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 342 /* In case of an error, don't free anything explicitly here, the
9af362a775d83f KP Singh 2020-07-09 343 * caller is responsible to call bpf_local_storage_free.
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 344 */
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 345
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 346 return ret;
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 347 }
8f51dfc73bf181 Stanislav Fomichev 2019-08-14 348
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [RFC PATCH v1] sd: drain a request queue during sd_shutdown()
by kernel test robot
Hi Lee,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on scsi/for-next v5.8-rc4 next-20200708]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Lee-Sang-Hyun/sd-drain-a-request...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/scsi/sd.c: In function 'sd_shutdown':
>> drivers/scsi/sd.c:3567:28: error: 'sdp' undeclared (first use in this function); did you mean 'sdkp'?
3567 | struct request_queue *q = sdp->request_queue;
| ^~~
| sdkp
drivers/scsi/sd.c:3567:28: note: each undeclared identifier is reported only once for each function it appears in
In file included from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/scsi/sd.c:36:
>> drivers/scsi/sd.c:3586:21: error: incompatible type for argument 1 of 'spinlock_check'
3586 | spin_lock_irqsave(q->queue_lock, flags);
| ~^~~~~~~~~~~~
| |
| spinlock_t {aka struct spinlock}
include/linux/spinlock.h:251:34: note: in definition of macro 'raw_spin_lock_irqsave'
251 | flags = _raw_spin_lock_irqsave(lock); \
| ^~~~
drivers/scsi/sd.c:3586:2: note: in expansion of macro 'spin_lock_irqsave'
3586 | spin_lock_irqsave(q->queue_lock, flags);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/scsi/sd.c:36:
include/linux/spinlock.h:326:67: note: expected 'spinlock_t *' {aka 'struct spinlock *'} but argument is of type 'spinlock_t' {aka 'struct spinlock'}
326 | static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
| ~~~~~~~~~~~~^~~~
>> drivers/scsi/sd.c:3587:2: error: implicit declaration of function 'queue_flag_set'; did you mean 'blk_queue_flag_set'? [-Werror=implicit-function-declaration]
3587 | queue_flag_set(QUEUE_FLAG_DYING, q);
| ^~~~~~~~~~~~~~
| blk_queue_flag_set
>> drivers/scsi/sd.c:3588:2: error: implicit declaration of function '__blk_drain_queue' [-Werror=implicit-function-declaration]
3588 | __blk_drain_queue(q, true);
| ^~~~~~~~~~~~~~~~~
>> drivers/scsi/sd.c:3590:26: error: incompatible type for argument 1 of 'spin_unlock_irqrestore'
3590 | spin_unlock_irqrestore(q->queue_lock, flags);
| ~^~~~~~~~~~~~
| |
| spinlock_t {aka struct spinlock}
In file included from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/scsi/sd.c:36:
include/linux/spinlock.h:406:64: note: expected 'spinlock_t *' {aka 'struct spinlock *'} but argument is of type 'spinlock_t' {aka 'struct spinlock'}
406 | static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
| ~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
vim +3567 drivers/scsi/sd.c
3558
3559 /*
3560 * Send a SYNCHRONIZE CACHE instruction down to the device through
3561 * the normal SCSI command structure. Wait for the command to
3562 * complete.
3563 */
3564 static void sd_shutdown(struct device *dev)
3565 {
3566 struct scsi_disk *sdkp = dev_get_drvdata(dev);
> 3567 struct request_queue *q = sdp->request_queue;
3568 unsigned long flags;
3569
3570 if (!sdkp)
3571 return; /* this can happen */
3572
3573 if (pm_runtime_suspended(dev))
3574 return;
3575
3576 if (sdkp->WCE && sdkp->media_present) {
3577 sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n");
3578 sd_sync_cache(sdkp, NULL);
3579 }
3580
3581 if (system_state != SYSTEM_RESTART && sdkp->device->manage_start_stop) {
3582 sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n");
3583 sd_start_stop_device(sdkp, 0);
3584 }
3585
> 3586 spin_lock_irqsave(q->queue_lock, flags);
> 3587 queue_flag_set(QUEUE_FLAG_DYING, q);
> 3588 __blk_drain_queue(q, true);
3589 queue_flag_set(QUEUE_FLAG_DEAD, q);
> 3590 spin_unlock_irqrestore(q->queue_lock, flags);
3591 }
3592
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months