[thesofproject:pr/3415 1/26] sound/soc/sof/topology.c:60:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const'
by kernel test robot
tree: https://github.com/thesofproject/linux pr/3415
head: 482e28f06bef4e2b04194dbca6e71bddb6baa0e0
commit: dd22c425deaa842639786db96212ac90e94cda8d [1/26] Fixup! ASoC: SOF: IPC: Introduce IPC ops
config: x86_64-sof-customedconfig-sof-defconfig (https://download.01.org/0day-ci/archive/20220211/202202110022.6FQCY2cP-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/thesofproject/linux/commit/dd22c425deaa842639786db9621...
git remote add thesofproject https://github.com/thesofproject/linux
git fetch --no-tags thesofproject pr/3415
git checkout dd22c425deaa842639786db96212ac90e94cda8d
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash sound/soc/sof/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the thesofproject/pr/3415 HEAD 482e28f06bef4e2b04194dbca6e71bddb6baa0e0 builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
sound/soc/sof/topology.c: In function 'sof_update_ipc_object':
>> sound/soc/sof/topology.c:60:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
60 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
>> sound/soc/sof/topology.c:61:56: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
61 | const struct sof_token_info *token_list = ipc_tplg_ops->token_list;
| ^~
sound/soc/sof/topology.c: In function 'set_up_volume_table':
sound/soc/sof/topology.c:268:40: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
268 | const struct ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:270:14: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
270 | if (tplg_ops->control->set_up_volume_table)
| ^~
sound/soc/sof/topology.c: In function 'sof_copy_tuples':
sound/soc/sof/topology.c:459:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
459 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:460:56: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
460 | const struct sof_token_info *token_list = ipc_tplg_ops->token_list;
| ^~
sound/soc/sof/topology.c: In function 'sof_control_unload':
sound/soc/sof/topology.c:960:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
960 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:966:18: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
966 | if (ipc_tplg_ops->control_free) {
| ^~
sound/soc/sof/topology.c: In function 'sof_widget_parse_tokens':
sound/soc/sof/topology.c:1091:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
1091 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:1092:56: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
1092 | const struct sof_token_info *token_list = ipc_tplg_ops->token_list;
| ^~
sound/soc/sof/topology.c: In function 'sof_widget_ready':
sound/soc/sof/topology.c:1176:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
1176 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:1177:61: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
1177 | const struct ipc_tplg_widget_ops *widget_ops = ipc_tplg_ops->widget;
| ^~
sound/soc/sof/topology.c:1201:25: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1201 | token_list = widget_ops[w->id].token_list;
| ^
sound/soc/sof/topology.c:1201:25: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_widget_ops'
sound/soc/sof/topology.c:1202:30: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1202 | token_list_size = widget_ops[w->id].token_list_size;
| ^
sound/soc/sof/topology.c:1286:17: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1286 | if (widget_ops[w->id].bind_event) {
| ^
sound/soc/sof/topology.c:1287:20: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1287 | ret = widget_ops[w->id].bind_event(scomp, swidget,
| ^
sound/soc/sof/topology.c: In function 'sof_widget_unload':
sound/soc/sof/topology.c:1326:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
1326 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:1327:61: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
1327 | const struct ipc_tplg_widget_ops *widget_ops = ipc_tplg_ops->widget;
| ^~
sound/soc/sof/topology.c:1384:16: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1384 | if (widget_ops[swidget->id].ipc_free)
| ^
sound/soc/sof/topology.c:1384:16: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_widget_ops'
sound/soc/sof/topology.c:1385:13: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1385 | widget_ops[swidget->id].ipc_free(swidget);
| ^
sound/soc/sof/topology.c: In function 'sof_link_load':
sound/soc/sof/topology.c:1542:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
1542 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:1543:56: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
1543 | const struct sof_token_info *token_list = ipc_tplg_ops->token_list;
| ^~
sound/soc/sof/topology.c: In function 'sof_complete':
sound/soc/sof/topology.c:1847:44: error: initialization of 'const struct ipc_tplg_ops *' from incompatible pointer type 'const struct sof_ipc_tplg_ops * const' [-Werror=incompatible-pointer-types]
1847 | const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
| ^~~~
sound/soc/sof/topology.c:1848:61: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_ops'
1848 | const struct ipc_tplg_widget_ops *widget_ops = ipc_tplg_ops->widget;
| ^~
sound/soc/sof/topology.c:1869:17: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1869 | if (widget_ops[swidget->id].ipc_setup) {
| ^
sound/soc/sof/topology.c:1869:17: error: dereferencing pointer to incomplete type 'const struct ipc_tplg_widget_ops'
sound/soc/sof/topology.c:1870:20: error: invalid use of undefined type 'struct ipc_tplg_widget_ops'
1870 | ret = widget_ops[swidget->id].ipc_setup(swidget);
| ^
cc1: some warnings being treated as errors
vim +60 sound/soc/sof/topology.c
311ce4fe7637d9 Liam Girdwood 2019-04-12 41
1907d3493e3d89 Ranjani Sridharan 2021-12-02 42 /**
1907d3493e3d89 Ranjani Sridharan 2021-12-02 43 * sof_update_ipc_object - Parse multiple sets of tokens within the token array associated with the
1907d3493e3d89 Ranjani Sridharan 2021-12-02 44 * token ID.
1907d3493e3d89 Ranjani Sridharan 2021-12-02 45 * @scomp: pointer to SOC component
1907d3493e3d89 Ranjani Sridharan 2021-12-02 46 * @object: target IPC struct to save the parsed values
1907d3493e3d89 Ranjani Sridharan 2021-12-02 47 * @token_id: token ID for the token array to be searched
1907d3493e3d89 Ranjani Sridharan 2021-12-02 48 * @tuples: pointer to the tuples array
1907d3493e3d89 Ranjani Sridharan 2021-12-02 49 * @num_tuples: number of tuples in the tuples array
1907d3493e3d89 Ranjani Sridharan 2021-12-02 50 * @object_size: size of the object
1907d3493e3d89 Ranjani Sridharan 2021-12-02 51 * @token_instance_num: number of times the same @token_id needs to be parsed i.e. the function
1907d3493e3d89 Ranjani Sridharan 2021-12-02 52 * looks for @token_instance_num of each token in the token array associated
1907d3493e3d89 Ranjani Sridharan 2021-12-02 53 * with the @token_id
1907d3493e3d89 Ranjani Sridharan 2021-12-02 54 */
1907d3493e3d89 Ranjani Sridharan 2021-12-02 55 int sof_update_ipc_object(struct snd_soc_component *scomp, void *object, enum sof_tokens token_id,
1907d3493e3d89 Ranjani Sridharan 2021-12-02 56 struct snd_sof_tuple *tuples, int num_tuples,
1907d3493e3d89 Ranjani Sridharan 2021-12-02 57 size_t object_size, int token_instance_num)
1907d3493e3d89 Ranjani Sridharan 2021-12-02 58 {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 59 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
1907d3493e3d89 Ranjani Sridharan 2021-12-02 @60 const struct ipc_tplg_ops *ipc_tplg_ops = sdev->ipc->ops->tplg;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 @61 const struct sof_token_info *token_list = ipc_tplg_ops->token_list;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 62 const struct sof_topology_token *tokens;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 63 int i, j;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 64
1907d3493e3d89 Ranjani Sridharan 2021-12-02 65 if (token_list[token_id].count < 0) {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 66 dev_err(scomp->dev, "Invalid token count for token ID: %d\n", token_id);
1907d3493e3d89 Ranjani Sridharan 2021-12-02 67 return -EINVAL;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 68 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 69
1907d3493e3d89 Ranjani Sridharan 2021-12-02 70 /* No tokens to match */
1907d3493e3d89 Ranjani Sridharan 2021-12-02 71 if (!token_list[token_id].count)
1907d3493e3d89 Ranjani Sridharan 2021-12-02 72 return 0;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 73
1907d3493e3d89 Ranjani Sridharan 2021-12-02 74 tokens = token_list[token_id].tokens;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 75 if (!tokens) {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 76 dev_err(scomp->dev, "Invalid tokens for token id: %d\n", token_id);
1907d3493e3d89 Ranjani Sridharan 2021-12-02 77 return -EINVAL;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 78 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 79
1907d3493e3d89 Ranjani Sridharan 2021-12-02 80 for (i = 0; i < token_list[token_id].count; i++) {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 81 int offset = 0;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 82 int num_tokens_matched = 0;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 83
1907d3493e3d89 Ranjani Sridharan 2021-12-02 84 for (j = 0; j < num_tuples; j++) {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 85 if (tokens[i].token == tuples[j].token) {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 86 switch (tokens[i].type) {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 87 case SND_SOC_TPLG_TUPLE_TYPE_WORD:
1907d3493e3d89 Ranjani Sridharan 2021-12-02 88 {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 89 u32 *val = (u32 *)((u8 *)object + tokens[i].offset +
1907d3493e3d89 Ranjani Sridharan 2021-12-02 90 offset);
1907d3493e3d89 Ranjani Sridharan 2021-12-02 91
1907d3493e3d89 Ranjani Sridharan 2021-12-02 92 *val = tuples[j].value.v;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 93 break;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 94 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 95 case SND_SOC_TPLG_TUPLE_TYPE_SHORT:
1907d3493e3d89 Ranjani Sridharan 2021-12-02 96 case SND_SOC_TPLG_TUPLE_TYPE_BOOL:
1907d3493e3d89 Ranjani Sridharan 2021-12-02 97 {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 98 u16 *val = (u16 *)((u8 *)object + tokens[i].offset +
1907d3493e3d89 Ranjani Sridharan 2021-12-02 99 offset);
1907d3493e3d89 Ranjani Sridharan 2021-12-02 100
1907d3493e3d89 Ranjani Sridharan 2021-12-02 101 *val = (u16)tuples[j].value.v;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 102 break;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 103 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 104 case SND_SOC_TPLG_TUPLE_TYPE_STRING:
1907d3493e3d89 Ranjani Sridharan 2021-12-02 105 {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 106 if (!tokens[i].get_token) {
1907d3493e3d89 Ranjani Sridharan 2021-12-02 107 dev_err(scomp->dev,
1907d3493e3d89 Ranjani Sridharan 2021-12-02 108 "get_token not defined for token %d in %s\n",
1907d3493e3d89 Ranjani Sridharan 2021-12-02 109 tokens[i].token, token_list[token_id].name);
1907d3493e3d89 Ranjani Sridharan 2021-12-02 110 return -EINVAL;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 111 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 112
1907d3493e3d89 Ranjani Sridharan 2021-12-02 113 tokens[i].get_token((void *)tuples[j].value.s, object,
1907d3493e3d89 Ranjani Sridharan 2021-12-02 114 tokens[i].offset + offset);
1907d3493e3d89 Ranjani Sridharan 2021-12-02 115 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 116 default:
1907d3493e3d89 Ranjani Sridharan 2021-12-02 117 break;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 118 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 119
1907d3493e3d89 Ranjani Sridharan 2021-12-02 120 num_tokens_matched++;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 121
1907d3493e3d89 Ranjani Sridharan 2021-12-02 122 /* found all required sets of current token. Move to the next one */
1907d3493e3d89 Ranjani Sridharan 2021-12-02 123 if (!(num_tokens_matched % token_instance_num))
1907d3493e3d89 Ranjani Sridharan 2021-12-02 124 break;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 125
1907d3493e3d89 Ranjani Sridharan 2021-12-02 126 /* move to the next object */
1907d3493e3d89 Ranjani Sridharan 2021-12-02 127 offset += object_size;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 128 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 129 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 130 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 131
1907d3493e3d89 Ranjani Sridharan 2021-12-02 132 return 0;
1907d3493e3d89 Ranjani Sridharan 2021-12-02 133 }
1907d3493e3d89 Ranjani Sridharan 2021-12-02 134
:::::: The code at line 60 was first introduced by commit
:::::: 1907d3493e3d89ee9a66b2b3f33b8a9104f15826 ASoC: SOF: topology: Add helper function for processing tuple arrays
:::::: TO: Ranjani Sridharan <ranjani.sridharan(a)linux.intel.com>
:::::: CC: Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[intel-lts:5.10/yocto 19439/20393] drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:608:20: warning: comparison of array 'eb->batch_len' equal to a null pointer is always false
by kernel test robot
Hi Matthew,
FYI, the error/warning still remains.
tree: https://github.com/intel/linux-intel-lts.git 5.10/yocto
head: 2dafc777a64181d42982628c7f5907a03da5f070
commit: 95eed6488ef2ab6d7947630f596a1764cbfa31bc [19439/20393] drm/i915: Multi-BB execbuf
config: x86_64-randconfig-a005 (https://download.01.org/0day-ci/archive/20220211/202202110057.No0NHBR9-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project aa845d7a245d85c441d0bd44fc7b6c3be8f3de8d)
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/intel/linux-intel-lts/commit/95eed6488ef2ab6d7947630f5...
git remote add intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-lts 5.10/yocto
git checkout 95eed6488ef2ab6d7947630f596a1764cbfa31bc
# 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=x86_64 SHELL=/bin/bash arch/x86/crypto/ drivers/gpu/drm/i915/
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/gpu/drm/i915/gem/i915_gem_execbuffer.c:608:20: warning: comparison of array 'eb->batch_len' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (unlikely(eb->batch_len == 0)) { /* impossible! */
~~~~^~~~~~~~~ ~
include/linux/compiler.h:48:41: note: expanded from macro 'unlikely'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^
include/linux/compiler.h:33:34: note: expanded from macro '__branch_check__'
______r = __builtin_expect(!!(x), expect); \
^
>> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:608:20: warning: comparison of array 'eb->batch_len' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (unlikely(eb->batch_len == 0)) { /* impossible! */
~~~~^~~~~~~~~ ~
include/linux/compiler.h:48:68: note: expanded from macro 'unlikely'
# define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
^
include/linux/compiler.h:35:19: note: expanded from macro '__branch_check__'
expect, is_constant); \
^~~~~~~~~~~
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1848:2: error: expected statement
for_each_batch_add_order(eb, i)
^
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1840:49: note: expanded from macro 'for_each_batch_add_order'
for (_i = _eb->num_batches - 1; _i >= 0; --_i) \
^
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1848:33: error: expected ';' after do/while statement
for_each_batch_add_order(eb, i)
^
;
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1912:3: error: expected statement
for_each_batch_add_order(eb, j) {
^
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1840:49: note: expanded from macro 'for_each_batch_add_order'
for (_i = _eb->num_batches - 1; _i >= 0; --_i) \
^
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1912:34: error: expected ';' after do/while statement
for_each_batch_add_order(eb, j) {
^
;
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2880:2: error: expected statement
for_each_batch_add_order(eb, i) {
^
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1840:49: note: expanded from macro 'for_each_batch_add_order'
for (_i = _eb->num_batches - 1; _i >= 0; --_i) \
^
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2880:33: error: expected ';' after do/while statement
for_each_batch_add_order(eb, i) {
^
;
2 warnings and 6 errors generated.
vim +608 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
548
549 static int
550 eb_add_vma(struct i915_execbuffer *eb,
551 unsigned int *current_batch,
552 unsigned int i,
553 struct i915_vma *vma)
554 {
555 struct drm_i915_private *i915 = eb->i915;
556 struct drm_i915_gem_exec_object2 *entry = &eb->exec[i];
557 struct eb_vma *ev = &eb->vma[i];
558
559 ev->vma = vma;
560 ev->exec = entry;
561 ev->flags = entry->flags;
562
563 if (eb->lut_size > 0) {
564 ev->handle = entry->handle;
565 hlist_add_head(&ev->node,
566 &eb->buckets[hash_32(entry->handle,
567 eb->lut_size)]);
568 }
569
570 if (entry->relocation_count)
571 list_add_tail(&ev->reloc_link, &eb->relocs);
572
573 /*
574 * SNA is doing fancy tricks with compressing batch buffers, which leads
575 * to negative relocation deltas. Usually that works out ok since the
576 * relocate address is still positive, except when the batch is placed
577 * very low in the GTT. Ensure this doesn't happen.
578 *
579 * Note that actual hangs have only been observed on gen7, but for
580 * paranoia do it everywhere.
581 */
582 if (is_batch_buffer(eb, i)) {
583 if (entry->relocation_count &&
584 !(ev->flags & EXEC_OBJECT_PINNED))
585 ev->flags |= __EXEC_OBJECT_NEEDS_BIAS;
586 if (eb->reloc_cache.has_fence)
587 ev->flags |= EXEC_OBJECT_NEEDS_FENCE;
588
589 eb->batches[*current_batch] = ev;
590
591 if (unlikely(ev->flags & EXEC_OBJECT_WRITE)) {
592 drm_dbg(&i915->drm,
593 "Attempting to use self-modifying batch buffer\n");
594 return -EINVAL;
595 }
596
597 if (range_overflows_t(u64,
598 eb->batch_start_offset,
599 eb->args->batch_len,
600 ev->vma->size)) {
601 drm_dbg(&i915->drm, "Attempting to use out-of-bounds batch\n");
602 return -EINVAL;
603 }
604
605 if (eb->args->batch_len == 0)
606 eb->batch_len[*current_batch] = ev->vma->size -
607 eb->batch_start_offset;
> 608 if (unlikely(eb->batch_len == 0)) { /* impossible! */
609 drm_dbg(&i915->drm, "Invalid batch length\n");
610 return -EINVAL;
611 }
612
613 ++*current_batch;
614 }
615
616 return 0;
617 }
618
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[intel-lts:5.10/yocto 10630/20393] drivers/media/i2c/ar0234.c:2102:13: warning: no previous prototype for 'ar0234_threaded_irq_fn'
by kernel test robot
Hi Ng,
FYI, the error/warning still remains.
tree: https://github.com/intel/linux-intel-lts.git 5.10/yocto
head: 2dafc777a64181d42982628c7f5907a03da5f070
commit: 2def42a616c1ceec2eb739c6befb6af42f6ee22c [10630/20393] Fix compile issue
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220211/202202110027.oCcxne4v-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/intel/linux-intel-lts/commit/2def42a616c1ceec2eb739c6b...
git remote add intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-lts 5.10/yocto
git checkout 2def42a616c1ceec2eb739c6befb6af42f6ee22c
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/crypto/ drivers/gpio/ drivers/gpu/drm/i915/ drivers/media/i2c/
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/media/i2c/ar0234.c: In function 'ar0234_start_streaming':
drivers/media/i2c/ar0234.c:1757:6: warning: unused variable 'val' [-Wunused-variable]
1757 | u32 val;
| ^~~
drivers/media/i2c/ar0234.c: At top level:
>> drivers/media/i2c/ar0234.c:2102:13: warning: no previous prototype for 'ar0234_threaded_irq_fn' [-Wmissing-prototypes]
2102 | irqreturn_t ar0234_threaded_irq_fn(int irq, void *dev_id)
| ^~~~~~~~~~~~~~~~~~~~~~
--
drivers/media/i2c/imx390.c: In function 'get_hblank':
drivers/media/i2c/imx390.c:422:6: warning: unused variable 'pixel_clk' [-Wunused-variable]
422 | u64 pixel_clk;
| ^~~~~~~~~
drivers/media/i2c/imx390.c:421:6: warning: unused variable 'pixel_rate' [-Wunused-variable]
421 | u64 pixel_rate;
| ^~~~~~~~~~
drivers/media/i2c/imx390.c: In function 'imx390_exposure_raw_set':
>> drivers/media/i2c/imx390.c:439:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
439 | struct imx390_reg exposure_array[] = {
| ^~~~~~
drivers/media/i2c/imx390.c:429:6: warning: unused variable 'err' [-Wunused-variable]
429 | int err = 0;
| ^~~
drivers/media/i2c/imx390.c: In function 'imx390_set_ctrl':
drivers/media/i2c/imx390.c:502:6: warning: unused variable 'val' [-Wunused-variable]
502 | u32 val;
| ^~~
drivers/media/i2c/imx390.c:500:6: warning: unused variable 'exposure_max' [-Wunused-variable]
500 | s64 exposure_max;
| ^~~~~~~~~~~~
drivers/media/i2c/imx390.c: In function 'imx390_init_controls':
drivers/media/i2c/imx390.c:542:26: warning: unused variable 'cfg' [-Wunused-variable]
542 | struct v4l2_ctrl_config cfg = { 0 };
| ^~~
drivers/media/i2c/imx390.c:540:6: warning: unused variable 'exposure_max' [-Wunused-variable]
540 | s64 exposure_max;
| ^~~~~~~~~~~~
drivers/media/i2c/imx390.c:538:21: warning: unused variable 'client' [-Wunused-variable]
538 | struct i2c_client *client = v4l2_get_subdevdata(&imx390->sd);
| ^~~~~~
drivers/media/i2c/imx390.c: At top level:
>> drivers/media/i2c/imx390.c:941:13: warning: no previous prototype for 'imx390_threaded_irq_fn' [-Wmissing-prototypes]
941 | irqreturn_t imx390_threaded_irq_fn(int irq, void *dev_id)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/imx390.c:402:12: warning: 'imx390_update_digital_gain' defined but not used [-Wunused-function]
402 | static int imx390_update_digital_gain(struct imx390 *imx390, u32 d_gain)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/imx390.c:340:12: warning: 'imx390_gain_raw_set' defined but not used [-Wunused-function]
340 | static int imx390_gain_raw_set(struct imx390 *self, u16 gain)
| ^~~~~~~~~~~~~~~~~~~
drivers/media/i2c/imx390.c: In function 'get_pixel_rate':
drivers/media/i2c/imx390.c:411:9: warning: 'pixel_rate' is used uninitialized in this function [-Wuninitialized]
411 | return pixel_rate;
| ^~~~~~~~~~
drivers/media/i2c/imx390.c: In function 'get_hblank':
drivers/media/i2c/imx390.c:424:9: warning: 'hblank' is used uninitialized in this function [-Wuninitialized]
424 | return hblank;
| ^~~~~~
vim +/ar0234_threaded_irq_fn +2102 drivers/media/i2c/ar0234.c
1aafb1e0df5527 Ng Khai Wen 2021-07-01 2101
1aafb1e0df5527 Ng Khai Wen 2021-07-01 @2102 irqreturn_t ar0234_threaded_irq_fn(int irq, void *dev_id)
1aafb1e0df5527 Ng Khai Wen 2021-07-01 2103 {
1aafb1e0df5527 Ng Khai Wen 2021-07-01 2104 return IRQ_HANDLED;
1aafb1e0df5527 Ng Khai Wen 2021-07-01 2105 }
1aafb1e0df5527 Ng Khai Wen 2021-07-01 2106
:::::: The code at line 2102 was first introduced by commit
:::::: 1aafb1e0df5527884ad5ccb67ec95414df4d85f7 Add IPU driver
:::::: TO: Ng Khai Wen <khai.wen.ng(a)intel.com>
:::::: CC: Pan, Kris <kris.pan(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[xilinx-xlnx:xlnx_rebase_v5.15 480/923] include/linux/cpumask.h:95:42: error: enumerator value for 'FIX_KMAP_END' is not an integer constant
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head: 966124532656bc95d781abf57531e4cd4f962237
commit: 23b920bb9d53a7fcb8e9938f70228ae4d137f244 [480/923] microblaze: Enable experimental SMP functionality
config: microblaze-randconfig-r023-20220210 (https://download.01.org/0day-ci/archive/20220210/202202102317.n7MAKI54-lk...)
compiler: microblaze-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/Xilinx/linux-xlnx/commit/23b920bb9d53a7fcb8e9938f70228...
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15
git checkout 23b920bb9d53a7fcb8e9938f70228ae4d137f244
# 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=microblaze SHELL=/bin/bash arch/microblaze/kernel/ mm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from arch/microblaze/kernel/ptrace.c:28:
>> include/linux/cpumask.h:95:42: error: enumerator value for 'FIX_KMAP_END' is not an integer constant
95 | #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
| ^~~~~~~
include/linux/cpumask.h:889:48: note: in expansion of macro 'cpu_possible_mask'
889 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
| ^~~~~~~~~~~~~~~~~
arch/microblaze/include/asm/fixmap.h:50:55: note: in expansion of macro 'num_possible_cpus'
50 | FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * num_possible_cpus()) - 1,
| ^~~~~~~~~~~~~~~~~
--
>> arch/microblaze/kernel/smp.c:156:6: warning: no previous prototype for 'crash___smp_cross_call' [-Wmissing-prototypes]
156 | void crash___smp_cross_call(void (*crash_ipi_callback)(struct pt_regs *))
| ^~~~~~~~~~~~~~~~~~~~~~
arch/microblaze/kernel/smp.c: In function 'smp_prepare_cpus':
>> arch/microblaze/kernel/smp.c:197:43: warning: parameter 'max_cpus' set but not used [-Wunused-but-set-parameter]
197 | void __init smp_prepare_cpus(unsigned int max_cpus)
| ~~~~~~~~~~~~~^~~~~~~~
--
In file included from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from mm/vmscan.c:15:
>> include/linux/cpumask.h:95:42: error: enumerator value for 'FIX_KMAP_END' is not an integer constant
95 | #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
| ^~~~~~~
include/linux/cpumask.h:889:48: note: in expansion of macro 'cpu_possible_mask'
889 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
| ^~~~~~~~~~~~~~~~~
arch/microblaze/include/asm/fixmap.h:50:55: note: in expansion of macro 'num_possible_cpus'
50 | FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * num_possible_cpus()) - 1,
| ^~~~~~~~~~~~~~~~~
mm/vmscan.c: In function 'demote_page_list':
mm/vmscan.c:1340:13: warning: variable 'err' set but not used [-Wunused-but-set-variable]
1340 | int err;
| ^~~
--
In file included from mm/percpu.c:72:
>> include/linux/cpumask.h:95:42: error: enumerator value for 'FIX_KMAP_END' is not an integer constant
95 | #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
| ^~~~~~~
include/linux/cpumask.h:889:48: note: in expansion of macro 'cpu_possible_mask'
889 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
| ^~~~~~~~~~~~~~~~~
arch/microblaze/include/asm/fixmap.h:50:55: note: in expansion of macro 'num_possible_cpus'
50 | FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * num_possible_cpus()) - 1,
| ^~~~~~~~~~~~~~~~~
mm/percpu.c:3030:12: warning: no previous prototype for 'pcpu_embed_first_chunk' [-Wmissing-prototypes]
3030 | int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
| ^~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/rcupdate.h:29,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from mm/compaction.c:11:
>> include/linux/cpumask.h:95:42: error: enumerator value for 'FIX_KMAP_END' is not an integer constant
95 | #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
| ^~~~~~~
include/linux/cpumask.h:889:48: note: in expansion of macro 'cpu_possible_mask'
889 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
| ^~~~~~~~~~~~~~~~~
arch/microblaze/include/asm/fixmap.h:50:55: note: in expansion of macro 'num_possible_cpus'
50 | FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * num_possible_cpus()) - 1,
| ^~~~~~~~~~~~~~~~~
mm/compaction.c:56:27: warning: 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' defined but not used [-Wunused-const-variable=]
56 | static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/smp.h:13,
from include/linux/lockdep.h:14,
from include/linux/spinlock.h:63,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from mm/page_alloc.c:19:
>> include/linux/cpumask.h:95:42: error: enumerator value for 'FIX_KMAP_END' is not an integer constant
95 | #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
| ^~~~~~~
include/linux/cpumask.h:889:48: note: in expansion of macro 'cpu_possible_mask'
889 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
| ^~~~~~~~~~~~~~~~~
arch/microblaze/include/asm/fixmap.h:50:55: note: in expansion of macro 'num_possible_cpus'
50 | FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * num_possible_cpus()) - 1,
| ^~~~~~~~~~~~~~~~~
mm/page_alloc.c:3812:15: warning: no previous prototype for 'should_fail_alloc_page' [-Wmissing-prototypes]
3812 | noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/FIX_KMAP_END +95 include/linux/cpumask.h
^1da177e4c3f41 Linus Torvalds 2005-04-16 49
^1da177e4c3f41 Linus Torvalds 2005-04-16 50 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 51 * The following particular system cpumasks and operations manage
b3199c025d1646 Rusty Russell 2008-12-30 52 * possible, present, active and online cpus.
^1da177e4c3f41 Linus Torvalds 2005-04-16 53 *
b3199c025d1646 Rusty Russell 2008-12-30 54 * cpu_possible_mask- has bit 'cpu' set iff cpu is populatable
b3199c025d1646 Rusty Russell 2008-12-30 55 * cpu_present_mask - has bit 'cpu' set iff cpu is populated
b3199c025d1646 Rusty Russell 2008-12-30 56 * cpu_online_mask - has bit 'cpu' set iff cpu available to scheduler
b3199c025d1646 Rusty Russell 2008-12-30 57 * cpu_active_mask - has bit 'cpu' set iff cpu available to migration
^1da177e4c3f41 Linus Torvalds 2005-04-16 58 *
b3199c025d1646 Rusty Russell 2008-12-30 59 * If !CONFIG_HOTPLUG_CPU, present == possible, and active == online.
^1da177e4c3f41 Linus Torvalds 2005-04-16 60 *
b3199c025d1646 Rusty Russell 2008-12-30 61 * The cpu_possible_mask is fixed at boot time, as the set of CPU id's
b3199c025d1646 Rusty Russell 2008-12-30 62 * that it is possible might ever be plugged in at anytime during the
b3199c025d1646 Rusty Russell 2008-12-30 63 * life of that system boot. The cpu_present_mask is dynamic(*),
b3199c025d1646 Rusty Russell 2008-12-30 64 * representing which CPUs are currently plugged in. And
b3199c025d1646 Rusty Russell 2008-12-30 65 * cpu_online_mask is the dynamic subset of cpu_present_mask,
b3199c025d1646 Rusty Russell 2008-12-30 66 * indicating those CPUs available for scheduling.
b3199c025d1646 Rusty Russell 2008-12-30 67 *
b3199c025d1646 Rusty Russell 2008-12-30 68 * If HOTPLUG is enabled, then cpu_possible_mask is forced to have
^1da177e4c3f41 Linus Torvalds 2005-04-16 69 * all NR_CPUS bits set, otherwise it is just the set of CPUs that
^1da177e4c3f41 Linus Torvalds 2005-04-16 70 * ACPI reports present at boot.
^1da177e4c3f41 Linus Torvalds 2005-04-16 71 *
b3199c025d1646 Rusty Russell 2008-12-30 72 * If HOTPLUG is enabled, then cpu_present_mask varies dynamically,
^1da177e4c3f41 Linus Torvalds 2005-04-16 73 * depending on what ACPI reports as currently plugged in, otherwise
b3199c025d1646 Rusty Russell 2008-12-30 74 * cpu_present_mask is just a copy of cpu_possible_mask.
^1da177e4c3f41 Linus Torvalds 2005-04-16 75 *
b3199c025d1646 Rusty Russell 2008-12-30 76 * (*) Well, cpu_present_mask is dynamic in the hotplug case. If not
b3199c025d1646 Rusty Russell 2008-12-30 77 * hotplug, it's a copy of cpu_possible_mask, hence fixed at boot.
^1da177e4c3f41 Linus Torvalds 2005-04-16 78 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 79 * Subtleties:
^1da177e4c3f41 Linus Torvalds 2005-04-16 80 * 1) UP arch's (NR_CPUS == 1, CONFIG_SMP not defined) hardcode
^1da177e4c3f41 Linus Torvalds 2005-04-16 81 * assumption that their single CPU is online. The UP
b3199c025d1646 Rusty Russell 2008-12-30 82 * cpu_{online,possible,present}_masks are placebos. Changing them
^1da177e4c3f41 Linus Torvalds 2005-04-16 83 * will have no useful affect on the following num_*_cpus()
^1da177e4c3f41 Linus Torvalds 2005-04-16 84 * and cpu_*() macros in the UP case. This ugliness is a UP
^1da177e4c3f41 Linus Torvalds 2005-04-16 85 * optimization - don't waste any instructions or memory references
^1da177e4c3f41 Linus Torvalds 2005-04-16 86 * asking if you're online or how many CPUs there are if there is
^1da177e4c3f41 Linus Torvalds 2005-04-16 87 * only one CPU.
^1da177e4c3f41 Linus Torvalds 2005-04-16 88 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 89
4b804c85dc37db Rasmus Villemoes 2016-01-20 90 extern struct cpumask __cpu_possible_mask;
4b804c85dc37db Rasmus Villemoes 2016-01-20 91 extern struct cpumask __cpu_online_mask;
4b804c85dc37db Rasmus Villemoes 2016-01-20 92 extern struct cpumask __cpu_present_mask;
4b804c85dc37db Rasmus Villemoes 2016-01-20 93 extern struct cpumask __cpu_active_mask;
e40f74c535b8a0 Peter Zijlstra 2021-01-19 94 extern struct cpumask __cpu_dying_mask;
5aec01b834fd6f Rasmus Villemoes 2016-01-20 @95 #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
5aec01b834fd6f Rasmus Villemoes 2016-01-20 96 #define cpu_online_mask ((const struct cpumask *)&__cpu_online_mask)
5aec01b834fd6f Rasmus Villemoes 2016-01-20 97 #define cpu_present_mask ((const struct cpumask *)&__cpu_present_mask)
5aec01b834fd6f Rasmus Villemoes 2016-01-20 98 #define cpu_active_mask ((const struct cpumask *)&__cpu_active_mask)
e40f74c535b8a0 Peter Zijlstra 2021-01-19 99 #define cpu_dying_mask ((const struct cpumask *)&__cpu_dying_mask)
b3199c025d1646 Rusty Russell 2008-12-30 100
:::::: The code at line 95 was first introduced by commit
:::::: 5aec01b834fd6f8ca49d1aeede665b950d0c148e kernel/cpu.c: eliminate cpu_*_mask
:::::: TO: Rasmus Villemoes <linux(a)rasmusvillemoes.dk>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[intel-lts:5.10/yocto 16678/20393] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_psr.c:113:25: warning: suggest braces around empty body in an 'else' statement
by kernel test robot
Hi Wyatt,
FYI, the error/warning still remains.
tree: https://github.com/intel/linux-intel-lts.git 5.10/yocto
head: 2dafc777a64181d42982628c7f5907a03da5f070
commit: 42e7487e09a6c68c1e22340048eb99a987e986f5 [16678/20393] drm/amd/display: Add ETW log to dmub_psr_get_state
config: x86_64-randconfig-a011 (https://download.01.org/0day-ci/archive/20220210/202202102308.Og7tgZdm-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/intel/linux-intel-lts/commit/42e7487e09a6c68c1e2234004...
git remote add intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-lts 5.10/yocto
git checkout 42e7487e09a6c68c1e22340048eb99a987e986f5
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/ drivers/gpu/
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/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_psr.c: In function 'dmub_psr_get_state':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_psr.c:113:25: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
113 | *state, retry_count);
| ^
vim +/else +113 drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_psr.c
78
79 /*
80 * Get PSR state from firmware.
81 */
82 static void dmub_psr_get_state(struct dmub_psr *dmub, enum dc_psr_state *state, uint8_t panel_inst)
83 {
84 struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
85 uint32_t raw_state = 0;
86 uint32_t retry_count = 0;
87 enum dmub_status status;
88
89 do {
90 // Send gpint command and wait for ack
91 status = dmub_srv_send_gpint_command(srv, DMUB_GPINT__GET_PSR_STATE, panel_inst, 30);
92
93 if (status == DMUB_STATUS_OK) {
94 // GPINT was executed, get response
95 dmub_srv_get_gpint_response(srv, &raw_state);
96 *state = convert_psr_state(raw_state);
97 } else
98 // Return invalid state when GPINT times out
99 *state = PSR_STATE_INVALID;
100
101 } while (++retry_count <= 1000 && *state == PSR_STATE_INVALID);
102
103 // Assert if max retry hit
104 if (retry_count >= 1000 && *state == PSR_STATE_INVALID) {
105 ASSERT(0);
106 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_ERROR,
107 WPP_BIT_FLAG_Firmware_PsrState,
108 "Unable to get PSR state from FW.");
109 } else
110 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_VERBOSE,
111 WPP_BIT_FLAG_Firmware_PsrState,
112 "Got PSR state from FW. PSR state: %d, Retry count: %d",
> 113 *state, retry_count);
114 }
115
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[hch-misc:pgmap-refcount 14/27] mm/migrate_device.c:236:3: error: implicit declaration of function 'flush_tlb_range'; did you mean 'flush_pmd_tlb_range'?
by kernel test robot
tree: git://git.infradead.org/users/hch/misc.git pgmap-refcount
head: 0ac1434894ef0abc44e26edeabf0761eeb861f12
commit: eebcce4f8a487c1b2865cae00a41e6cf83cb9e60 [14/27] mm: build migrate_vma_* for all configs with ZONE_DEVICE support
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20220210/202202102240.RJGD8Yw6-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add hch-misc git://git.infradead.org/users/hch/misc.git
git fetch --no-tags hch-misc pgmap-refcount
git checkout eebcce4f8a487c1b2865cae00a41e6cf83cb9e60
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 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 >>):
mm/migrate_device.c: In function 'migrate_vma_collect_pmd':
>> mm/migrate_device.c:236:3: error: implicit declaration of function 'flush_tlb_range'; did you mean 'flush_pmd_tlb_range'? [-Werror=implicit-function-declaration]
236 | flush_tlb_range(walk->vma, start, end);
| ^~~~~~~~~~~~~~~
| flush_pmd_tlb_range
cc1: some warnings being treated as errors
vim +236 mm/migrate_device.c
1a520c048d761b Christoph Hellwig 2022-02-10 54
1a520c048d761b Christoph Hellwig 2022-02-10 55 static int migrate_vma_collect_pmd(pmd_t *pmdp,
1a520c048d761b Christoph Hellwig 2022-02-10 56 unsigned long start,
1a520c048d761b Christoph Hellwig 2022-02-10 57 unsigned long end,
1a520c048d761b Christoph Hellwig 2022-02-10 58 struct mm_walk *walk)
1a520c048d761b Christoph Hellwig 2022-02-10 59 {
1a520c048d761b Christoph Hellwig 2022-02-10 60 struct migrate_vma *migrate = walk->private;
1a520c048d761b Christoph Hellwig 2022-02-10 61 struct vm_area_struct *vma = walk->vma;
1a520c048d761b Christoph Hellwig 2022-02-10 62 struct mm_struct *mm = vma->vm_mm;
1a520c048d761b Christoph Hellwig 2022-02-10 63 unsigned long addr = start, unmapped = 0;
1a520c048d761b Christoph Hellwig 2022-02-10 64 spinlock_t *ptl;
1a520c048d761b Christoph Hellwig 2022-02-10 65 pte_t *ptep;
1a520c048d761b Christoph Hellwig 2022-02-10 66
1a520c048d761b Christoph Hellwig 2022-02-10 67 again:
1a520c048d761b Christoph Hellwig 2022-02-10 68 if (pmd_none(*pmdp))
1a520c048d761b Christoph Hellwig 2022-02-10 69 return migrate_vma_collect_hole(start, end, -1, walk);
1a520c048d761b Christoph Hellwig 2022-02-10 70
1a520c048d761b Christoph Hellwig 2022-02-10 71 if (pmd_trans_huge(*pmdp)) {
1a520c048d761b Christoph Hellwig 2022-02-10 72 struct page *page;
1a520c048d761b Christoph Hellwig 2022-02-10 73
1a520c048d761b Christoph Hellwig 2022-02-10 74 ptl = pmd_lock(mm, pmdp);
1a520c048d761b Christoph Hellwig 2022-02-10 75 if (unlikely(!pmd_trans_huge(*pmdp))) {
1a520c048d761b Christoph Hellwig 2022-02-10 76 spin_unlock(ptl);
1a520c048d761b Christoph Hellwig 2022-02-10 77 goto again;
1a520c048d761b Christoph Hellwig 2022-02-10 78 }
1a520c048d761b Christoph Hellwig 2022-02-10 79
1a520c048d761b Christoph Hellwig 2022-02-10 80 page = pmd_page(*pmdp);
1a520c048d761b Christoph Hellwig 2022-02-10 81 if (is_huge_zero_page(page)) {
1a520c048d761b Christoph Hellwig 2022-02-10 82 spin_unlock(ptl);
1a520c048d761b Christoph Hellwig 2022-02-10 83 split_huge_pmd(vma, pmdp, addr);
1a520c048d761b Christoph Hellwig 2022-02-10 84 if (pmd_trans_unstable(pmdp))
1a520c048d761b Christoph Hellwig 2022-02-10 85 return migrate_vma_collect_skip(start, end,
1a520c048d761b Christoph Hellwig 2022-02-10 86 walk);
1a520c048d761b Christoph Hellwig 2022-02-10 87 } else {
1a520c048d761b Christoph Hellwig 2022-02-10 88 int ret;
1a520c048d761b Christoph Hellwig 2022-02-10 89
1a520c048d761b Christoph Hellwig 2022-02-10 90 get_page(page);
1a520c048d761b Christoph Hellwig 2022-02-10 91 spin_unlock(ptl);
1a520c048d761b Christoph Hellwig 2022-02-10 92 if (unlikely(!trylock_page(page)))
1a520c048d761b Christoph Hellwig 2022-02-10 93 return migrate_vma_collect_skip(start, end,
1a520c048d761b Christoph Hellwig 2022-02-10 94 walk);
1a520c048d761b Christoph Hellwig 2022-02-10 95 ret = split_huge_page(page);
1a520c048d761b Christoph Hellwig 2022-02-10 96 unlock_page(page);
1a520c048d761b Christoph Hellwig 2022-02-10 97 put_page(page);
1a520c048d761b Christoph Hellwig 2022-02-10 98 if (ret)
1a520c048d761b Christoph Hellwig 2022-02-10 99 return migrate_vma_collect_skip(start, end,
1a520c048d761b Christoph Hellwig 2022-02-10 100 walk);
1a520c048d761b Christoph Hellwig 2022-02-10 101 if (pmd_none(*pmdp))
1a520c048d761b Christoph Hellwig 2022-02-10 102 return migrate_vma_collect_hole(start, end, -1,
1a520c048d761b Christoph Hellwig 2022-02-10 103 walk);
1a520c048d761b Christoph Hellwig 2022-02-10 104 }
1a520c048d761b Christoph Hellwig 2022-02-10 105 }
1a520c048d761b Christoph Hellwig 2022-02-10 106
1a520c048d761b Christoph Hellwig 2022-02-10 107 if (unlikely(pmd_bad(*pmdp)))
1a520c048d761b Christoph Hellwig 2022-02-10 108 return migrate_vma_collect_skip(start, end, walk);
1a520c048d761b Christoph Hellwig 2022-02-10 109
1a520c048d761b Christoph Hellwig 2022-02-10 110 ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
1a520c048d761b Christoph Hellwig 2022-02-10 111 arch_enter_lazy_mmu_mode();
1a520c048d761b Christoph Hellwig 2022-02-10 112
1a520c048d761b Christoph Hellwig 2022-02-10 113 for (; addr < end; addr += PAGE_SIZE, ptep++) {
1a520c048d761b Christoph Hellwig 2022-02-10 114 unsigned long mpfn = 0, pfn;
1a520c048d761b Christoph Hellwig 2022-02-10 115 struct page *page;
1a520c048d761b Christoph Hellwig 2022-02-10 116 swp_entry_t entry;
1a520c048d761b Christoph Hellwig 2022-02-10 117 pte_t pte;
1a520c048d761b Christoph Hellwig 2022-02-10 118
1a520c048d761b Christoph Hellwig 2022-02-10 119 pte = *ptep;
1a520c048d761b Christoph Hellwig 2022-02-10 120
1a520c048d761b Christoph Hellwig 2022-02-10 121 if (pte_none(pte)) {
1a520c048d761b Christoph Hellwig 2022-02-10 122 if (vma_is_anonymous(vma)) {
1a520c048d761b Christoph Hellwig 2022-02-10 123 mpfn = MIGRATE_PFN_MIGRATE;
1a520c048d761b Christoph Hellwig 2022-02-10 124 migrate->cpages++;
1a520c048d761b Christoph Hellwig 2022-02-10 125 }
1a520c048d761b Christoph Hellwig 2022-02-10 126 goto next;
1a520c048d761b Christoph Hellwig 2022-02-10 127 }
1a520c048d761b Christoph Hellwig 2022-02-10 128
1a520c048d761b Christoph Hellwig 2022-02-10 129 if (!pte_present(pte)) {
1a520c048d761b Christoph Hellwig 2022-02-10 130 /*
1a520c048d761b Christoph Hellwig 2022-02-10 131 * Only care about unaddressable device page special
1a520c048d761b Christoph Hellwig 2022-02-10 132 * page table entry. Other special swap entries are not
1a520c048d761b Christoph Hellwig 2022-02-10 133 * migratable, and we ignore regular swapped page.
1a520c048d761b Christoph Hellwig 2022-02-10 134 */
1a520c048d761b Christoph Hellwig 2022-02-10 135 entry = pte_to_swp_entry(pte);
1a520c048d761b Christoph Hellwig 2022-02-10 136 if (!is_device_private_entry(entry))
1a520c048d761b Christoph Hellwig 2022-02-10 137 goto next;
1a520c048d761b Christoph Hellwig 2022-02-10 138
1a520c048d761b Christoph Hellwig 2022-02-10 139 page = pfn_swap_entry_to_page(entry);
1a520c048d761b Christoph Hellwig 2022-02-10 140 if (!(migrate->flags &
1a520c048d761b Christoph Hellwig 2022-02-10 141 MIGRATE_VMA_SELECT_DEVICE_PRIVATE) ||
1a520c048d761b Christoph Hellwig 2022-02-10 142 page->pgmap->owner != migrate->pgmap_owner)
1a520c048d761b Christoph Hellwig 2022-02-10 143 goto next;
1a520c048d761b Christoph Hellwig 2022-02-10 144
1a520c048d761b Christoph Hellwig 2022-02-10 145 mpfn = migrate_pfn(page_to_pfn(page)) |
1a520c048d761b Christoph Hellwig 2022-02-10 146 MIGRATE_PFN_MIGRATE;
1a520c048d761b Christoph Hellwig 2022-02-10 147 if (is_writable_device_private_entry(entry))
1a520c048d761b Christoph Hellwig 2022-02-10 148 mpfn |= MIGRATE_PFN_WRITE;
1a520c048d761b Christoph Hellwig 2022-02-10 149 } else {
1a520c048d761b Christoph Hellwig 2022-02-10 150 if (!(migrate->flags & MIGRATE_VMA_SELECT_SYSTEM))
1a520c048d761b Christoph Hellwig 2022-02-10 151 goto next;
1a520c048d761b Christoph Hellwig 2022-02-10 152 pfn = pte_pfn(pte);
1a520c048d761b Christoph Hellwig 2022-02-10 153 if (is_zero_pfn(pfn)) {
1a520c048d761b Christoph Hellwig 2022-02-10 154 mpfn = MIGRATE_PFN_MIGRATE;
1a520c048d761b Christoph Hellwig 2022-02-10 155 migrate->cpages++;
1a520c048d761b Christoph Hellwig 2022-02-10 156 goto next;
1a520c048d761b Christoph Hellwig 2022-02-10 157 }
1a520c048d761b Christoph Hellwig 2022-02-10 158 page = vm_normal_page(migrate->vma, addr, pte);
1a520c048d761b Christoph Hellwig 2022-02-10 159 mpfn = migrate_pfn(pfn) | MIGRATE_PFN_MIGRATE;
1a520c048d761b Christoph Hellwig 2022-02-10 160 mpfn |= pte_write(pte) ? MIGRATE_PFN_WRITE : 0;
1a520c048d761b Christoph Hellwig 2022-02-10 161 }
1a520c048d761b Christoph Hellwig 2022-02-10 162
1a520c048d761b Christoph Hellwig 2022-02-10 163 /* FIXME support THP */
1a520c048d761b Christoph Hellwig 2022-02-10 164 if (!page || !page->mapping || PageTransCompound(page)) {
1a520c048d761b Christoph Hellwig 2022-02-10 165 mpfn = 0;
1a520c048d761b Christoph Hellwig 2022-02-10 166 goto next;
1a520c048d761b Christoph Hellwig 2022-02-10 167 }
1a520c048d761b Christoph Hellwig 2022-02-10 168
1a520c048d761b Christoph Hellwig 2022-02-10 169 /*
1a520c048d761b Christoph Hellwig 2022-02-10 170 * By getting a reference on the page we pin it and that blocks
1a520c048d761b Christoph Hellwig 2022-02-10 171 * any kind of migration. Side effect is that it "freezes" the
1a520c048d761b Christoph Hellwig 2022-02-10 172 * pte.
1a520c048d761b Christoph Hellwig 2022-02-10 173 *
1a520c048d761b Christoph Hellwig 2022-02-10 174 * We drop this reference after isolating the page from the lru
1a520c048d761b Christoph Hellwig 2022-02-10 175 * for non device page (device page are not on the lru and thus
1a520c048d761b Christoph Hellwig 2022-02-10 176 * can't be dropped from it).
1a520c048d761b Christoph Hellwig 2022-02-10 177 */
1a520c048d761b Christoph Hellwig 2022-02-10 178 get_page(page);
1a520c048d761b Christoph Hellwig 2022-02-10 179
1a520c048d761b Christoph Hellwig 2022-02-10 180 /*
1a520c048d761b Christoph Hellwig 2022-02-10 181 * Optimize for the common case where page is only mapped once
1a520c048d761b Christoph Hellwig 2022-02-10 182 * in one process. If we can lock the page, then we can safely
1a520c048d761b Christoph Hellwig 2022-02-10 183 * set up a special migration page table entry now.
1a520c048d761b Christoph Hellwig 2022-02-10 184 */
1a520c048d761b Christoph Hellwig 2022-02-10 185 if (trylock_page(page)) {
1a520c048d761b Christoph Hellwig 2022-02-10 186 pte_t swp_pte;
1a520c048d761b Christoph Hellwig 2022-02-10 187
1a520c048d761b Christoph Hellwig 2022-02-10 188 migrate->cpages++;
1a520c048d761b Christoph Hellwig 2022-02-10 189 ptep_get_and_clear(mm, addr, ptep);
1a520c048d761b Christoph Hellwig 2022-02-10 190
1a520c048d761b Christoph Hellwig 2022-02-10 191 /* Setup special migration page table entry */
1a520c048d761b Christoph Hellwig 2022-02-10 192 if (mpfn & MIGRATE_PFN_WRITE)
1a520c048d761b Christoph Hellwig 2022-02-10 193 entry = make_writable_migration_entry(
1a520c048d761b Christoph Hellwig 2022-02-10 194 page_to_pfn(page));
1a520c048d761b Christoph Hellwig 2022-02-10 195 else
1a520c048d761b Christoph Hellwig 2022-02-10 196 entry = make_readable_migration_entry(
1a520c048d761b Christoph Hellwig 2022-02-10 197 page_to_pfn(page));
1a520c048d761b Christoph Hellwig 2022-02-10 198 swp_pte = swp_entry_to_pte(entry);
1a520c048d761b Christoph Hellwig 2022-02-10 199 if (pte_present(pte)) {
1a520c048d761b Christoph Hellwig 2022-02-10 200 if (pte_soft_dirty(pte))
1a520c048d761b Christoph Hellwig 2022-02-10 201 swp_pte = pte_swp_mksoft_dirty(swp_pte);
1a520c048d761b Christoph Hellwig 2022-02-10 202 if (pte_uffd_wp(pte))
1a520c048d761b Christoph Hellwig 2022-02-10 203 swp_pte = pte_swp_mkuffd_wp(swp_pte);
1a520c048d761b Christoph Hellwig 2022-02-10 204 } else {
1a520c048d761b Christoph Hellwig 2022-02-10 205 if (pte_swp_soft_dirty(pte))
1a520c048d761b Christoph Hellwig 2022-02-10 206 swp_pte = pte_swp_mksoft_dirty(swp_pte);
1a520c048d761b Christoph Hellwig 2022-02-10 207 if (pte_swp_uffd_wp(pte))
1a520c048d761b Christoph Hellwig 2022-02-10 208 swp_pte = pte_swp_mkuffd_wp(swp_pte);
1a520c048d761b Christoph Hellwig 2022-02-10 209 }
1a520c048d761b Christoph Hellwig 2022-02-10 210 set_pte_at(mm, addr, ptep, swp_pte);
1a520c048d761b Christoph Hellwig 2022-02-10 211
1a520c048d761b Christoph Hellwig 2022-02-10 212 /*
1a520c048d761b Christoph Hellwig 2022-02-10 213 * This is like regular unmap: we remove the rmap and
1a520c048d761b Christoph Hellwig 2022-02-10 214 * drop page refcount. Page won't be freed, as we took
1a520c048d761b Christoph Hellwig 2022-02-10 215 * a reference just above.
1a520c048d761b Christoph Hellwig 2022-02-10 216 */
1a520c048d761b Christoph Hellwig 2022-02-10 217 page_remove_rmap(page, false);
1a520c048d761b Christoph Hellwig 2022-02-10 218 put_page(page);
1a520c048d761b Christoph Hellwig 2022-02-10 219
1a520c048d761b Christoph Hellwig 2022-02-10 220 if (pte_present(pte))
1a520c048d761b Christoph Hellwig 2022-02-10 221 unmapped++;
1a520c048d761b Christoph Hellwig 2022-02-10 222 } else {
1a520c048d761b Christoph Hellwig 2022-02-10 223 put_page(page);
1a520c048d761b Christoph Hellwig 2022-02-10 224 mpfn = 0;
1a520c048d761b Christoph Hellwig 2022-02-10 225 }
1a520c048d761b Christoph Hellwig 2022-02-10 226
1a520c048d761b Christoph Hellwig 2022-02-10 227 next:
1a520c048d761b Christoph Hellwig 2022-02-10 228 migrate->dst[migrate->npages] = 0;
1a520c048d761b Christoph Hellwig 2022-02-10 229 migrate->src[migrate->npages++] = mpfn;
1a520c048d761b Christoph Hellwig 2022-02-10 230 }
1a520c048d761b Christoph Hellwig 2022-02-10 231 arch_leave_lazy_mmu_mode();
1a520c048d761b Christoph Hellwig 2022-02-10 232 pte_unmap_unlock(ptep - 1, ptl);
1a520c048d761b Christoph Hellwig 2022-02-10 233
1a520c048d761b Christoph Hellwig 2022-02-10 234 /* Only flush the TLB if we actually modified any entries */
1a520c048d761b Christoph Hellwig 2022-02-10 235 if (unmapped)
1a520c048d761b Christoph Hellwig 2022-02-10 @236 flush_tlb_range(walk->vma, start, end);
1a520c048d761b Christoph Hellwig 2022-02-10 237
1a520c048d761b Christoph Hellwig 2022-02-10 238 return 0;
1a520c048d761b Christoph Hellwig 2022-02-10 239 }
1a520c048d761b Christoph Hellwig 2022-02-10 240
:::::: The code at line 236 was first introduced by commit
:::::: 1a520c048d761b0437c33b9663013799539ea4d3 mm: move the migrate_vma_* device migration code into it's own file
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Christoph Hellwig <hch(a)lst.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week