[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210130216.7eLLBnut-lkp@intel.com>
Date: Thu, 13 Oct 2022 02:14:03 +0800
From: kernel test robot <lkp@...el.com>
To: Saurabh Sengar <ssengar@...ux.microsoft.com>,
ssengar@...rosoft.com, kys@...rosoft.com, haiyangz@...rosoft.com,
sthemmin@...rosoft.com, wei.liu@...nel.org, decui@...rosoft.com,
longli@...rosoft.com, gregkh@...uxfoundation.org,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
mikelley@...rosoft.com
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org
Subject: Re: [PATCH] uio_hv_generic: Enable support for slower vmbus device
channels
Hi Saurabh,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on linus/master v6.0 next-20221012]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Saurabh-Sengar/uio_hv_generic-Enable-support-for-slower-vmbus-device-channels/20221012-195731
config: i386-randconfig-a015
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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-lab-lkp/linux/commit/e7d62290b320f0f50c4f09b8f869b9049ef2c2bd
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Saurabh-Sengar/uio_hv_generic-Enable-support-for-slower-vmbus-device-channels/20221012-195731
git checkout e7d62290b320f0f50c4f09b8f869b9049ef2c2bd
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/uio/ drivers/virtio/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
drivers/uio/uio_hv_generic.c:44:1: error: incompatible pointer types returning 'size_t *' (aka 'unsigned int *') from a function with result type 'unsigned long *' [-Werror,-Wincompatible-pointer-types]
module_param(recv_buf_size, ulong, 0644);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:127:2: note: expanded from macro 'module_param'
module_param_named(name, name, type, perm)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:150:2: note: expanded from macro 'module_param_named'
param_check_##type(name, &(value)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<scratch space>:40:1: note: expanded from here
param_check_ulong
^
include/linux/moduleparam.h:446:36: note: expanded from macro 'param_check_ulong'
#define param_check_ulong(name, p) __param_check(name, p, unsigned long)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:409:67: note: expanded from macro '__param_check'
static inline type __always_unused *__check_##name(void) { return(p); }
^~~
drivers/uio/uio_hv_generic.c:48:1: error: incompatible pointer types returning 'size_t *' (aka 'unsigned int *') from a function with result type 'unsigned long *' [-Werror,-Wincompatible-pointer-types]
module_param(send_buf_size, ulong, 0644);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:127:2: note: expanded from macro 'module_param'
module_param_named(name, name, type, perm)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:150:2: note: expanded from macro 'module_param_named'
param_check_##type(name, &(value)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<scratch space>:59:1: note: expanded from here
param_check_ulong
^
include/linux/moduleparam.h:446:36: note: expanded from macro 'param_check_ulong'
#define param_check_ulong(name, p) __param_check(name, p, unsigned long)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:409:67: note: expanded from macro '__param_check'
static inline type __always_unused *__check_##name(void) { return(p); }
^~~
drivers/uio/uio_hv_generic.c:52:1: error: incompatible pointer types returning 'size_t *' (aka 'unsigned int *') from a function with result type 'unsigned long *' [-Werror,-Wincompatible-pointer-types]
module_param(ring_size, ulong, 0644);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:127:2: note: expanded from macro 'module_param'
module_param_named(name, name, type, perm)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:150:2: note: expanded from macro 'module_param_named'
param_check_##type(name, &(value)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<scratch space>:80:1: note: expanded from here
param_check_ulong
^
include/linux/moduleparam.h:446:36: note: expanded from macro 'param_check_ulong'
#define param_check_ulong(name, p) __param_check(name, p, unsigned long)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:409:67: note: expanded from macro '__param_check'
static inline type __always_unused *__check_##name(void) { return(p); }
^~~
>> drivers/uio/uio_hv_generic.c:256:59: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
dev_dbg(&dev->device, "primary channel ring size = %lx", ring_size);
~~~ ^~~~~~~~~
%zx
include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg'
dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk'
_dev_printk(level, dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
1 warning and 3 errors generated.
vim +256 drivers/uio/uio_hv_generic.c
246
247 static int
248 hv_uio_probe(struct hv_device *dev,
249 const struct hv_vmbus_device_id *dev_id)
250 {
251 struct vmbus_channel *channel = dev->channel;
252 struct hv_uio_private_data *pdata;
253 void *ring_buffer;
254 int ret;
255
> 256 dev_dbg(&dev->device, "primary channel ring size = %lx", ring_size);
257
258 pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL);
259 if (!pdata)
260 return -ENOMEM;
261
262 ret = vmbus_alloc_ring(channel, ring_size, ring_size);
263 if (ret)
264 return ret;
265
266 set_channel_read_mode(channel, HV_CALL_ISR);
267
268 /* Fill general uio info */
269 pdata->info.name = "uio_hv_generic";
270 pdata->info.version = DRIVER_VERSION;
271 pdata->info.irqcontrol = hv_uio_irqcontrol;
272 pdata->info.open = hv_uio_open;
273 pdata->info.release = hv_uio_release;
274 pdata->info.irq = UIO_IRQ_CUSTOM;
275 atomic_set(&pdata->refcnt, 0);
276
277 /* mem resources */
278 pdata->info.mem[TXRX_RING_MAP].name = "txrx_rings";
279 ring_buffer = page_address(channel->ringbuffer_page);
280 pdata->info.mem[TXRX_RING_MAP].addr
281 = (uintptr_t)virt_to_phys(ring_buffer);
282 pdata->info.mem[TXRX_RING_MAP].size
283 = channel->ringbuffer_pagecount << PAGE_SHIFT;
284 pdata->info.mem[TXRX_RING_MAP].memtype = UIO_MEM_IOVA;
285
286 pdata->info.mem[INT_PAGE_MAP].name = "int_page";
287 pdata->info.mem[INT_PAGE_MAP].addr
288 = (uintptr_t)vmbus_connection.int_page;
289 pdata->info.mem[INT_PAGE_MAP].size = PAGE_SIZE;
290 pdata->info.mem[INT_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
291
292 pdata->info.mem[MON_PAGE_MAP].name = "monitor_page";
293 pdata->info.mem[MON_PAGE_MAP].addr
294 = (uintptr_t)vmbus_connection.monitor_pages[1];
295 pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
296 pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
297
298 if (recv_buf_size) {
299 dev_dbg(&dev->device, "recv buffer allocation");
300 pdata->recv_buf = vzalloc(recv_buf_size);
301 if (!pdata->recv_buf) {
302 ret = -ENOMEM;
303 goto fail_free_ring;
304 }
305
306 ret = vmbus_establish_gpadl(channel, pdata->recv_buf,
307 recv_buf_size, &pdata->recv_gpadl);
308 if (ret) {
309 vfree(pdata->recv_buf);
310 goto fail_close;
311 }
312
313 /* put Global Physical Address Label in name */
314 snprintf(pdata->recv_name, sizeof(pdata->recv_name),
315 "recv:%u", pdata->recv_gpadl.gpadl_handle);
316 pdata->info.mem[RECV_BUF_MAP].name = pdata->recv_name;
317 pdata->info.mem[RECV_BUF_MAP].addr = (uintptr_t)pdata->recv_buf;
318 pdata->info.mem[RECV_BUF_MAP].size = recv_buf_size;
319 pdata->info.mem[RECV_BUF_MAP].memtype = UIO_MEM_VIRTUAL;
320 }
321
322 if (send_buf_size) {
323 dev_dbg(&dev->device, "send buffer allocation");
324 pdata->send_buf = vzalloc(send_buf_size);
325 if (!pdata->send_buf) {
326 ret = -ENOMEM;
327 goto fail_close;
328 }
329
330 ret = vmbus_establish_gpadl(channel, pdata->send_buf,
331 send_buf_size, &pdata->send_gpadl);
332 if (ret) {
333 vfree(pdata->send_buf);
334 goto fail_close;
335 }
336
337 snprintf(pdata->send_name, sizeof(pdata->send_name),
338 "send:%u", pdata->send_gpadl.gpadl_handle);
339 pdata->info.mem[SEND_BUF_MAP].name = pdata->send_name;
340 pdata->info.mem[SEND_BUF_MAP].addr = (uintptr_t)pdata->send_buf;
341 pdata->info.mem[SEND_BUF_MAP].size = send_buf_size;
342 pdata->info.mem[SEND_BUF_MAP].memtype = UIO_MEM_VIRTUAL;
343 }
344
345 pdata->info.priv = pdata;
346 pdata->device = dev;
347
348 ret = uio_register_device(&dev->device, &pdata->info);
349 if (ret) {
350 dev_err(&dev->device, "hv_uio register failed\n");
351 goto fail_close;
352 }
353
354 ret = sysfs_create_bin_file(&channel->kobj, &ring_buffer_bin_attr);
355 if (ret)
356 dev_notice(&dev->device,
357 "sysfs create ring bin file failed; %d\n", ret);
358
359 hv_set_drvdata(dev, pdata);
360
361 return 0;
362
363 fail_close:
364 hv_uio_cleanup(dev, pdata);
365 fail_free_ring:
366 vmbus_free_ring(dev->channel);
367
368 return ret;
369 }
370
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (178182 bytes)
Powered by blists - more mailing lists