[pinchartl-media:rpi/next/bcm2835-isp 5/49] drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:130 get_kernel_id() warn: sleeping in atomic context
by Dan Carpenter
tree: git://linuxtv.org/pinchartl/media.git rpi/next/bcm2835-isp
head: 97975aa0732da0e2084ed69d140656c2162bec05
commit: 0cfa42bcc0795e569f1312e6ef5843c97bd36642 [5/49] staging: vc04_services: Add new vc-sm-cma driver
config: arm-randconfig-m031-20220112 (https://download.01.org/0day-ci/archive/20220113/202201130306.YgzUxxgI-lk...)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:130 get_kernel_id() warn: sleeping in atomic context
drivers/staging/vc04_services/vc-sm-cma/vc_sm.c:1245 vc_sm_cma_ioctl_alloc() error: we previously assumed 'buffer' could be null (see line 1133)
vim +130 drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
0cfa42bcc0795e Dave Stevenson 2020-10-08 125 static int get_kernel_id(struct vc_sm_buffer *buffer)
0cfa42bcc0795e Dave Stevenson 2020-10-08 126 {
0cfa42bcc0795e Dave Stevenson 2020-10-08 127 int handle;
0cfa42bcc0795e Dave Stevenson 2020-10-08 128
0cfa42bcc0795e Dave Stevenson 2020-10-08 129 spin_lock(&sm_state->kernelid_map_lock);
Takes lock
0cfa42bcc0795e Dave Stevenson 2020-10-08 @130 handle = idr_alloc(&sm_state->kernelid_map, buffer, 0, 0, GFP_KERNEL);
Presumably GFP_KERNEL can sleep. Use GFP_ATOMIC?
0cfa42bcc0795e Dave Stevenson 2020-10-08 131 spin_unlock(&sm_state->kernelid_map_lock);
0cfa42bcc0795e Dave Stevenson 2020-10-08 132
0cfa42bcc0795e Dave Stevenson 2020-10-08 133 return handle;
0cfa42bcc0795e Dave Stevenson 2020-10-08 134 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
drivers/regulator/max20086-regulator.c:217:26: error: storage size of 'flags' isn't known
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 455e73a07f6e288b0061dfcf4fcf54fa9fe06458
commit: bfff546aae50ae68ed395bf0e0848188d27b0ba3 regulator: Add MAX20086-MAX20089 driver
date: 6 days ago
config: m68k-randconfig-r024-20220113 (https://download.01.org/0day-ci/archive/20220113/202201131324.vmxL1PCz-lk...)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout bfff546aae50ae68ed395bf0e0848188d27b0ba3
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/regulator/
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/regulator/max20086-regulator.c: In function 'max20086_i2c_probe':
>> drivers/regulator/max20086-regulator.c:217:26: error: storage size of 'flags' isn't known
217 | enum gpiod_flags flags;
| ^~~~~
>> drivers/regulator/max20086-regulator.c:261:27: error: 'GPIOD_OUT_HIGH' undeclared (first use in this function); did you mean 'GPIOF_INIT_HIGH'?
261 | flags = boot_on ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
| ^~~~~~~~~~~~~~
| GPIOF_INIT_HIGH
drivers/regulator/max20086-regulator.c:261:27: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/regulator/max20086-regulator.c:261:44: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'?
261 | flags = boot_on ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
| ^~~~~~~~~~~~~
| GPIOF_INIT_LOW
>> drivers/regulator/max20086-regulator.c:262:27: error: implicit declaration of function 'devm_gpiod_get'; did you mean 'devm_gpio_free'? [-Werror=implicit-function-declaration]
262 | chip->ena_gpiod = devm_gpiod_get(chip->dev, "enable", flags);
| ^~~~~~~~~~~~~~
| devm_gpio_free
drivers/regulator/max20086-regulator.c:217:26: warning: unused variable 'flags' [-Wunused-variable]
217 | enum gpiod_flags flags;
| ^~~~~
cc1: some warnings being treated as errors
vim +217 drivers/regulator/max20086-regulator.c
213
214 static int max20086_i2c_probe(struct i2c_client *i2c)
215 {
216 struct max20086 *chip;
> 217 enum gpiod_flags flags;
218 bool boot_on;
219 int ret;
220
221 chip = devm_kzalloc(&i2c->dev, sizeof(*chip), GFP_KERNEL);
222 if (!chip)
223 return -ENOMEM;
224
225 chip->dev = &i2c->dev;
226 chip->info = device_get_match_data(chip->dev);
227
228 i2c_set_clientdata(i2c, chip);
229
230 chip->regmap = devm_regmap_init_i2c(i2c, &max20086_regmap_config);
231 if (IS_ERR(chip->regmap)) {
232 ret = PTR_ERR(chip->regmap);
233 dev_err(chip->dev, "Failed to allocate register map: %d\n", ret);
234 return ret;
235 }
236
237 ret = max20086_parse_regulators_dt(chip, &boot_on);
238 if (ret < 0)
239 return ret;
240
241 ret = max20086_detect(chip);
242 if (ret < 0)
243 return ret;
244
245 /* Until IRQ support is added, just disable all interrupts. */
246 ret = regmap_update_bits(chip->regmap, MAX20086_REG_MASK,
247 MAX20086_INT_DISABLE_ALL,
248 MAX20086_INT_DISABLE_ALL);
249 if (ret < 0) {
250 dev_err(chip->dev, "Failed to disable interrupts: %d\n", ret);
251 return ret;
252 }
253
254 /*
255 * Get the enable GPIO. If any of the outputs is marked as being
256 * enabled at boot, request the GPIO with an initial high state to
257 * avoid disabling outputs that may have been turned on by the boot
258 * loader. Otherwise, request it with a low state to enter lower-power
259 * shutdown.
260 */
> 261 flags = boot_on ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
> 262 chip->ena_gpiod = devm_gpiod_get(chip->dev, "enable", flags);
263 if (IS_ERR(chip->ena_gpiod)) {
264 ret = PTR_ERR(chip->ena_gpiod);
265 dev_err(chip->dev, "Failed to get enable GPIO: %d\n", ret);
266 return ret;
267 }
268
269 ret = max20086_regulators_register(chip);
270 if (ret < 0) {
271 dev_err(chip->dev, "Failed to register regulators: %d\n", ret);
272 return ret;
273 }
274
275 return 0;
276 }
277
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
[sailus-media-tree:master 15/16] drivers/media/i2c/hi847.c:2700:49: error: passing argument 2 of 'v4l2_subdev_get_try_format' from incompatible pointer type
by kernel test robot
tree: git://linuxtv.org/sailus/media_tree.git master
head: 232068c0bf39d2e34585450343c1439a89aad66b
commit: 009f8036169f02f87f7fd5e3152f6dcd03986a81 [15/16] media: hi847: Add support for Hi-847 sensor
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220112/202201122346.jc4ZqZm5-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add sailus-media-tree git://linuxtv.org/sailus/media_tree.git
git fetch --no-tags sailus-media-tree master
git checkout 009f8036169f02f87f7fd5e3152f6dcd03986a81
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/media/i2c/hi847.c: In function 'hi847_set_format':
>> drivers/media/i2c/hi847.c:2700:49: error: passing argument 2 of 'v4l2_subdev_get_try_format' from incompatible pointer type [-Werror=incompatible-pointer-types]
2700 | *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format;
| ^~~
| |
| struct v4l2_subdev_pad_config *
In file included from include/media/v4l2-device.h:13,
from drivers/media/i2c/hi847.c:11:
include/media/v4l2-subdev.h:982:54: note: expected 'struct v4l2_subdev_state *' but argument is of type 'struct v4l2_subdev_pad_config *'
982 | struct v4l2_subdev_state *state,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
drivers/media/i2c/hi847.c: In function 'hi847_get_format':
drivers/media/i2c/hi847.c:2734:71: error: passing argument 2 of 'v4l2_subdev_get_try_format' from incompatible pointer type [-Werror=incompatible-pointer-types]
2734 | fmt->format = *v4l2_subdev_get_try_format(&hi847->sd, cfg,
| ^~~
| |
| struct v4l2_subdev_pad_config *
In file included from include/media/v4l2-device.h:13,
from drivers/media/i2c/hi847.c:11:
include/media/v4l2-subdev.h:982:54: note: expected 'struct v4l2_subdev_state *' but argument is of type 'struct v4l2_subdev_pad_config *'
982 | struct v4l2_subdev_state *state,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
drivers/media/i2c/hi847.c: In function 'hi847_open':
>> drivers/media/i2c/hi847.c:2780:66: error: 'struct v4l2_subdev_fh' has no member named 'pad'
2780 | v4l2_subdev_get_try_format(sd, fh->pad, 0));
| ^~
drivers/media/i2c/hi847.c: At top level:
>> drivers/media/i2c/hi847.c:2791:20: error: initialization of 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct v4l2_subdev_format *)' from incompatible pointer type 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_pad_config *, struct v4l2_subdev_format *)' [-Werror=incompatible-pointer-types]
2791 | .set_fmt = hi847_set_format,
| ^~~~~~~~~~~~~~~~
drivers/media/i2c/hi847.c:2791:20: note: (near initialization for 'hi847_pad_ops.set_fmt')
drivers/media/i2c/hi847.c:2792:20: error: initialization of 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct v4l2_subdev_format *)' from incompatible pointer type 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_pad_config *, struct v4l2_subdev_format *)' [-Werror=incompatible-pointer-types]
2792 | .get_fmt = hi847_get_format,
| ^~~~~~~~~~~~~~~~
drivers/media/i2c/hi847.c:2792:20: note: (near initialization for 'hi847_pad_ops.get_fmt')
>> drivers/media/i2c/hi847.c:2793:27: error: initialization of 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct v4l2_subdev_mbus_code_enum *)' from incompatible pointer type 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_pad_config *, struct v4l2_subdev_mbus_code_enum *)' [-Werror=incompatible-pointer-types]
2793 | .enum_mbus_code = hi847_enum_mbus_code,
| ^~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/hi847.c:2793:27: note: (near initialization for 'hi847_pad_ops.enum_mbus_code')
>> drivers/media/i2c/hi847.c:2794:28: error: initialization of 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_state *, struct v4l2_subdev_frame_size_enum *)' from incompatible pointer type 'int (*)(struct v4l2_subdev *, struct v4l2_subdev_pad_config *, struct v4l2_subdev_frame_size_enum *)' [-Werror=incompatible-pointer-types]
2794 | .enum_frame_size = hi847_enum_frame_size,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/hi847.c:2794:28: note: (near initialization for 'hi847_pad_ops.enum_frame_size')
drivers/media/i2c/hi847.c: In function 'hi847_probe':
>> drivers/media/i2c/hi847.c:2954:15: error: implicit declaration of function 'v4l2_async_register_subdev_sensor_common'; did you mean 'v4l2_async_register_subdev_sensor'? [-Werror=implicit-function-declaration]
2954 | ret = v4l2_async_register_subdev_sensor_common(&hi847->sd);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| v4l2_async_register_subdev_sensor
cc1: some warnings being treated as errors
vim +/v4l2_subdev_get_try_format +2700 drivers/media/i2c/hi847.c
2683
2684 static int hi847_set_format(struct v4l2_subdev *sd,
2685 struct v4l2_subdev_pad_config *cfg,
2686 struct v4l2_subdev_format *fmt)
2687 {
2688 struct hi847 *hi847 = to_hi847(sd);
2689 const struct hi847_mode *mode;
2690 s32 vblank_def, h_blank;
2691
2692 mode = v4l2_find_nearest_size(supported_modes,
2693 ARRAY_SIZE(supported_modes), width,
2694 height, fmt->format.width,
2695 fmt->format.height);
2696
2697 mutex_lock(&hi847->mutex);
2698 hi847_assign_pad_format(mode, &fmt->format);
2699 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
> 2700 *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format;
2701 } else {
2702 hi847->cur_mode = mode;
2703 __v4l2_ctrl_s_ctrl(hi847->link_freq, mode->link_freq_index);
2704 __v4l2_ctrl_s_ctrl_int64(hi847->pixel_rate,
2705 to_pixel_rate(mode->link_freq_index));
2706
2707 /* Update limits and set FPS to default */
2708 vblank_def = mode->fll_def - mode->height;
2709 __v4l2_ctrl_modify_range(hi847->vblank,
2710 mode->fll_min - mode->height,
2711 HI847_FLL_MAX - mode->height, 1,
2712 vblank_def);
2713 __v4l2_ctrl_s_ctrl(hi847->vblank, vblank_def);
2714
2715 h_blank = hi847->cur_mode->llp - hi847->cur_mode->width;
2716
2717 __v4l2_ctrl_modify_range(hi847->hblank, h_blank, h_blank, 1,
2718 h_blank);
2719 }
2720
2721 mutex_unlock(&hi847->mutex);
2722
2723 return 0;
2724 }
2725
2726 static int hi847_get_format(struct v4l2_subdev *sd,
2727 struct v4l2_subdev_pad_config *cfg,
2728 struct v4l2_subdev_format *fmt)
2729 {
2730 struct hi847 *hi847 = to_hi847(sd);
2731
2732 mutex_lock(&hi847->mutex);
2733 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
2734 fmt->format = *v4l2_subdev_get_try_format(&hi847->sd, cfg,
2735 fmt->pad);
2736 else
2737 hi847_assign_pad_format(hi847->cur_mode, &fmt->format);
2738
2739 mutex_unlock(&hi847->mutex);
2740
2741 return 0;
2742 }
2743
2744 static int hi847_enum_mbus_code(struct v4l2_subdev *sd,
2745 struct v4l2_subdev_pad_config *cfg,
2746 struct v4l2_subdev_mbus_code_enum *code)
2747 {
2748 if (code->index > 0)
2749 return -EINVAL;
2750
2751 code->code = MEDIA_BUS_FMT_SGRBG10_1X10;
2752
2753 return 0;
2754 }
2755
2756 static int hi847_enum_frame_size(struct v4l2_subdev *sd,
2757 struct v4l2_subdev_pad_config *cfg,
2758 struct v4l2_subdev_frame_size_enum *fse)
2759 {
2760 if (fse->index >= ARRAY_SIZE(supported_modes))
2761 return -EINVAL;
2762
2763 if (fse->code != MEDIA_BUS_FMT_SGRBG10_1X10)
2764 return -EINVAL;
2765
2766 fse->min_width = supported_modes[fse->index].width;
2767 fse->max_width = fse->min_width;
2768 fse->min_height = supported_modes[fse->index].height;
2769 fse->max_height = fse->min_height;
2770
2771 return 0;
2772 }
2773
2774 static int hi847_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
2775 {
2776 struct hi847 *hi847 = to_hi847(sd);
2777
2778 mutex_lock(&hi847->mutex);
2779 hi847_assign_pad_format(&supported_modes[0],
> 2780 v4l2_subdev_get_try_format(sd, fh->pad, 0));
2781 mutex_unlock(&hi847->mutex);
2782
2783 return 0;
2784 }
2785
2786 static const struct v4l2_subdev_video_ops hi847_video_ops = {
2787 .s_stream = hi847_set_stream,
2788 };
2789
2790 static const struct v4l2_subdev_pad_ops hi847_pad_ops = {
> 2791 .set_fmt = hi847_set_format,
2792 .get_fmt = hi847_get_format,
> 2793 .enum_mbus_code = hi847_enum_mbus_code,
> 2794 .enum_frame_size = hi847_enum_frame_size,
2795 };
2796
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
Re: [PATCH 01/13] blk: make blk-rq-qos support pluggable and modular policy
by kernel test robot
Hi Wang,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tj-cgroup/for-next]
[also build test WARNING on v5.16]
[cannot apply to axboe-block/for-next next-20220112]
[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/Wang-Jianchao/blk-make-blk-rq-qo...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
config: arm-randconfig-r006-20220112 (https://download.01.org/0day-ci/archive/20220113/202201130903.7ZvBIOs4-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 244dd2913a43a200f5a6544d424cdc37b771028b)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/8bef9fba59d8d47ecaebbeff3e62ee550...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Wang-Jianchao/blk-make-blk-rq-qos-policies-pluggable-and-modular/20220110-171347
git checkout 8bef9fba59d8d47ecaebbeff3e62ee550d89b017
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
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-iocost.c:1244:6: warning: variable 'last_period' set but not used [-Wunused-but-set-variable]
u64 last_period, cur_period;
^
>> block/blk-iocost.c:3348:7: warning: variable 'ioc' is uninitialized when used here [-Wuninitialized]
if (!ioc) {
^~~
block/blk-iocost.c:3337:17: note: initialize the variable 'ioc' to silence this warning
struct ioc *ioc;
^
= NULL
2 warnings generated.
vim +/ioc +3348 block/blk-iocost.c
7caa47151ab2e64 Tejun Heo 2019-08-28 3331
7caa47151ab2e64 Tejun Heo 2019-08-28 3332 static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input,
7caa47151ab2e64 Tejun Heo 2019-08-28 3333 size_t nbytes, loff_t off)
7caa47151ab2e64 Tejun Heo 2019-08-28 3334 {
22ae8ce8b89241c Christoph Hellwig 2020-11-26 3335 struct block_device *bdev;
8bef9fba59d8d47 Wang Jianchao 2022-01-10 3336 struct rq_qos *rqos;
7caa47151ab2e64 Tejun Heo 2019-08-28 3337 struct ioc *ioc;
7caa47151ab2e64 Tejun Heo 2019-08-28 3338 u64 u[NR_I_LCOEFS];
7caa47151ab2e64 Tejun Heo 2019-08-28 3339 bool user;
7caa47151ab2e64 Tejun Heo 2019-08-28 3340 char *p;
7caa47151ab2e64 Tejun Heo 2019-08-28 3341 int ret;
7caa47151ab2e64 Tejun Heo 2019-08-28 3342
22ae8ce8b89241c Christoph Hellwig 2020-11-26 3343 bdev = blkcg_conf_open_bdev(&input);
22ae8ce8b89241c Christoph Hellwig 2020-11-26 3344 if (IS_ERR(bdev))
22ae8ce8b89241c Christoph Hellwig 2020-11-26 3345 return PTR_ERR(bdev);
7caa47151ab2e64 Tejun Heo 2019-08-28 3346
8bef9fba59d8d47 Wang Jianchao 2022-01-10 3347 rqos = rq_qos_get(bdev_get_queue(bdev), RQ_QOS_COST);
7caa47151ab2e64 Tejun Heo 2019-08-28 @3348 if (!ioc) {
ed6cddefdfd361a Pavel Begunkov 2021-10-14 3349 ret = blk_iocost_init(bdev_get_queue(bdev));
7caa47151ab2e64 Tejun Heo 2019-08-28 3350 if (ret)
7caa47151ab2e64 Tejun Heo 2019-08-28 3351 goto err;
8bef9fba59d8d47 Wang Jianchao 2022-01-10 3352 rqos = rq_qos_get(bdev_get_queue(bdev), RQ_QOS_COST);
7caa47151ab2e64 Tejun Heo 2019-08-28 3353 }
7caa47151ab2e64 Tejun Heo 2019-08-28 3354
8bef9fba59d8d47 Wang Jianchao 2022-01-10 3355 ioc = rqos_to_ioc(rqos);
7caa47151ab2e64 Tejun Heo 2019-08-28 3356 spin_lock_irq(&ioc->lock);
7caa47151ab2e64 Tejun Heo 2019-08-28 3357 memcpy(u, ioc->params.i_lcoefs, sizeof(u));
7caa47151ab2e64 Tejun Heo 2019-08-28 3358 user = ioc->user_cost_model;
7caa47151ab2e64 Tejun Heo 2019-08-28 3359 spin_unlock_irq(&ioc->lock);
7caa47151ab2e64 Tejun Heo 2019-08-28 3360
7caa47151ab2e64 Tejun Heo 2019-08-28 3361 while ((p = strsep(&input, " \t\n"))) {
7caa47151ab2e64 Tejun Heo 2019-08-28 3362 substring_t args[MAX_OPT_ARGS];
7caa47151ab2e64 Tejun Heo 2019-08-28 3363 char buf[32];
7caa47151ab2e64 Tejun Heo 2019-08-28 3364 int tok;
7caa47151ab2e64 Tejun Heo 2019-08-28 3365 u64 v;
7caa47151ab2e64 Tejun Heo 2019-08-28 3366
7caa47151ab2e64 Tejun Heo 2019-08-28 3367 if (!*p)
7caa47151ab2e64 Tejun Heo 2019-08-28 3368 continue;
7caa47151ab2e64 Tejun Heo 2019-08-28 3369
7caa47151ab2e64 Tejun Heo 2019-08-28 3370 switch (match_token(p, cost_ctrl_tokens, args)) {
7caa47151ab2e64 Tejun Heo 2019-08-28 3371 case COST_CTRL:
7caa47151ab2e64 Tejun Heo 2019-08-28 3372 match_strlcpy(buf, &args[0], sizeof(buf));
7caa47151ab2e64 Tejun Heo 2019-08-28 3373 if (!strcmp(buf, "auto"))
7caa47151ab2e64 Tejun Heo 2019-08-28 3374 user = false;
7caa47151ab2e64 Tejun Heo 2019-08-28 3375 else if (!strcmp(buf, "user"))
7caa47151ab2e64 Tejun Heo 2019-08-28 3376 user = true;
7caa47151ab2e64 Tejun Heo 2019-08-28 3377 else
7caa47151ab2e64 Tejun Heo 2019-08-28 3378 goto einval;
7caa47151ab2e64 Tejun Heo 2019-08-28 3379 continue;
7caa47151ab2e64 Tejun Heo 2019-08-28 3380 case COST_MODEL:
7caa47151ab2e64 Tejun Heo 2019-08-28 3381 match_strlcpy(buf, &args[0], sizeof(buf));
7caa47151ab2e64 Tejun Heo 2019-08-28 3382 if (strcmp(buf, "linear"))
7caa47151ab2e64 Tejun Heo 2019-08-28 3383 goto einval;
7caa47151ab2e64 Tejun Heo 2019-08-28 3384 continue;
7caa47151ab2e64 Tejun Heo 2019-08-28 3385 }
7caa47151ab2e64 Tejun Heo 2019-08-28 3386
7caa47151ab2e64 Tejun Heo 2019-08-28 3387 tok = match_token(p, i_lcoef_tokens, args);
7caa47151ab2e64 Tejun Heo 2019-08-28 3388 if (tok == NR_I_LCOEFS)
7caa47151ab2e64 Tejun Heo 2019-08-28 3389 goto einval;
7caa47151ab2e64 Tejun Heo 2019-08-28 3390 if (match_u64(&args[0], &v))
7caa47151ab2e64 Tejun Heo 2019-08-28 3391 goto einval;
7caa47151ab2e64 Tejun Heo 2019-08-28 3392 u[tok] = v;
7caa47151ab2e64 Tejun Heo 2019-08-28 3393 user = true;
7caa47151ab2e64 Tejun Heo 2019-08-28 3394 }
7caa47151ab2e64 Tejun Heo 2019-08-28 3395
7caa47151ab2e64 Tejun Heo 2019-08-28 3396 spin_lock_irq(&ioc->lock);
7caa47151ab2e64 Tejun Heo 2019-08-28 3397 if (user) {
7caa47151ab2e64 Tejun Heo 2019-08-28 3398 memcpy(ioc->params.i_lcoefs, u, sizeof(u));
7caa47151ab2e64 Tejun Heo 2019-08-28 3399 ioc->user_cost_model = true;
7caa47151ab2e64 Tejun Heo 2019-08-28 3400 } else {
7caa47151ab2e64 Tejun Heo 2019-08-28 3401 ioc->user_cost_model = false;
7caa47151ab2e64 Tejun Heo 2019-08-28 3402 }
7caa47151ab2e64 Tejun Heo 2019-08-28 3403 ioc_refresh_params(ioc, true);
7caa47151ab2e64 Tejun Heo 2019-08-28 3404 spin_unlock_irq(&ioc->lock);
7caa47151ab2e64 Tejun Heo 2019-08-28 3405
8bef9fba59d8d47 Wang Jianchao 2022-01-10 3406 rq_qos_put(rqos);
22ae8ce8b89241c Christoph Hellwig 2020-11-26 3407 blkdev_put_no_open(bdev);
7caa47151ab2e64 Tejun Heo 2019-08-28 3408 return nbytes;
7caa47151ab2e64 Tejun Heo 2019-08-28 3409
7caa47151ab2e64 Tejun Heo 2019-08-28 3410 einval:
7caa47151ab2e64 Tejun Heo 2019-08-28 3411 ret = -EINVAL;
8bef9fba59d8d47 Wang Jianchao 2022-01-10 3412 rq_qos_put(rqos);
7caa47151ab2e64 Tejun Heo 2019-08-28 3413 err:
22ae8ce8b89241c Christoph Hellwig 2020-11-26 3414 blkdev_put_no_open(bdev);
7caa47151ab2e64 Tejun Heo 2019-08-28 3415 return ret;
7caa47151ab2e64 Tejun Heo 2019-08-28 3416 }
7caa47151ab2e64 Tejun Heo 2019-08-28 3417
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
Re: [RFC PATCH 4/6] fprobe: Add exit_handler support
by kernel test robot
Hi Masami,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on rostedt-trace/for-next]
[also build test WARNING on bpf-next/master bpf/master linus/master v5.16 next-20220112]
[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/Masami-Hiramatsu/fprobe-Add-ftra...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20220113/202201131009.oKKmEVVq-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 244dd2913a43a200f5a6544d424cdc37b771028b)
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/c0e0471b58c3c9122bbff7523f97a3635...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Masami-Hiramatsu/fprobe-Add-ftrace-based-probe-APIs/20220112-000050
git checkout c0e0471b58c3c9122bbff7523f97a363558284eb
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kernel/
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 >>):
>> arch/x86/kernel/rethook.c:14:23: warning: no previous prototype for function 'arch_rethook_trampoline_callback' [-Wmissing-prototypes]
__used __visible void arch_rethook_trampoline_callback(struct pt_regs *regs)
^
arch/x86/kernel/rethook.c:14:18: note: declare 'static' if the function is not intended to be used outside of this translation unit
__used __visible void arch_rethook_trampoline_callback(struct pt_regs *regs)
^
static
1 warning generated.
vim +/arch_rethook_trampoline_callback +14 arch/x86/kernel/rethook.c
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 10
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 11 /*
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 12 * Called from arch_rethook_trampoline
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 13 */
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 @14 __used __visible void arch_rethook_trampoline_callback(struct pt_regs *regs)
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 15 {
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 16 unsigned long *frame_pointer;
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 17
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 18 /* fixup registers */
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 19 regs->cs = __KERNEL_CS;
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 20 #ifdef CONFIG_X86_32
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 21 regs->gs = 0;
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 22 #endif
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 23 regs->ip = (unsigned long)&arch_rethook_trampoline;
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 24 regs->orig_ax = ~0UL;
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 25 regs->sp += sizeof(long);
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 26 frame_pointer = ®s->sp + 1;
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 27
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 28 /*
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 29 * The return address at 'frame_pointer' is recovered by the
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 30 * arch_rethook_fixup_return() which called from this
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 31 * rethook_trampoline_handler().
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 32 */
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 33 rethook_trampoline_handler(regs, (unsigned long)frame_pointer);
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 34
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 35 /*
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 36 * Copy FLAGS to 'pt_regs::sp' so that arch_rethook_trapmoline()
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 37 * can do RET right after POPF.
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 38 */
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 39 regs->sp = regs->flags;
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 40 }
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 41 NOKPROBE_SYMBOL(arch_rethook_trampoline_callback);
3727c0ee2be25cf Masami Hiramatsu 2022-01-12 42
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
Re: [PATCH v1 1/9] drivers: hv: dxgkrnl: Driver initialization and creation of dxgadapter
by kernel test robot
Hi Iouri,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.16 next-20220112]
[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/Iouri-Tarassov/drivers-hv-dxgkrn...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e3084ed48fd6b661fe434da0cb36d7d6706cf27f
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220113/202201130941.ZVnyqikS-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/00f97c12e2cf0ba4ba1108e2fce9a3d0e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Iouri-Tarassov/drivers-hv-dxgkrnl-Driver-overview/20220113-035836
git checkout 00f97c12e2cf0ba4ba1108e2fce9a3d0e287cc8c
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hv/dxgkrnl/
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/hv/dxgkrnl/dxgmodule.c:79:20: warning: no previous prototype for 'find_pci_adapter' [-Wmissing-prototypes]
79 | struct dxgadapter *find_pci_adapter(struct pci_dev *dev)
| ^~~~~~~~~~~~~~~~
>> drivers/hv/dxgkrnl/dxgmodule.c:135:6: warning: no previous prototype for 'signal_host_cpu_event' [-Wmissing-prototypes]
135 | void signal_host_cpu_event(struct dxghostevent *eventhdr)
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/hv/dxgkrnl/dxgmodule.c:219:5: warning: no previous prototype for 'dxgglobal_create_adapter' [-Wmissing-prototypes]
219 | int dxgglobal_create_adapter(struct pci_dev *dev, guid_t *guid,
| ^~~~~~~~~~~~~~~~~~~~~~~~
--
>> drivers/hv/dxgkrnl/dxgvmbus.c:116:5: warning: no previous prototype for 'ntstatus2int' [-Wmissing-prototypes]
116 | int ntstatus2int(struct ntstatus status)
| ^~~~~~~~~~~~
>> drivers/hv/dxgkrnl/dxgvmbus.c:219:6: warning: no previous prototype for 'process_inband_packet' [-Wmissing-prototypes]
219 | void process_inband_packet(struct dxgvmbuschannel *channel,
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/hv/dxgkrnl/dxgvmbus.c:237:6: warning: no previous prototype for 'process_completion_packet' [-Wmissing-prototypes]
237 | void process_completion_packet(struct dxgvmbuschannel *channel,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hv/dxgkrnl/dxgvmbus.c:363:5: warning: no previous prototype for 'dxgvmb_send_async_msg' [-Wmissing-prototypes]
363 | int dxgvmb_send_async_msg(struct dxgvmbuschannel *channel,
| ^~~~~~~~~~~~~~~~~~~~~
vim +/find_pci_adapter +79 drivers/hv/dxgkrnl/dxgmodule.c
78
> 79 struct dxgadapter *find_pci_adapter(struct pci_dev *dev)
80 {
81 struct dxgadapter *entry;
82 struct dxgadapter *adapter = NULL;
83
84 dxgglobal_acquire_adapter_list_lock(DXGLOCK_EXCL);
85
86 list_for_each_entry(entry, &dxgglobal->adapter_list_head,
87 adapter_list_entry) {
88 if (dev == entry->pci_dev) {
89 adapter = entry;
90 break;
91 }
92 }
93
94 dxgglobal_release_adapter_list_lock(DXGLOCK_EXCL);
95 return adapter;
96 }
97
98 static struct dxgadapter *find_adapter(struct winluid *luid)
99 {
100 struct dxgadapter *entry;
101 struct dxgadapter *adapter = NULL;
102
103 dxgglobal_acquire_adapter_list_lock(DXGLOCK_EXCL);
104
105 list_for_each_entry(entry, &dxgglobal->adapter_list_head,
106 adapter_list_entry) {
107 if (memcmp(luid, &entry->luid, sizeof(struct winluid)) == 0) {
108 adapter = entry;
109 break;
110 }
111 }
112
113 dxgglobal_release_adapter_list_lock(DXGLOCK_EXCL);
114 return adapter;
115 }
116
117 void dxgglobal_add_host_event(struct dxghostevent *event)
118 {
119 spin_lock_irq(&dxgglobal->host_event_list_mutex);
120 list_add_tail(&event->host_event_list_entry,
121 &dxgglobal->host_event_list_head);
122 spin_unlock_irq(&dxgglobal->host_event_list_mutex);
123 }
124
125 void dxgglobal_remove_host_event(struct dxghostevent *event)
126 {
127 spin_lock_irq(&dxgglobal->host_event_list_mutex);
128 if (event->host_event_list_entry.next != NULL) {
129 list_del(&event->host_event_list_entry);
130 event->host_event_list_entry.next = NULL;
131 }
132 spin_unlock_irq(&dxgglobal->host_event_list_mutex);
133 }
134
> 135 void signal_host_cpu_event(struct dxghostevent *eventhdr)
136 {
137 struct dxghosteventcpu *event = (struct dxghosteventcpu *)eventhdr;
138
139 if (event->remove_from_list ||
140 event->destroy_after_signal) {
141 list_del(&eventhdr->host_event_list_entry);
142 eventhdr->host_event_list_entry.next = NULL;
143 }
144 if (event->cpu_event) {
145 dev_dbg(dxgglobaldev, "signal cpu event\n");
146 eventfd_signal(event->cpu_event, 1);
147 if (event->destroy_after_signal)
148 eventfd_ctx_put(event->cpu_event);
149 } else {
150 dev_dbg(dxgglobaldev, "signal completion\n");
151 complete(event->completion_event);
152 }
153 if (event->destroy_after_signal) {
154 dev_dbg(dxgglobaldev, "destroying event %p\n",
155 event);
156 vfree(event);
157 }
158 }
159
160 void dxgglobal_signal_host_event(u64 event_id)
161 {
162 struct dxghostevent *event;
163 unsigned long flags;
164
165 dev_dbg(dxgglobaldev, "%s %lld\n", __func__, event_id);
166
167 spin_lock_irqsave(&dxgglobal->host_event_list_mutex, flags);
168 list_for_each_entry(event, &dxgglobal->host_event_list_head,
169 host_event_list_entry) {
170 if (event->event_id == event_id) {
171 dev_dbg(dxgglobaldev, "found event to signal %lld\n",
172 event_id);
173 if (event->event_type == dxghostevent_cpu_event)
174 signal_host_cpu_event(event);
175 else
176 pr_err("Unknown host event type");
177 break;
178 }
179 }
180 spin_unlock_irqrestore(&dxgglobal->host_event_list_mutex, flags);
181 dev_dbg(dxgglobaldev, "dxgglobal_signal_host_event_end %lld\n",
182 event_id);
183 }
184
185 struct dxghostevent *dxgglobal_get_host_event(u64 event_id)
186 {
187 struct dxghostevent *entry;
188 struct dxghostevent *event = NULL;
189
190 spin_lock_irq(&dxgglobal->host_event_list_mutex);
191 list_for_each_entry(entry, &dxgglobal->host_event_list_head,
192 host_event_list_entry) {
193 if (entry->event_id == event_id) {
194 list_del(&entry->host_event_list_entry);
195 entry->host_event_list_entry.next = NULL;
196 event = entry;
197 break;
198 }
199 }
200 spin_unlock_irq(&dxgglobal->host_event_list_mutex);
201 return event;
202 }
203
204 u64 dxgglobal_new_host_event_id(void)
205 {
206 return atomic64_inc_return(&dxgglobal->host_event_id);
207 }
208
209 void dxgglobal_acquire_process_adapter_lock(void)
210 {
211 mutex_lock(&dxgglobal->process_adapter_mutex);
212 }
213
214 void dxgglobal_release_process_adapter_lock(void)
215 {
216 mutex_unlock(&dxgglobal->process_adapter_mutex);
217 }
218
> 219 int dxgglobal_create_adapter(struct pci_dev *dev, guid_t *guid,
220 struct winluid host_vgpu_luid)
221 {
222 struct dxgadapter *adapter;
223 int ret = 0;
224
225 adapter = vzalloc(sizeof(struct dxgadapter));
226 if (adapter == NULL) {
227 ret = -ENOMEM;
228 goto cleanup;
229 }
230
231 adapter->adapter_state = DXGADAPTER_STATE_WAITING_VMBUS;
232 adapter->host_vgpu_luid = host_vgpu_luid;
233 kref_init(&adapter->adapter_kref);
234 init_rwsem(&adapter->core_lock);
235
236 INIT_LIST_HEAD(&adapter->adapter_process_list_head);
237 INIT_LIST_HEAD(&adapter->shared_resource_list_head);
238 INIT_LIST_HEAD(&adapter->adapter_shared_syncobj_list_head);
239 INIT_LIST_HEAD(&adapter->syncobj_list_head);
240 init_rwsem(&adapter->shared_resource_list_lock);
241 adapter->pci_dev = dev;
242 guid_to_luid(guid, &adapter->luid);
243
244 dxgglobal_acquire_adapter_list_lock(DXGLOCK_EXCL);
245
246 list_add_tail(&adapter->adapter_list_entry,
247 &dxgglobal->adapter_list_head);
248 dxgglobal->num_adapters++;
249 dxgglobal_release_adapter_list_lock(DXGLOCK_EXCL);
250
251 dev_dbg(dxgglobaldev, "new adapter added %p %x-%x\n", adapter,
252 adapter->luid.a, adapter->luid.b);
253 cleanup:
254 dev_dbg(dxgglobaldev, "%s end: %d", __func__, ret);
255 return ret;
256 }
257
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
[rmk-arm:clearfog 9/10] drivers/pci/pcie/aspm.c:581 pcie_aspm_cap_init() warn: inconsistent indenting
by kernel test robot
tree: git://git.armlinux.org.uk/~rmk/linux-arm clearfog
head: 27b69dc920b15953866994cb8b100311543699e8
commit: 6289d10eda064419c96bdbc966aadf3a6e0c43be [9/10] mvebu/clearfog pcie updates
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220113/202201130852.IDPlE7QI-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
drivers/pci/pcie/aspm.c:581 pcie_aspm_cap_init() warn: inconsistent indenting
vim +581 drivers/pci/pcie/aspm.c
542
543 static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
544 {
545 struct pci_dev *child = link->downstream, *parent = link->pdev;
546 u32 parent_lnkcap, child_lnkcap;
547 u16 parent_lnkctl, child_lnkctl;
548 u32 parent_l1ss_cap, child_l1ss_cap;
549 u32 parent_l1ss_ctl1 = 0, child_l1ss_ctl1 = 0;
550 struct pci_bus *linkbus = parent->subordinate;
551
552 if (blacklist) {
553 /* Set enabled/disable so that we will disable ASPM later */
554 link->aspm_enabled = ASPM_STATE_ALL;
555 link->aspm_disable = ASPM_STATE_ALL;
556 return;
557 }
558
559 /*
560 * If ASPM not supported, don't mess with the clocks and link,
561 * bail out now.
562 */
563 pcie_capability_read_dword(parent, PCI_EXP_LNKCAP, &parent_lnkcap);
564 pcie_capability_read_dword(child, PCI_EXP_LNKCAP, &child_lnkcap);
565 if (!(parent_lnkcap & child_lnkcap & PCI_EXP_LNKCAP_ASPMS))
566 return;
567
568 /* Configure common clock before checking latencies */
569 pcie_aspm_configure_common_clock(link);
570
571 /*
572 * Re-read upstream/downstream components' register state after
573 * clock configuration. L0s & L1 exit latencies in the otherwise
574 * read-only Link Capabilities may change depending on common clock
575 * configuration (PCIe r5.0, sec 7.5.3.6).
576 */
577 pcie_capability_read_dword(parent, PCI_EXP_LNKCAP, &parent_lnkcap);
578 pcie_capability_read_dword(child, PCI_EXP_LNKCAP, &child_lnkcap);
579 pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &parent_lnkctl);
580 pcie_capability_read_word(child, PCI_EXP_LNKCTL, &child_lnkctl);
> 581 dev_info(&parent->dev, "up support %x enabled %x\n",
582 (parent_lnkcap & PCI_EXP_LNKCAP_ASPMS) >> 10,
583 !!(parent_lnkctl & PCI_EXP_LNKCTL_ASPMC));
584 dev_info(&parent->dev, "dn support %x enabled %x\n",
585 (child_lnkcap & PCI_EXP_LNKCAP_ASPMS) >> 10,
586 !!(child_lnkctl & PCI_EXP_LNKCTL_ASPMC));
587
588 /*
589 * Setup L0s state
590 *
591 * Note that we must not enable L0s in either direction on a
592 * given link unless components on both sides of the link each
593 * support L0s.
594 */
595 if (parent_lnkcap & child_lnkcap & PCI_EXP_LNKCAP_ASPM_L0S)
596 link->aspm_support |= ASPM_STATE_L0S;
597
598 if (child_lnkctl & PCI_EXP_LNKCTL_ASPM_L0S)
599 link->aspm_enabled |= ASPM_STATE_L0S_UP;
600 if (parent_lnkctl & PCI_EXP_LNKCTL_ASPM_L0S)
601 link->aspm_enabled |= ASPM_STATE_L0S_DW;
602 link->latency_up.l0s = calc_l0s_latency(parent_lnkcap);
603 link->latency_dw.l0s = calc_l0s_latency(child_lnkcap);
604
605 /* Setup L1 state */
606 if (parent_lnkcap & child_lnkcap & PCI_EXP_LNKCAP_ASPM_L1)
607 link->aspm_support |= ASPM_STATE_L1;
608
609 if (parent_lnkctl & child_lnkctl & PCI_EXP_LNKCTL_ASPM_L1)
610 link->aspm_enabled |= ASPM_STATE_L1;
611 link->latency_up.l1 = calc_l1_latency(parent_lnkcap);
612 link->latency_dw.l1 = calc_l1_latency(child_lnkcap);
613
614 /* Setup L1 substate */
615 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CAP,
616 &parent_l1ss_cap);
617 pci_read_config_dword(child, child->l1ss + PCI_L1SS_CAP,
618 &child_l1ss_cap);
619
620 if (!(parent_l1ss_cap & PCI_L1SS_CAP_L1_PM_SS))
621 parent_l1ss_cap = 0;
622 if (!(child_l1ss_cap & PCI_L1SS_CAP_L1_PM_SS))
623 child_l1ss_cap = 0;
624
625 /*
626 * If we don't have LTR for the entire path from the Root Complex
627 * to this device, we can't use ASPM L1.2 because it relies on the
628 * LTR_L1.2_THRESHOLD. See PCIe r4.0, secs 5.5.4, 6.18.
629 */
630 if (!child->ltr_path)
631 child_l1ss_cap &= ~PCI_L1SS_CAP_ASPM_L1_2;
632
633 if (parent_l1ss_cap & child_l1ss_cap & PCI_L1SS_CAP_ASPM_L1_1)
634 link->aspm_support |= ASPM_STATE_L1_1;
635 if (parent_l1ss_cap & child_l1ss_cap & PCI_L1SS_CAP_ASPM_L1_2)
636 link->aspm_support |= ASPM_STATE_L1_2;
637 if (parent_l1ss_cap & child_l1ss_cap & PCI_L1SS_CAP_PCIPM_L1_1)
638 link->aspm_support |= ASPM_STATE_L1_1_PCIPM;
639 if (parent_l1ss_cap & child_l1ss_cap & PCI_L1SS_CAP_PCIPM_L1_2)
640 link->aspm_support |= ASPM_STATE_L1_2_PCIPM;
641
642 if (parent_l1ss_cap)
643 pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CTL1,
644 &parent_l1ss_ctl1);
645 if (child_l1ss_cap)
646 pci_read_config_dword(child, child->l1ss + PCI_L1SS_CTL1,
647 &child_l1ss_ctl1);
648
649 if (parent_l1ss_ctl1 & child_l1ss_ctl1 & PCI_L1SS_CTL1_ASPM_L1_1)
650 link->aspm_enabled |= ASPM_STATE_L1_1;
651 if (parent_l1ss_ctl1 & child_l1ss_ctl1 & PCI_L1SS_CTL1_ASPM_L1_2)
652 link->aspm_enabled |= ASPM_STATE_L1_2;
653 if (parent_l1ss_ctl1 & child_l1ss_ctl1 & PCI_L1SS_CTL1_PCIPM_L1_1)
654 link->aspm_enabled |= ASPM_STATE_L1_1_PCIPM;
655 if (parent_l1ss_ctl1 & child_l1ss_ctl1 & PCI_L1SS_CTL1_PCIPM_L1_2)
656 link->aspm_enabled |= ASPM_STATE_L1_2_PCIPM;
657
658 if (link->aspm_support & ASPM_STATE_L1SS)
659 aspm_calc_l1ss_info(link, parent_l1ss_cap, child_l1ss_cap);
660
661 /* Save default state */
662 link->aspm_default = link->aspm_enabled;
663
664 /* Setup initial capable state. Will be updated later */
665 link->aspm_capable = link->aspm_support;
666
667 /* Get and check endpoint acceptable latencies */
668 list_for_each_entry(child, &linkbus->devices, bus_list) {
669 u32 reg32, encoding;
670 struct aspm_latency *acceptable =
671 &link->acceptable[PCI_FUNC(child->devfn)];
672
673 if (pci_pcie_type(child) != PCI_EXP_TYPE_ENDPOINT &&
674 pci_pcie_type(child) != PCI_EXP_TYPE_LEG_END)
675 continue;
676
677 pcie_capability_read_dword(child, PCI_EXP_DEVCAP, ®32);
678 /* Calculate endpoint L0s acceptable latency */
679 encoding = (reg32 & PCI_EXP_DEVCAP_L0S) >> 6;
680 acceptable->l0s = calc_l0s_acceptable(encoding);
681 /* Calculate endpoint L1 acceptable latency */
682 encoding = (reg32 & PCI_EXP_DEVCAP_L1) >> 9;
683 acceptable->l1 = calc_l1_acceptable(encoding);
684
685 pcie_aspm_check_latency(child);
686 }
687 }
688
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
drivers/leds/simple/simatic-ipc-leds.c:42:17: sparse: sparse: symbol 'simatic_ipc_led_mem_res' was not declared. Should it be static?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f079ab01b5609fb0c9acc52c88168bf1eed82373
commit: 8c78e0614edc628b13313afd28856720b85d86a3 leds: simatic-ipc-leds: add new driver for Siemens Industial PCs
date: 3 weeks ago
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220113/202201130807.DvdFeysr-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8c78e0614edc628b13313afd28856720b85d86a3
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/leds/simple/ drivers/platform/x86/
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/leds/simple/simatic-ipc-leds.c:42:17: sparse: sparse: symbol 'simatic_ipc_led_mem_res' was not declared. Should it be static?
>> drivers/leds/simple/simatic-ipc-leds.c:155:40: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *static [toplevel] simatic_ipc_led_memory @@ got void [noderef] __iomem * @@
drivers/leds/simple/simatic-ipc-leds.c:155:40: sparse: expected void *static [toplevel] simatic_ipc_led_memory
drivers/leds/simple/simatic-ipc-leds.c:155:40: sparse: got void [noderef] __iomem *
vim +/simatic_ipc_led_mem_res +42 drivers/leds/simple/simatic-ipc-leds.c
40
41 /* the actual start will be discovered with PCI, 0 is a placeholder */
> 42 struct resource simatic_ipc_led_mem_res = DEFINE_RES_MEM_NAMED(0, SZ_4K, KBUILD_MODNAME);
43
44 static void *simatic_ipc_led_memory;
45
46 static struct simatic_ipc_led simatic_ipc_leds_mem[] = {
47 {0x500 + 0x1A0, "red:" LED_FUNCTION_STATUS "-1"},
48 {0x500 + 0x1A8, "green:" LED_FUNCTION_STATUS "-1"},
49 {0x500 + 0x1C8, "red:" LED_FUNCTION_STATUS "-2"},
50 {0x500 + 0x1D0, "green:" LED_FUNCTION_STATUS "-2"},
51 {0x500 + 0x1E0, "red:" LED_FUNCTION_STATUS "-3"},
52 {0x500 + 0x198, "green:" LED_FUNCTION_STATUS "-3"},
53 { }
54 };
55
56 static struct resource simatic_ipc_led_io_res =
57 DEFINE_RES_IO_NAMED(SIMATIC_IPC_LED_PORT_BASE, SZ_2, KBUILD_MODNAME);
58
59 static DEFINE_SPINLOCK(reg_lock);
60
61 static inline struct simatic_ipc_led *cdev_to_led(struct led_classdev *led_cd)
62 {
63 return container_of(led_cd, struct simatic_ipc_led, cdev);
64 }
65
66 static void simatic_ipc_led_set_io(struct led_classdev *led_cd,
67 enum led_brightness brightness)
68 {
69 struct simatic_ipc_led *led = cdev_to_led(led_cd);
70 unsigned long flags;
71 unsigned int val;
72
73 spin_lock_irqsave(®_lock, flags);
74
75 val = inw(SIMATIC_IPC_LED_PORT_BASE);
76 if (brightness == LED_OFF)
77 outw(val | led->value, SIMATIC_IPC_LED_PORT_BASE);
78 else
79 outw(val & ~led->value, SIMATIC_IPC_LED_PORT_BASE);
80
81 spin_unlock_irqrestore(®_lock, flags);
82 }
83
84 static enum led_brightness simatic_ipc_led_get_io(struct led_classdev *led_cd)
85 {
86 struct simatic_ipc_led *led = cdev_to_led(led_cd);
87
88 return inw(SIMATIC_IPC_LED_PORT_BASE) & led->value ? LED_OFF : led_cd->max_brightness;
89 }
90
91 static void simatic_ipc_led_set_mem(struct led_classdev *led_cd,
92 enum led_brightness brightness)
93 {
94 struct simatic_ipc_led *led = cdev_to_led(led_cd);
95
96 u32 *p;
97
98 p = simatic_ipc_led_memory + led->value;
99 *p = (*p & ~1) | (brightness == LED_OFF);
100 }
101
102 static enum led_brightness simatic_ipc_led_get_mem(struct led_classdev *led_cd)
103 {
104 struct simatic_ipc_led *led = cdev_to_led(led_cd);
105
106 u32 *p;
107
108 p = simatic_ipc_led_memory + led->value;
109 return (*p & 1) ? LED_OFF : led_cd->max_brightness;
110 }
111
112 static int simatic_ipc_leds_probe(struct platform_device *pdev)
113 {
114 const struct simatic_ipc_platform *plat = pdev->dev.platform_data;
115 struct device *dev = &pdev->dev;
116 struct simatic_ipc_led *ipcled;
117 struct led_classdev *cdev;
118 struct resource *res;
119 int err, type;
120 u32 *p;
121
122 switch (plat->devmode) {
123 case SIMATIC_IPC_DEVICE_227D:
124 case SIMATIC_IPC_DEVICE_427E:
125 res = &simatic_ipc_led_io_res;
126 ipcled = simatic_ipc_leds_io;
127 /* on 227D the two bytes work the other way araound */
128 if (plat->devmode == SIMATIC_IPC_DEVICE_227D) {
129 while (ipcled->value) {
130 ipcled->value = swab16(ipcled->value);
131 ipcled++;
132 }
133 ipcled = simatic_ipc_leds_io;
134 }
135 type = IORESOURCE_IO;
136 if (!devm_request_region(dev, res->start, resource_size(res), KBUILD_MODNAME)) {
137 dev_err(dev, "Unable to register IO resource at %pR\n", res);
138 return -EBUSY;
139 }
140 break;
141 case SIMATIC_IPC_DEVICE_127E:
142 res = &simatic_ipc_led_mem_res;
143 ipcled = simatic_ipc_leds_mem;
144 type = IORESOURCE_MEM;
145
146 /* get GPIO base from PCI */
147 res->start = simatic_ipc_get_membase0(PCI_DEVFN(13, 0));
148 if (res->start == 0)
149 return -ENODEV;
150
151 /* do the final address calculation */
152 res->start = res->start + (0xC5 << 16);
153 res->end += res->start;
154
> 155 simatic_ipc_led_memory = devm_ioremap_resource(dev, res);
156 if (IS_ERR(simatic_ipc_led_memory))
157 return PTR_ERR(simatic_ipc_led_memory);
158
159 /* initialize power/watchdog LED */
160 p = simatic_ipc_led_memory + 0x500 + 0x1D8; /* PM_WDT_OUT */
161 *p = (*p & ~1);
162 p = simatic_ipc_led_memory + 0x500 + 0x1C0; /* PM_BIOS_BOOT_N */
163 *p = (*p | 1);
164
165 break;
166 default:
167 return -ENODEV;
168 }
169
170 while (ipcled->value) {
171 cdev = &ipcled->cdev;
172 if (type == IORESOURCE_MEM) {
173 cdev->brightness_set = simatic_ipc_led_set_mem;
174 cdev->brightness_get = simatic_ipc_led_get_mem;
175 } else {
176 cdev->brightness_set = simatic_ipc_led_set_io;
177 cdev->brightness_get = simatic_ipc_led_get_io;
178 }
179 cdev->max_brightness = LED_ON;
180 cdev->name = ipcled->name;
181
182 err = devm_led_classdev_register(dev, cdev);
183 if (err < 0)
184 return err;
185 ipcled++;
186 }
187
188 return 0;
189 }
190
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week