[chrome-os:chromeos-5.4 9998/9999] net/bluetooth/aosp.c:256:10: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'size_t' {aka 'long unsigned int'}
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: e49b215c996cd58949812f549dd65b0f6c7706bf
commit: bd678f05a7058d1c81ab5640f6e5fe6109175bee [9998/9999] CHROMIUM: Bluetooth: surface AOSP quality report through mgmt
config: x86_64-randconfig-a013 (https://download.01.org/0day-ci/archive/20220113/202201131512.zF6BU5Ah-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout bd678f05a7058d1c81ab5640f6e5fe6109175bee
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash net/bluetooth/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from net/bluetooth/aosp.c:6:
net/bluetooth/aosp.c: In function 'aosp_pull_quality_report_data':
>> net/bluetooth/aosp.c:256:10: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
256 | BT_ERR("AOSP evt data len %d too short (%u expected)",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257 | skb->len, bqr_data_len);
| ~~~~~~~~~~~~
| |
| size_t {aka long unsigned int}
include/net/bluetooth/bluetooth.h:166:19: note: in definition of macro 'BT_ERR'
166 | bt_err(BT_PREFIX fmt "\n" BT_PREFIX_PARAM, ##__VA_ARGS__)
| ^~~
net/bluetooth/aosp.c:256:44: note: format string is defined here
256 | BT_ERR("AOSP evt data len %d too short (%u expected)",
| ~^
| |
| unsigned int
| %lu
vim +256 net/bluetooth/aosp.c
245
246 bool aosp_pull_quality_report_data(struct sk_buff *skb)
247 {
248 size_t bqr_data_len = sizeof(struct bqr_data);
249
250 skb_pull(skb, sizeof(struct aosp_hci_vs_data));
251
252 /* skb->len is allowed to be larger than bqr_data_len to have
253 * the Vendor Specific Parameter (vsp) field.
254 */
255 if (skb->len < bqr_data_len) {
> 256 BT_ERR("AOSP evt data len %d too short (%u expected)",
---
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 v5 08/13] peci: Add support for PECI device drivers
by kernel test robot
Hi Iwona,
I love your patch! Perhaps something to improve:
[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on linux/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/Iwona-Winiarska/Introduce-PECI-s...
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: hexagon-randconfig-r033-20220113 (https://download.01.org/0day-ci/archive/20220113/202201131534.HcDrC30f-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d1021978b8e7e35dcc30201ca1731d64b5a602a8)
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/0c9888d465568adc8526df1407c9a75be...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Iwona-Winiarska/Introduce-PECI-subsystem/20220113-071131
git checkout 0c9888d465568adc8526df1407c9a75be5ce6cd4
# 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=hexagon SHELL=/bin/bash drivers/peci/
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/peci/request.c:111:23: warning: address of array 'req->rx.buf' will always evaluate to 'true' [-Wpointer-bool-conversion]
if (WARN_ON(!req->rx.buf))
~~~~~~~~~^~~
include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
1 warning generated.
vim +111 drivers/peci/request.c
101
102 static int peci_request_xfer_retry(struct peci_request *req)
103 {
104 long wait_interval = PECI_RETRY_INTERVAL_MIN;
105 struct peci_device *device = req->device;
106 struct peci_controller *controller = to_peci_controller(device->dev.parent);
107 unsigned long start = jiffies;
108 int ret;
109
110 /* Don't try to use it for ping */
> 111 if (WARN_ON(!req->rx.buf))
112 return 0;
113
114 do {
115 ret = peci_request_xfer(req);
116 if (ret) {
117 dev_dbg(&controller->dev, "xfer error: %d\n", ret);
118 return ret;
119 }
120
121 if (peci_request_status(req) != -EAGAIN)
122 return 0;
123
124 /* Set the retry bit to indicate a retry attempt */
125 req->tx.buf[1] |= PECI_RETRY_BIT;
126
127 if (schedule_timeout_interruptible(wait_interval))
128 return -ERESTARTSYS;
129
130 wait_interval = min_t(long, wait_interval * 2, PECI_RETRY_INTERVAL_MAX);
131 } while (time_before(jiffies, start + PECI_RETRY_TIMEOUT));
132
133 dev_dbg(&controller->dev, "request timed out\n");
134
135 return -ETIMEDOUT;
136 }
137
---
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 2/9] drivers: hv: dxgkrnl: Open device object, adapter enumeration, dxgdevice, dxgcontext creation
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-20220113]
[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: arm64-randconfig-r032-20220113 (https://download.01.org/0day-ci/archive/20220113/202201131549.w952i85x-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d1021978b8e7e35dcc30201ca1731d64b5a602a8)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/91a8d0866d1c0efc52ca8e1cb504e0ec1...
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 91a8d0866d1c0efc52ca8e1cb504e0ec15c979e2
# 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=arm64 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/hmgr.c:85:5: warning: no previous prototype for function 'get_instance' [-Wmissing-prototypes]
u32 get_instance(struct d3dkmthandle h)
^
drivers/hv/dxgkrnl/hmgr.c:85:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 get_instance(struct d3dkmthandle h)
^
static
>> drivers/hv/dxgkrnl/hmgr.c:172:6: warning: no previous prototype for function 'print_status' [-Wmissing-prototypes]
void print_status(struct hmgrtable *table)
^
drivers/hv/dxgkrnl/hmgr.c:172:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void print_status(struct hmgrtable *table)
^
static
>> drivers/hv/dxgkrnl/hmgr.c:551:21: warning: no previous prototype for function 'hmgrtable_get_entry_type' [-Wmissing-prototypes]
enum hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^
drivers/hv/dxgkrnl/hmgr.c:551:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
enum hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^
static
drivers/hv/dxgkrnl/hmgr.c:167:20: warning: unused function 'is_empty' [-Wunused-function]
static inline bool is_empty(struct hmgrtable *table)
^
4 warnings generated.
--
>> drivers/hv/dxgkrnl/dxgadapter.c:261:6: warning: no previous prototype for function 'dxgdevice_mark_destroyed' [-Wmissing-prototypes]
void dxgdevice_mark_destroyed(struct dxgdevice *device)
^
drivers/hv/dxgkrnl/dxgadapter.c:261:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void dxgdevice_mark_destroyed(struct dxgdevice *device)
^
static
1 warning generated.
vim +/get_instance +85 drivers/hv/dxgkrnl/hmgr.c
84
> 85 u32 get_instance(struct d3dkmthandle h)
86 {
87 return (h.v & HMGRHANDLE_INSTANCE_MASK) >> HMGRHANDLE_INSTANCE_SHIFT;
88 }
89
90 static bool is_handle_valid(struct hmgrtable *table, struct d3dkmthandle h,
91 bool ignore_destroyed, enum hmgrentry_type t)
92 {
93 u32 index = get_index(h);
94 u32 unique = get_unique(h);
95 struct hmgrentry *entry;
96
97 if (index >= table->table_size) {
98 pr_err("%s Invalid index %x %d\n", __func__, h.v, index);
99 return false;
100 }
101
102 entry = &table->entry_table[index];
103 if (unique != entry->unique) {
104 pr_err("%s Invalid unique %x %d %d %d %p",
105 __func__, h.v, unique, entry->unique,
106 index, entry->object);
107 return false;
108 }
109
110 if (entry->destroyed && !ignore_destroyed) {
111 pr_err("%s Invalid destroyed", __func__);
112 return false;
113 }
114
115 if (entry->type == HMGRENTRY_TYPE_FREE) {
116 pr_err("%s Entry is freed %x %d", __func__, h.v, index);
117 return false;
118 }
119
120 if (t != HMGRENTRY_TYPE_FREE && t != entry->type) {
121 pr_err("%s type mismatch %x %d %d", __func__, h.v,
122 t, entry->type);
123 return false;
124 }
125
126 return true;
127 }
128
129 static struct d3dkmthandle build_handle(u32 index, u32 unique, u32 instance)
130 {
131 struct d3dkmthandle handle;
132
133 handle.v = (index << HMGRHANDLE_INDEX_SHIFT) & HMGRHANDLE_INDEX_MASK;
134 handle.v |= (unique << HMGRHANDLE_UNIQUE_SHIFT) &
135 HMGRHANDLE_UNIQUE_MASK;
136 handle.v |= (instance << HMGRHANDLE_INSTANCE_SHIFT) &
137 HMGRHANDLE_INSTANCE_MASK;
138
139 return handle;
140 }
141
142 inline u32 hmgrtable_get_used_entry_count(struct hmgrtable *table)
143 {
144 DXGKRNL_ASSERT(table->table_size >= table->free_count);
145 return (table->table_size - table->free_count);
146 }
147
148 bool hmgrtable_mark_destroyed(struct hmgrtable *table, struct d3dkmthandle h)
149 {
150 if (!is_handle_valid(table, h, false, HMGRENTRY_TYPE_FREE))
151 return false;
152
153 table->entry_table[get_index(h)].destroyed = true;
154 return true;
155 }
156
157 bool hmgrtable_unmark_destroyed(struct hmgrtable *table, struct d3dkmthandle h)
158 {
159 if (!is_handle_valid(table, h, true, HMGRENTRY_TYPE_FREE))
160 return true;
161
162 DXGKRNL_ASSERT(table->entry_table[get_index(h)].destroyed);
163 table->entry_table[get_index(h)].destroyed = 0;
164 return true;
165 }
166
167 static inline bool is_empty(struct hmgrtable *table)
168 {
169 return (table->free_count == table->table_size);
170 }
171
> 172 void print_status(struct hmgrtable *table)
173 {
174 int i;
175
176 dev_dbg(dxgglobaldev, "hmgrtable head, tail %p %d %d\n",
177 table, table->free_handle_list_head,
178 table->free_handle_list_tail);
179 if (table->entry_table == NULL)
180 return;
181 for (i = 0; i < 3; i++) {
182 if (table->entry_table[i].type != HMGRENTRY_TYPE_FREE)
183 dev_dbg(dxgglobaldev, "hmgrtable entry %p %d %p\n",
184 table, i, table->entry_table[i].object);
185 else
186 dev_dbg(dxgglobaldev, "hmgrtable entry %p %d %d %d\n",
187 table, i,
188 table->entry_table[i].next_free_index,
189 table->entry_table[i].prev_free_index);
190 }
191 }
192
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
drivers/dma/bestcomm/gen_bd.c:145:22: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 455e73a07f6e288b0061dfcf4fcf54fa9fe06458
commit: adec566b05288f2787a1f88dbaf77ed8b0c644fa dmaengine: bestcomm: fix system boot lockups
date: 3 months ago
config: powerpc-randconfig-s032-20220113 (https://download.01.org/0day-ci/archive/20220113/202201131500.CJesWOtX-lk...)
compiler: powerpc-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.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 adec566b05288f2787a1f88dbaf77ed8b0c644fa
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/dma/bestcomm/
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/dma/bestcomm/gen_bd.c:169:25: sparse: sparse: function 'bcom_gen_bd_tx_init' with external linkage has definition
>> drivers/dma/bestcomm/gen_bd.c:145:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got struct bcom_bd *bd @@
drivers/dma/bestcomm/gen_bd.c:145:22: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/gen_bd.c:145:22: sparse: got struct bcom_bd *bd
drivers/dma/bestcomm/gen_bd.c:229:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got struct bcom_bd *bd @@
drivers/dma/bestcomm/gen_bd.c:229:22: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/gen_bd.c:229:22: sparse: got struct bcom_bd *bd
--
>> drivers/dma/bestcomm/bestcomm.c:98:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got struct bcom_bd *bd @@
drivers/dma/bestcomm/bestcomm.c:98:30: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/bestcomm.c:98:30: sparse: got struct bcom_bd *bd
>> drivers/dma/bestcomm/bestcomm.c:189:19: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got unsigned int [usertype] *[assigned] var @@
drivers/dma/bestcomm/bestcomm.c:189:19: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/bestcomm.c:189:19: sparse: got unsigned int [usertype] *[assigned] var
>> drivers/dma/bestcomm/bestcomm.c:190:19: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got unsigned int [usertype] *[assigned] inc @@
drivers/dma/bestcomm/bestcomm.c:190:19: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/bestcomm.c:190:19: sparse: got unsigned int [usertype] *[assigned] inc
>> drivers/dma/bestcomm/bestcomm.c:196:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *d @@ got unsigned int [usertype] *[assigned] desc @@
drivers/dma/bestcomm/bestcomm.c:196:21: sparse: expected void volatile [noderef] __iomem *d
drivers/dma/bestcomm/bestcomm.c:196:21: sparse: got unsigned int [usertype] *[assigned] desc
>> drivers/dma/bestcomm/bestcomm.c:197:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *d @@ got unsigned int [usertype] * @@
drivers/dma/bestcomm/bestcomm.c:197:25: sparse: expected void volatile [noderef] __iomem *d
drivers/dma/bestcomm/bestcomm.c:197:25: sparse: got unsigned int [usertype] *
>> drivers/dma/bestcomm/bestcomm.c:198:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *d @@ got unsigned int [usertype] *[assigned] inc @@
drivers/dma/bestcomm/bestcomm.c:198:21: sparse: expected void volatile [noderef] __iomem *d
drivers/dma/bestcomm/bestcomm.c:198:21: sparse: got unsigned int [usertype] *[assigned] inc
>> drivers/dma/bestcomm/bestcomm.c:305:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got struct bcom_tdt *tdt @@
drivers/dma/bestcomm/bestcomm.c:305:27: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/bestcomm.c:305:27: sparse: got struct bcom_tdt *tdt
>> drivers/dma/bestcomm/bestcomm.c:306:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got unsigned int [usertype] *ctx @@
drivers/dma/bestcomm/bestcomm.c:306:27: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/bestcomm.c:306:27: sparse: got unsigned int [usertype] *ctx
>> drivers/dma/bestcomm/bestcomm.c:307:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got unsigned int [usertype] *var @@
drivers/dma/bestcomm/bestcomm.c:307:27: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/bestcomm.c:307:27: sparse: got unsigned int [usertype] *var
>> drivers/dma/bestcomm/bestcomm.c:308:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *a @@ got unsigned int [usertype] *fdt @@
drivers/dma/bestcomm/bestcomm.c:308:27: sparse: expected void volatile [noderef] __iomem *a
drivers/dma/bestcomm/bestcomm.c:308:27: sparse: got unsigned int [usertype] *fdt
drivers/dma/bestcomm/bestcomm.c:311:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *d @@ got unsigned int [usertype] * @@
drivers/dma/bestcomm/bestcomm.c:311:35: sparse: expected void volatile [noderef] __iomem *d
drivers/dma/bestcomm/bestcomm.c:311:35: sparse: got unsigned int [usertype] *
vim +145 drivers/dma/bestcomm/gen_bd.c
112
113 int
114 bcom_gen_bd_rx_reset(struct bcom_task *tsk)
115 {
116 struct bcom_gen_bd_priv *priv = tsk->priv;
117 struct bcom_gen_bd_rx_var *var;
118 struct bcom_gen_bd_rx_inc *inc;
119
120 /* Shutdown the task */
121 bcom_disable_task(tsk->tasknum);
122
123 /* Reset the microcode */
124 var = (struct bcom_gen_bd_rx_var *) bcom_task_var(tsk->tasknum);
125 inc = (struct bcom_gen_bd_rx_inc *) bcom_task_inc(tsk->tasknum);
126
127 if (bcom_load_image(tsk->tasknum, bcom_gen_bd_rx_task))
128 return -1;
129
130 var->enable = bcom_eng->regs_base +
131 offsetof(struct mpc52xx_sdma, tcr[tsk->tasknum]);
132 var->fifo = (u32) priv->fifo;
133 var->bd_base = tsk->bd_pa;
134 var->bd_last = tsk->bd_pa + ((tsk->num_bd-1) * tsk->bd_size);
135 var->bd_start = tsk->bd_pa;
136 var->buffer_size = priv->maxbufsize;
137
138 inc->incr_bytes = -(s16)sizeof(u32);
139 inc->incr_dst = sizeof(u32);
140
141 /* Reset the BDs */
142 tsk->index = 0;
143 tsk->outdex = 0;
144
> 145 memset_io(tsk->bd, 0x00, tsk->num_bd * tsk->bd_size);
146
147 /* Configure some stuff */
148 bcom_set_task_pragma(tsk->tasknum, BCOM_GEN_RX_BD_PRAGMA);
149 bcom_set_task_auto_start(tsk->tasknum, tsk->tasknum);
150
151 out_8(&bcom_eng->regs->ipr[priv->initiator], priv->ipr);
152 bcom_set_initiator(tsk->tasknum, priv->initiator);
153
154 out_be32(&bcom_eng->regs->IntPend, 1<<tsk->tasknum); /* Clear ints */
155
156 return 0;
157 }
158 EXPORT_SYMBOL_GPL(bcom_gen_bd_rx_reset);
159
---
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-20220113]
[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: arm64-randconfig-r032-20220113 (https://download.01.org/0day-ci/archive/20220113/202201131405.tgtilUdq-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d1021978b8e7e35dcc30201ca1731d64b5a602a8)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# 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
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 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 function 'find_pci_adapter' [-Wmissing-prototypes]
struct dxgadapter *find_pci_adapter(struct pci_dev *dev)
^
drivers/hv/dxgkrnl/dxgmodule.c:79:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct dxgadapter *find_pci_adapter(struct pci_dev *dev)
^
static
>> drivers/hv/dxgkrnl/dxgmodule.c:135:6: warning: no previous prototype for function 'signal_host_cpu_event' [-Wmissing-prototypes]
void signal_host_cpu_event(struct dxghostevent *eventhdr)
^
drivers/hv/dxgkrnl/dxgmodule.c:135:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void signal_host_cpu_event(struct dxghostevent *eventhdr)
^
static
>> drivers/hv/dxgkrnl/dxgmodule.c:219:5: warning: no previous prototype for function 'dxgglobal_create_adapter' [-Wmissing-prototypes]
int dxgglobal_create_adapter(struct pci_dev *dev, guid_t *guid,
^
drivers/hv/dxgkrnl/dxgmodule.c:219:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dxgglobal_create_adapter(struct pci_dev *dev, guid_t *guid,
^
static
3 warnings generated.
--
In file included from drivers/hv/dxgkrnl/dxgvmbus.c:22:
drivers/hv/dxgkrnl/dxgvmbus.h:867:26: warning: implicit conversion from enumeration type 'enum dxgkvmb_commandtype' to different enumeration type 'enum dxgkvmb_commandtype_global' [-Wenum-conversion]
command->command_type = DXGK_VMBCOMMAND_INVALID;
~ ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hv/dxgkrnl/dxgvmbus.c:116:5: warning: no previous prototype for function 'ntstatus2int' [-Wmissing-prototypes]
int ntstatus2int(struct ntstatus status)
^
drivers/hv/dxgkrnl/dxgvmbus.c:116:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int ntstatus2int(struct ntstatus status)
^
static
>> drivers/hv/dxgkrnl/dxgvmbus.c:219:6: warning: no previous prototype for function 'process_inband_packet' [-Wmissing-prototypes]
void process_inband_packet(struct dxgvmbuschannel *channel,
^
drivers/hv/dxgkrnl/dxgvmbus.c:219:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void process_inband_packet(struct dxgvmbuschannel *channel,
^
static
>> drivers/hv/dxgkrnl/dxgvmbus.c:237:6: warning: no previous prototype for function 'process_completion_packet' [-Wmissing-prototypes]
void process_completion_packet(struct dxgvmbuschannel *channel,
^
drivers/hv/dxgkrnl/dxgvmbus.c:237:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void process_completion_packet(struct dxgvmbuschannel *channel,
^
static
>> drivers/hv/dxgkrnl/dxgvmbus.c:363:5: warning: no previous prototype for function 'dxgvmb_send_async_msg' [-Wmissing-prototypes]
int dxgvmb_send_async_msg(struct dxgvmbuschannel *channel,
^
drivers/hv/dxgkrnl/dxgvmbus.c:363:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int dxgvmb_send_async_msg(struct dxgvmbuschannel *channel,
^
static
drivers/hv/dxgkrnl/dxgvmbus.c:199:20: warning: unused function 'command_vm_to_host_init0' [-Wunused-function]
static inline void command_vm_to_host_init0(struct dxgkvmb_command_vm_to_host
^
6 warnings generated.
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