[pinctrl:for-next 3/47] drivers/pinctrl/bcm/pinctrl-bcm2835.c:412:14: warning: variable 'group' is used uninitialized whenever 'for' loop exits because its condition is false
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git for-next
head: 04853352952b7dd17f355ed54bd81305b341af55
commit: 29d45a642d4ea8de7e89b57f856046df7c3b219f [3/47] pinctrl: bcm2835: Replace BUG with BUG_ON
config: mips-randconfig-c004-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2c6448cdc2f68f8c28fd0bd9404182b81306e6e6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/...
git remote add pinctrl https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
git fetch --no-tags pinctrl for-next
git checkout 29d45a642d4ea8de7e89b57f856046df7c3b219f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang 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 >>):
>> drivers/pinctrl/bcm/pinctrl-bcm2835.c:412:14: warning: variable 'group' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized]
for (i = 0; i < BCM2835_NUM_IRQS; i++) {
^~~~~~~~~~~~~~~~~~~~
drivers/pinctrl/bcm/pinctrl-bcm2835.c:423:10: note: uninitialized use occurs here
switch (group) {
^~~~~
drivers/pinctrl/bcm/pinctrl-bcm2835.c:412:14: note: remove the condition if it is always true
for (i = 0; i < BCM2835_NUM_IRQS; i++) {
^~~~~~~~~~~~~~~~~~~~
drivers/pinctrl/bcm/pinctrl-bcm2835.c:409:11: note: initialize the variable 'group' to silence this warning
int group;
^
= 0
1 warning generated.
vim +412 drivers/pinctrl/bcm/pinctrl-bcm2835.c
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 402
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 403 static void bcm2835_gpio_irq_handler(struct irq_desc *desc)
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 404 {
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 405 struct gpio_chip *chip = irq_desc_get_handler_data(desc);
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 406 struct bcm2835_pinctrl *pc = gpiochip_get_data(chip);
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 407 struct irq_chip *host_chip = irq_desc_get_chip(desc);
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 408 int irq = irq_desc_get_irq(desc);
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 409 int group;
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 410 int i;
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 411
73345a18d464b1b drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2019-08-12 @412 for (i = 0; i < BCM2835_NUM_IRQS; i++) {
73345a18d464b1b drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2019-08-12 413 if (chip->irq.parents[i] == irq) {
0d885e9da176ad3 drivers/pinctrl/bcm/pinctrl-bcm2835.c Thierry Reding 2017-07-20 414 group = i;
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 415 break;
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 416 }
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 417 }
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 418 /* This should not happen, every IRQ has a bank */
29d45a642d4ea8d drivers/pinctrl/bcm/pinctrl-bcm2835.c Jason Wang 2021-06-24 419 BUG_ON(i == BCM2835_NUM_IRQS);
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 420
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 421 chained_irq_enter(host_chip, desc);
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 422
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 423 switch (group) {
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 424 case 0: /* IRQ0 covers GPIOs 0-27 */
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 425 bcm2835_gpio_irq_handle_bank(pc, 0, 0x0fffffff);
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 426 break;
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 427 case 1: /* IRQ1 covers GPIOs 28-45 */
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 428 bcm2835_gpio_irq_handle_bank(pc, 0, 0xf0000000);
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 429 bcm2835_gpio_irq_handle_bank(pc, 1, 0x00003fff);
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 430 break;
b1d84a3d0a26c58 drivers/pinctrl/bcm/pinctrl-bcm2835.c Stefan Wahren 2020-02-08 431 case 2: /* IRQ2 covers GPIOs 46-57 */
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 432 bcm2835_gpio_irq_handle_bank(pc, 1, 0x003fc000);
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 433 break;
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 434 }
00445b5d5866c7b drivers/pinctrl/bcm/pinctrl-bcm2835.c Phil Elwell 2015-02-24 435
85ae9e512f437cd drivers/pinctrl/bcm/pinctrl-bcm2835.c Linus Walleij 2016-11-14 436 chained_irq_exit(host_chip, desc);
e1b2dc70cd5b00e drivers/pinctrl/pinctrl-bcm2835.c Simon Arlott 2012-09-27 437 }
e1b2dc70cd5b00e drivers/pinctrl/pinctrl-bcm2835.c Simon Arlott 2012-09-27 438
:::::: The code at line 412 was first introduced by commit
:::::: 73345a18d464b1b945b29f54f630ace6873344e2 pinctrl: bcm2835: Pass irqchip when adding gpiochip
:::::: TO: Linus Walleij <linus.walleij(a)linaro.org>
:::::: CC: Linus Walleij <linus.walleij(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH v2 5/5] iio: st_sensors: remove reference to parent device object on st_sensor_data
by kernel test robot
Hi Alexandru,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on iio/togreg]
[also build test WARNING on next-20210817]
[cannot apply to linux/master linus/master v5.14-rc6]
[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/Alexandru-Ardelean/iio-st_sensor...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: mips-randconfig-c004-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/0day-ci/linux/commit/6fc83d9d7fb9de59586602b0365acb552...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexandru-Ardelean/iio-st_sensors-convert-probe-functions-to-full-devm/20210816-163158
git checkout 6fc83d9d7fb9de59586602b0365acb5525a3f0b9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^~~~~
drivers/media/tuners/max2165.c:66:3: note: Taking false branch
dprintk("%s: error reg=0x%x, ret=%i\n", __func__, reg, ret);
^
drivers/media/tuners/max2165.c:24:3: note: expanded from macro 'dprintk'
if (debug) \
^
drivers/media/tuners/max2165.c:66:3: note: Loop condition is false. Exiting loop
dprintk("%s: error reg=0x%x, ret=%i\n", __func__, reg, ret);
^
drivers/media/tuners/max2165.c:23:2: note: expanded from macro 'dprintk'
do { \
^
drivers/media/tuners/max2165.c:67:3: note: Returning without writing to '*p_data'
return -EIO;
^
drivers/media/tuners/max2165.c:101:3: note: Returning from 'max2165_read_reg'
max2165_read_reg(priv, REG_ROM_TABLE_DATA, &dat[i]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/tuners/max2165.c:99:2: note: Loop condition is false. Execution continues on line 104
for (i = 0; i < 3; i++) {
^
drivers/media/tuners/max2165.c:108:36: note: The left operand of '&' is a garbage value
priv->bb_filter_7mhz_cfg = dat[2] & 0x0F;
~~~~~~ ^
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/gpu/drm/drm_framebuffer.c:852:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(fb->comm, current->comm);
^~~~~~
drivers/gpu/drm/drm_framebuffer.c:852:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(fb->comm, current->comm);
^~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
Suppressed 8 warnings (7 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
>> drivers/iio/common/st_sensors/st_sensors_trigger.c:79:17: warning: Value stored to 'parent' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *parent = indio_dev->dev.parent;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~
drivers/iio/common/st_sensors/st_sensors_trigger.c:79:17: note: Value stored to 'parent' during its initialization is never read
struct device *parent = indio_dev->dev.parent;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
vim +/parent +79 drivers/iio/common/st_sensors/st_sensors_trigger.c
68
69 /**
70 * st_sensors_irq_thread() - bottom half of the IRQ-based triggers
71 * @irq: irq number
72 * @p: private handler data
73 */
74 static irqreturn_t st_sensors_irq_thread(int irq, void *p)
75 {
76 struct iio_trigger *trig = p;
77 struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
78 struct st_sensor_data *sdata = iio_priv(indio_dev);
> 79 struct device *parent = indio_dev->dev.parent;
80
81 /*
82 * If this trigger is backed by a hardware interrupt and we have a
83 * status register, check if this IRQ came from us. Notice that
84 * we will process also if st_sensors_new_samples_available()
85 * returns negative: if we can't check status, then poll
86 * unconditionally.
87 */
88 if (sdata->hw_irq_trigger &&
89 st_sensors_new_samples_available(indio_dev, sdata)) {
90 iio_trigger_poll_chained(p);
91 } else {
92 dev_dbg(parent, "spurious IRQ\n");
93 return IRQ_NONE;
94 }
95
96 /*
97 * If we have proper level IRQs the handler will be re-entered if
98 * the line is still active, so return here and come back in through
99 * the top half if need be.
100 */
101 if (!sdata->edge_irq)
102 return IRQ_HANDLED;
103
104 /*
105 * If we are using edge IRQs, new samples arrived while processing
106 * the IRQ and those may be missed unless we pick them here, so poll
107 * again. If the sensor delivery frequency is very high, this thread
108 * turns into a polled loop handler.
109 */
110 while (sdata->hw_irq_trigger &&
111 st_sensors_new_samples_available(indio_dev, sdata)) {
112 dev_dbg(parent, "more samples came in during polling\n");
113 sdata->hw_timestamp = iio_get_time_ns(indio_dev);
114 iio_trigger_poll_chained(p);
115 }
116
117 return IRQ_HANDLED;
118 }
119
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[djwong-xfs:vectorized-scrub 70/303] fs/xfs/xfs_symlink.c:176:2: warning: Value stored to 'resblks' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: 142ad7efefdd71fa40628c868530a9357c18ba27
commit: 76d00130dc943feaf66ea28353b9975a2f4213d1 [70/303] xfs: repair damaged symlinks
config: riscv-randconfig-c006-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2c6448cdc2f68f8c28fd0bd9404182b81306e6e6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs vectorized-scrub
git checkout 76d00130dc943feaf66ea28353b9975a2f4213d1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
if (edge) {
^
fs/btrfs/backref.h:314:3: note: Memory is released
kfree(edge);
^~~~~~~~~~~
fs/btrfs/backref.c:3093:3: note: Returning; memory was released
btrfs_backref_free_edge(cache, edge);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/backref.c:3099:7: note: Assuming the condition is false
if (list_empty(&lower->upper) &&
^~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/backref.c:3099:33: note: Left side of '&&' is false
if (list_empty(&lower->upper) &&
^
fs/btrfs/backref.c:3103:7: note: Assuming the condition is true
if (!RB_EMPTY_NODE(&upper->rb_node))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/backref.c:3103:3: note: Taking true branch
if (!RB_EMPTY_NODE(&upper->rb_node))
^
fs/btrfs/backref.c:3104:4: note: Execution continues on line 3086
continue;
^
fs/btrfs/backref.c:3086:2: note: Loop condition is true. Entering loop body
while (!list_empty(&cache->pending_edge)) {
^
fs/btrfs/backref.c:3087:10: note: Left side of '&&' is false
edge = list_first_entry(&cache->pending_edge,
^
include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
list_entry((ptr)->next, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
fs/btrfs/backref.c:3087:10: note: Taking false branch
edge = list_first_entry(&cache->pending_edge,
^
include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
list_entry((ptr)->next, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
fs/btrfs/backref.c:3087:10: note: Loop condition is false. Exiting loop
edge = list_first_entry(&cache->pending_edge,
^
include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
list_entry((ptr)->next, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
do { \
^
fs/btrfs/backref.c:3089:3: note: Calling 'list_del'
list_del(&edge->list[UPPER]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:146:2: note: Calling '__list_del_entry'
__list_del_entry(entry);
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:132:2: note: Taking false branch
if (!__list_del_entry_valid(entry))
^
include/linux/list.h:135:13: note: Use of memory after it is freed
__list_del(entry->prev, entry->next);
^~~~~~~~~~~
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
12 warnings generated.
Suppressed 12 warnings (12 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
11 warnings generated.
>> fs/xfs/xfs_symlink.c:176:2: warning: Value stored to 'resblks' is never read [clang-analyzer-deadcode.DeadStores]
resblks -= fs_blocks;
^ ~~~~~~~~~
fs/xfs/xfs_symlink.c:176:2: note: Value stored to 'resblks' is never read
resblks -= fs_blocks;
^ ~~~~~~~~~
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
13 warnings generated.
include/linux/completion.h:86:10: warning: Access to field 'done' results in a dereference of a null pointer (loaded from variable 'x') [clang-analyzer-core.NullDereference]
x->done = 0;
^
fs/xfs/xfs_sysfs.c:686:25: note: Passing value via 1st parameter 'kobj'
error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype,
^~~~~~~~~~~~~~~~~
fs/xfs/xfs_sysfs.c:686:10: note: Calling 'xfs_sysfs_init'
error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/xfs/xfs_sysfs.h:37:11: note: Assuming 'parent_kobj' is null
parent = parent_kobj ? &parent_kobj->kobject : NULL;
^~~~~~~~~~~
fs/xfs/xfs_sysfs.h:37:11: note: '?' condition is false
fs/xfs/xfs_sysfs.h:38:18: note: Passing value via 1st parameter 'x'
init_completion(&kobj->complete);
^~~~~~~~~~~~~~~
fs/xfs/xfs_sysfs.h:38:2: note: Calling 'init_completion'
init_completion(&kobj->complete);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/completion.h:86:10: note: Access to field 'done' results in a dereference of a null pointer (loaded from variable 'x')
x->done = 0;
~ ^
Suppressed 12 warnings (12 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
12 warnings generated.
Suppressed 12 warnings (12 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
10 warnings generated.
Suppressed 10 warnings (10 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
8 warnings generated.
Suppressed 8 warnings (8 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
Suppressed 9 warnings (9 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
Suppressed 7 warnings (7 in non-user code).
vim +/resblks +176 fs/xfs/xfs_symlink.c
135
136 /* Write the symlink target into the inode. */
137 int
138 xfs_symlink_write_target(
139 struct xfs_trans *tp,
140 struct xfs_inode *ip,
141 const char *target_path,
142 int pathlen,
143 xfs_fsblock_t fs_blocks,
144 uint resblks)
145 {
146 struct xfs_bmbt_irec mval[XFS_SYMLINK_MAPS];
147 struct xfs_mount *mp = tp->t_mountp;
148 const char *cur_chunk;
149 struct xfs_buf *bp;
150 xfs_daddr_t d;
151 int byte_cnt;
152 int nmaps;
153 int offset = 0;
154 int n;
155 int error;
156
157 /*
158 * If the symlink will fit into the inode, write it inline.
159 */
160 if (pathlen <= XFS_IFORK_DSIZE(ip)) {
161 xfs_init_local_fork(ip, XFS_DATA_FORK, target_path, pathlen);
162
163 ip->i_disk_size = pathlen;
164 ip->i_df.if_format = XFS_DINODE_FMT_LOCAL;
165 xfs_trans_log_inode(tp, ip, XFS_ILOG_DDATA | XFS_ILOG_CORE);
166 i_size_write(VFS_I(ip), ip->i_disk_size);
167 return 0;
168 }
169
170 nmaps = XFS_SYMLINK_MAPS;
171 error = xfs_bmapi_write(tp, ip, 0, fs_blocks, XFS_BMAPI_METADATA,
172 resblks, mval, &nmaps);
173 if (error)
174 return error;
175
> 176 resblks -= fs_blocks;
177 ip->i_disk_size = pathlen;
178 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
179
180 cur_chunk = target_path;
181 offset = 0;
182 for (n = 0; n < nmaps; n++) {
183 char *buf;
184
185 d = XFS_FSB_TO_DADDR(mp, mval[n].br_startblock);
186 byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount);
187 error = xfs_trans_get_buf(tp, mp->m_ddev_targp, d,
188 BTOBB(byte_cnt), 0, &bp);
189 if (error)
190 return error;
191 bp->b_ops = &xfs_symlink_buf_ops;
192
193 byte_cnt = XFS_SYMLINK_BUF_SPACE(mp, byte_cnt);
194 byte_cnt = min(byte_cnt, pathlen);
195
196 buf = bp->b_addr;
197 buf += xfs_symlink_hdr_set(mp, ip->i_ino, offset, byte_cnt,
198 bp);
199
200 memcpy(buf, cur_chunk, byte_cnt);
201
202 cur_chunk += byte_cnt;
203 pathlen -= byte_cnt;
204 offset += byte_cnt;
205
206 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SYMLINK_BUF);
207 xfs_trans_log_buf(tp, bp, 0, (buf + byte_cnt - 1) -
208 (char *)bp->b_addr);
209 }
210 ASSERT(pathlen == 0);
211 i_size_write(VFS_I(ip), ip->i_disk_size);
212 return 0;
213 }
214
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH 5/7] block: add emulation for simple copy
by kernel test robot
Hi SelvaKumar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on block/for-next]
[also build test WARNING on dm/for-next next-20210817]
[cannot apply to linus/master linux-nvme/for-next v5.14-rc6]
[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/SelvaKumar-S/block-make-bio_map_...
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: hexagon-randconfig-r013-20210816 (attached as .config)
compiler: clang version 12.0.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/c307f1051a72122d636502c6885df8b2b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review SelvaKumar-S/block-make-bio_map_kern-non-static/20210817-193111
git checkout c307f1051a72122d636502c6885df8b2b25ed697
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=hexagon
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 >>):
block/blk-lib.c:197:5: warning: no previous prototype for function 'blk_copy_offload_submit_bio' [-Wmissing-prototypes]
int blk_copy_offload_submit_bio(struct block_device *bdev,
^
block/blk-lib.c:197:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int blk_copy_offload_submit_bio(struct block_device *bdev,
^
static
block/blk-lib.c:250:5: warning: no previous prototype for function 'blk_copy_offload_scc' [-Wmissing-prototypes]
int blk_copy_offload_scc(struct block_device *src_bdev, int nr_srcs,
^
block/blk-lib.c:250:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int blk_copy_offload_scc(struct block_device *src_bdev, int nr_srcs,
^
static
>> block/blk-lib.c:336:5: warning: no previous prototype for function 'blk_submit_rw_buf' [-Wmissing-prototypes]
int blk_submit_rw_buf(struct block_device *bdev, void *buf, sector_t buf_len,
^
block/blk-lib.c:336:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int blk_submit_rw_buf(struct block_device *bdev, void *buf, sector_t buf_len,
^
static
3 warnings generated.
vim +/blk_submit_rw_buf +336 block/blk-lib.c
335
> 336 int blk_submit_rw_buf(struct block_device *bdev, void *buf, sector_t buf_len,
337 sector_t sector, unsigned int op, gfp_t gfp_mask)
338 {
339 struct request_queue *q = bdev_get_queue(bdev);
340 struct bio *bio, *parent = NULL;
341 sector_t max_hw_len = min_t(unsigned int, queue_max_hw_sectors(q),
342 queue_max_segments(q) << (PAGE_SHIFT - SECTOR_SHIFT));
343 sector_t len, remaining;
344 int ret;
345
346 for (remaining = buf_len; remaining > 0; remaining -= len) {
347 len = min_t(int, max_hw_len, remaining);
348 retry:
349 bio = bio_map_kern(q, buf, len << SECTOR_SHIFT, gfp_mask);
350 if (IS_ERR(bio)) {
351 len >>= 1;
352 if (len)
353 goto retry;
354 return PTR_ERR(bio);
355 }
356
357 bio->bi_iter.bi_sector = sector;
358 bio->bi_opf = op;
359 bio_set_dev(bio, bdev);
360 bio->bi_end_io = NULL;
361 bio->bi_private = NULL;
362
363 if (parent) {
364 bio_chain(parent, bio);
365 submit_bio(parent);
366 }
367 parent = bio;
368 sector += len;
369 }
370 ret = submit_bio_wait(bio);
371 bio_put(bio);
372
373 return ret;
374 }
375
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[linux-next:master 7812/8516] drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4482:31: sparse: sparse: incompatible types in comparison expression (different address spaces):
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 9803fb968c8c2e1283f67b3baeb88e0adba435b4
commit: c530b02f39850a639b72d01ebbf7e5d745c60831 [7812/8516] drm/amd/amdgpu embed hw_fence into amdgpu_job
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout c530b02f39850a639b72d01ebbf7e5d745c60831
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/
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/amd/amdgpu/amdgpu_device.c: note: in included file (through drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h, drivers/gpu/drm/amd/amdgpu/amdgpu.h):
drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:312:49: sparse: sparse: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:316:49: sparse: sparse: static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4482:31: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4482:31: sparse: struct dma_fence [noderef] __rcu *
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4482:31: sparse: struct dma_fence *
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4484:33: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4484:33: sparse: struct dma_fence [noderef] __rcu *
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4484:33: sparse: struct dma_fence *
vim +4482 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
4448
4449 int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,
4450 struct amdgpu_reset_context *reset_context)
4451 {
4452 int i, j, r = 0;
4453 struct amdgpu_job *job = NULL;
4454 bool need_full_reset =
4455 test_bit(AMDGPU_NEED_FULL_RESET, &reset_context->flags);
4456
4457 if (reset_context->reset_req_dev == adev)
4458 job = reset_context->job;
4459
4460 /* no need to dump if device is not in good state during probe period */
4461 if (!adev->gmc.xgmi.pending_reset)
4462 amdgpu_debugfs_wait_dump(adev);
4463
4464 if (amdgpu_sriov_vf(adev)) {
4465 /* stop the data exchange thread */
4466 amdgpu_virt_fini_data_exchange(adev);
4467 }
4468
4469 /* block all schedulers and reset given job's ring */
4470 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
4471 struct amdgpu_ring *ring = adev->rings[i];
4472
4473 if (!ring || !ring->sched.thread)
4474 continue;
4475
4476 /*clear job fence from fence drv to avoid force_completion
4477 *leave NULL and vm flush fence in fence drv */
4478 for (j = 0; j <= ring->fence_drv.num_fences_mask; j++) {
4479 struct dma_fence *old, **ptr;
4480
4481 ptr = &ring->fence_drv.fences[j];
> 4482 old = rcu_dereference_protected(*ptr, 1);
4483 if (old && test_bit(AMDGPU_FENCE_FLAG_EMBED_IN_JOB_BIT, &old->flags)) {
4484 RCU_INIT_POINTER(*ptr, NULL);
4485 }
4486 }
4487 /* after all hw jobs are reset, hw fence is meaningless, so force_completion */
4488 amdgpu_fence_driver_force_completion(ring);
4489 }
4490
4491 if (job && job->vm)
4492 drm_sched_increase_karma(&job->base);
4493
4494 r = amdgpu_reset_prepare_hwcontext(adev, reset_context);
4495 /* If reset handler not implemented, continue; otherwise return */
4496 if (r == -ENOSYS)
4497 r = 0;
4498 else
4499 return r;
4500
4501 /* Don't suspend on bare metal if we are not going to HW reset the ASIC */
4502 if (!amdgpu_sriov_vf(adev)) {
4503
4504 if (!need_full_reset)
4505 need_full_reset = amdgpu_device_ip_need_full_reset(adev);
4506
4507 if (!need_full_reset) {
4508 amdgpu_device_ip_pre_soft_reset(adev);
4509 r = amdgpu_device_ip_soft_reset(adev);
4510 amdgpu_device_ip_post_soft_reset(adev);
4511 if (r || amdgpu_device_ip_check_soft_reset(adev)) {
4512 dev_info(adev->dev, "soft reset failed, will fallback to full reset!\n");
4513 need_full_reset = true;
4514 }
4515 }
4516
4517 if (need_full_reset)
4518 r = amdgpu_device_ip_suspend(adev);
4519 if (need_full_reset)
4520 set_bit(AMDGPU_NEED_FULL_RESET, &reset_context->flags);
4521 else
4522 clear_bit(AMDGPU_NEED_FULL_RESET,
4523 &reset_context->flags);
4524 }
4525
4526 return r;
4527 }
4528
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[hare-scsi-devel:eh-rework.v2 33/51] drivers/scsi/bfa/bfad_im.c:371:23: warning: variable 'itnim' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git eh-rework.v2
head: 7603e2e1f37e470064b8c865b5d6470137baa79b
commit: fa7da686b96cd50ff111019e1d05aa05c22690c6 [33/51] bfa: Do not use scsi command to signal TMF status
config: x86_64-randconfig-a015-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2c6448cdc2f68f8c28fd0bd9404182b81306e6e6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel eh-rework.v2
git checkout fa7da686b96cd50ff111019e1d05aa05c22690c6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/scsi/bfa/bfad_im.c:371:23: warning: variable 'itnim' set but not used [-Wunused-but-set-variable]
struct bfad_itnim_s *itnim;
^
1 warning generated.
vim +/itnim +371 drivers/scsi/bfa/bfad_im.c
360
361 /*
362 * Scsi_Host template entry, resets the target and abort all commands.
363 */
364 static int
365 bfad_im_reset_target_handler(struct scsi_cmnd *cmnd)
366 {
367 struct scsi_target *starget = scsi_target(cmnd->device);
368 struct fc_rport *rport = starget_to_rport(starget);
369 struct Scsi_Host *shost = rport_to_shost(rport);
370 struct bfad_itnim_data_s *itnim_data;
> 371 struct bfad_itnim_s *itnim;
372 struct bfad_im_port_s *im_port =
373 (struct bfad_im_port_s *) shost->hostdata[0];
374 struct bfad_s *bfad = im_port->bfad;
375 unsigned long flags;
376 u32 rc, rtn = FAILED;
377 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
378 enum bfi_tskim_status task_status;
379
380 spin_lock_irqsave(&bfad->bfad_lock, flags);
381 if (!rport->dd_data) {
382 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
383 return rtn;
384 }
385 itnim_data = rport->dd_data;
386 if (itnim_data->tmf_wq) {
387 BFA_LOG(KERN_ERR, bfad, bfa_log_level,
388 "target reset failed, TMF already active");
389 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
390 return rtn;
391 }
392 itnim = itnim_data->itnim;
393
394 itnim_data->tmf_wq = &wq;
395 itnim_data->tmf_status = 0;
396 rc = bfad_im_target_reset_send(bfad, itnim_data);
397 if (rc == BFA_STATUS_OK) {
398 /* wait target reset to complete */
399 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
400 wait_event(wq, test_bit(IO_DONE_BIT, &itnim_data->tmf_status));
401 spin_lock_irqsave(&bfad->bfad_lock, flags);
402
403 task_status = itnim_data->tmf_status >> 1;
404 if (task_status != BFI_TSKIM_STS_OK)
405 BFA_LOG(KERN_ERR, bfad, bfa_log_level,
406 "target reset failure,"
407 " status: %d\n", task_status);
408 else
409 rtn = SUCCESS;
410 }
411 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
412
413 return rtn;
414 }
415
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH v4 14/15] KVM: arm64: Trap access to pVM restricted features
by kernel test robot
Hi Fuad,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on c500bee1c5b2f1d59b1081ac879d73268ab0ff17]
url: https://github.com/0day-ci/linux/commits/Fuad-Tabba/KVM-arm64-Fixed-featu...
base: c500bee1c5b2f1d59b1081ac879d73268ab0ff17
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/c05d33084d216fbdd94a7165aa6e93fd7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Fuad-Tabba/KVM-arm64-Fixed-features-for-protected-VMs/20210817-161500
git checkout c05d33084d216fbdd94a7165aa6e93fd7517e0d8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/kvm_host.h:6,
from arch/arm64/include/asm/kvm_emulate.h:14,
from arch/arm64/kvm/hyp/include/hyp/adjust_pc.h:13,
from arch/arm64/kvm/hyp/include/hyp/switch.h:10,
from arch/arm64/kvm/hyp/nvhe/switch.c:7:
include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:163:43: note: in expansion of macro 'NULL'
163 | [ESR_ELx_EC_WFx] = NULL,
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for 'hyp_exit_handlers[1]')
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:163:43: note: in expansion of macro 'NULL'
163 | [ESR_ELx_EC_WFx] = NULL,
| ^~~~
>> arch/arm64/kvm/hyp/nvhe/switch.c:164:43: warning: initialized field overwritten [-Woverride-init]
164 | [ESR_ELx_EC_CP15_32] = kvm_handle_pvm_restricted,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/hyp/nvhe/switch.c:164:43: note: (near initialization for 'hyp_exit_handlers[3]')
arch/arm64/kvm/hyp/nvhe/switch.c:165:43: warning: initialized field overwritten [-Woverride-init]
165 | [ESR_ELx_EC_CP15_64] = kvm_handle_pvm_restricted,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/hyp/nvhe/switch.c:165:43: note: (near initialization for 'hyp_exit_handlers[4]')
arch/arm64/kvm/hyp/nvhe/switch.c:166:43: warning: initialized field overwritten [-Woverride-init]
166 | [ESR_ELx_EC_CP14_MR] = kvm_handle_pvm_restricted,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/hyp/nvhe/switch.c:166:43: note: (near initialization for 'hyp_exit_handlers[5]')
arch/arm64/kvm/hyp/nvhe/switch.c:167:43: warning: initialized field overwritten [-Woverride-init]
167 | [ESR_ELx_EC_CP14_LS] = kvm_handle_pvm_restricted,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/hyp/nvhe/switch.c:167:43: note: (near initialization for 'hyp_exit_handlers[6]')
arch/arm64/kvm/hyp/nvhe/switch.c:168:43: warning: initialized field overwritten [-Woverride-init]
168 | [ESR_ELx_EC_CP14_64] = kvm_handle_pvm_restricted,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/hyp/nvhe/switch.c:168:43: note: (near initialization for 'hyp_exit_handlers[12]')
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/kvm_host.h:6,
from arch/arm64/include/asm/kvm_emulate.h:14,
from arch/arm64/kvm/hyp/include/hyp/adjust_pc.h:13,
from arch/arm64/kvm/hyp/include/hyp/switch.h:10,
from arch/arm64/kvm/hyp/nvhe/switch.c:7:
include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:169:43: note: in expansion of macro 'NULL'
169 | [ESR_ELx_EC_HVC32] = NULL,
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for 'hyp_exit_handlers[18]')
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:169:43: note: in expansion of macro 'NULL'
169 | [ESR_ELx_EC_HVC32] = NULL,
| ^~~~
include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:170:43: note: in expansion of macro 'NULL'
170 | [ESR_ELx_EC_SMC32] = NULL,
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for 'hyp_exit_handlers[19]')
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:170:43: note: in expansion of macro 'NULL'
170 | [ESR_ELx_EC_SMC32] = NULL,
| ^~~~
include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:171:43: note: in expansion of macro 'NULL'
171 | [ESR_ELx_EC_HVC64] = NULL,
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for 'hyp_exit_handlers[22]')
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:171:43: note: in expansion of macro 'NULL'
171 | [ESR_ELx_EC_HVC64] = NULL,
| ^~~~
include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:172:43: note: in expansion of macro 'NULL'
172 | [ESR_ELx_EC_SMC64] = NULL,
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for 'hyp_exit_handlers[23]')
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:172:43: note: in expansion of macro 'NULL'
172 | [ESR_ELx_EC_SMC64] = NULL,
| ^~~~
arch/arm64/kvm/hyp/nvhe/switch.c:173:43: warning: initialized field overwritten [-Woverride-init]
173 | [ESR_ELx_EC_SYS64] = kvm_handle_pvm_sys64,
| ^~~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/hyp/nvhe/switch.c:173:43: note: (near initialization for 'hyp_exit_handlers[24]')
arch/arm64/kvm/hyp/nvhe/switch.c:174:43: warning: initialized field overwritten [-Woverride-init]
174 | [ESR_ELx_EC_SVE] = kvm_handle_pvm_restricted,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kvm/hyp/nvhe/switch.c:174:43: note: (near initialization for 'hyp_exit_handlers[25]')
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/kvm_host.h:6,
from arch/arm64/include/asm/kvm_emulate.h:14,
from arch/arm64/kvm/hyp/include/hyp/adjust_pc.h:13,
from arch/arm64/kvm/hyp/include/hyp/switch.h:10,
from arch/arm64/kvm/hyp/nvhe/switch.c:7:
include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
8 | #define NULL ((void *)0)
| ^
arch/arm64/kvm/hyp/nvhe/switch.c:175:43: note: in expansion of macro 'NULL'
175 | [ESR_ELx_EC_IABT_LOW] = NULL,
| ^~~~
include/linux/stddef.h:8:14: note: (near initialization for 'hyp_exit_handlers[32]')
8 | #define NULL ((void *)0)
| ^
vim +164 arch/arm64/kvm/hyp/nvhe/switch.c
160
161 static exit_handle_fn hyp_exit_handlers[] = {
162 [0 ... ESR_ELx_EC_MAX] = kvm_handle_pvm_restricted,
> 163 [ESR_ELx_EC_WFx] = NULL,
> 164 [ESR_ELx_EC_CP15_32] = kvm_handle_pvm_restricted,
165 [ESR_ELx_EC_CP15_64] = kvm_handle_pvm_restricted,
166 [ESR_ELx_EC_CP14_MR] = kvm_handle_pvm_restricted,
167 [ESR_ELx_EC_CP14_LS] = kvm_handle_pvm_restricted,
168 [ESR_ELx_EC_CP14_64] = kvm_handle_pvm_restricted,
169 [ESR_ELx_EC_HVC32] = NULL,
170 [ESR_ELx_EC_SMC32] = NULL,
171 [ESR_ELx_EC_HVC64] = NULL,
172 [ESR_ELx_EC_SMC64] = NULL,
173 [ESR_ELx_EC_SYS64] = kvm_handle_pvm_sys64,
174 [ESR_ELx_EC_SVE] = kvm_handle_pvm_restricted,
175 [ESR_ELx_EC_IABT_LOW] = NULL,
176 [ESR_ELx_EC_DABT_LOW] = NULL,
177 [ESR_ELx_EC_SOFTSTP_LOW] = kvm_handle_pvm_restricted,
178 [ESR_ELx_EC_WATCHPT_LOW] = kvm_handle_pvm_restricted,
179 [ESR_ELx_EC_BREAKPT_LOW] = kvm_handle_pvm_restricted,
180 [ESR_ELx_EC_BKPT32] = kvm_handle_pvm_restricted,
181 [ESR_ELx_EC_BRK64] = kvm_handle_pvm_restricted,
182 [ESR_ELx_EC_FP_ASIMD] = kvm_handle_pvm_restricted,
183 [ESR_ELx_EC_PAC] = NULL,
184 };
185
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month