Hi Vikas, [FYI, it's a private test report for your RFC patch.] [auto build test ERROR on vfio/next] [also build test ERROR on v5.10 next-20201223] [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/Vikas-Gupta/msi-support-for-platform-devices/20201215-015115 base: https://github.com/awilliam/linux-vfio.git next config: arm-randconfig-r021-20201221 (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/029a6fee02b683d688d7e6e685c78127ac29df8a git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Vikas-Gupta/msi-support-for-platform-devices/20201215-015115 git checkout 029a6fee02b683d688d7e6e685c78127ac29df8a # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): drivers/vfio/platform/vfio_platform_irq.c: In function 'vfio_msi_enable': >> drivers/vfio/platform/vfio_platform_irq.c:299:8: error: implicit declaration of function 'platform_msi_domain_alloc_irqs' [-Werror=implicit-function-declaration] 299 | ret = platform_msi_domain_alloc_irqs(dev, nvec, msi_write); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/list.h:9, from include/linux/wait.h:7, from include/linux/eventfd.h:13, from drivers/vfio/platform/vfio_platform_irq.c:9: >> include/linux/msi.h:135:38: error: 'struct device' has no member named 'msi_list' 135 | #define dev_to_msi_list(dev) (&(dev)->msi_list) | ^~ include/linux/kernel.h:852:26: note: in definition of macro 'container_of' 852 | void *__mptr = (void *)(ptr); \ | ^~~ include/linux/list.h:522:2: note: in expansion of macro 'list_entry' 522 | list_entry((ptr)->next, type, member) | ^~~~~~~~~~ include/linux/list.h:628:13: note: in expansion of macro 'list_first_entry' 628 | for (pos = list_first_entry(head, typeof(*pos), member); \ | ^~~~~~~~~~~~~~~~ include/linux/msi.h:139:2: note: in expansion of macro 'list_for_each_entry' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~~~~~ include/linux/msi.h:139:30: note: in expansion of macro 'dev_to_msi_list' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~ drivers/vfio/platform/vfio_platform_irq.c:305:2: note: in expansion of macro 'for_each_msi_entry' 305 | for_each_msi_entry(desc, dev) { | ^~~~~~~~~~~~~~~~~~ In file included from : >> include/linux/msi.h:135:38: error: 'struct device' has no member named 'msi_list' 135 | #define dev_to_msi_list(dev) (&(dev)->msi_list) | ^~ include/linux/compiler_types.h:295:9: note: in definition of macro '__compiletime_assert' 295 | if (!(condition)) \ | ^~~~~~~~~ include/linux/compiler_types.h:315:2: note: in expansion of macro '_compiletime_assert' 315 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^~~~~~~~~~~~~~~~~~ include/linux/kernel.h:853:2: note: in expansion of macro 'BUILD_BUG_ON_MSG' 853 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ | ^~~~~~~~~~~~~~~~ include/linux/kernel.h:853:20: note: in expansion of macro '__same_type' 853 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ | ^~~~~~~~~~~ include/linux/list.h:511:2: note: in expansion of macro 'container_of' 511 | container_of(ptr, type, member) | ^~~~~~~~~~~~ include/linux/list.h:522:2: note: in expansion of macro 'list_entry' 522 | list_entry((ptr)->next, type, member) | ^~~~~~~~~~ include/linux/list.h:628:13: note: in expansion of macro 'list_first_entry' 628 | for (pos = list_first_entry(head, typeof(*pos), member); \ | ^~~~~~~~~~~~~~~~ include/linux/msi.h:139:2: note: in expansion of macro 'list_for_each_entry' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~~~~~ include/linux/msi.h:139:30: note: in expansion of macro 'dev_to_msi_list' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~ drivers/vfio/platform/vfio_platform_irq.c:305:2: note: in expansion of macro 'for_each_msi_entry' 305 | for_each_msi_entry(desc, dev) { | ^~~~~~~~~~~~~~~~~~ >> include/linux/msi.h:135:38: error: 'struct device' has no member named 'msi_list' 135 | #define dev_to_msi_list(dev) (&(dev)->msi_list) | ^~ include/linux/compiler_types.h:295:9: note: in definition of macro '__compiletime_assert' 295 | if (!(condition)) \ | ^~~~~~~~~ include/linux/compiler_types.h:315:2: note: in expansion of macro '_compiletime_assert' 315 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^~~~~~~~~~~~~~~~~~ include/linux/kernel.h:853:2: note: in expansion of macro 'BUILD_BUG_ON_MSG' 853 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ | ^~~~~~~~~~~~~~~~ include/linux/kernel.h:854:6: note: in expansion of macro '__same_type' 854 | !__same_type(*(ptr), void), \ | ^~~~~~~~~~~ include/linux/list.h:511:2: note: in expansion of macro 'container_of' 511 | container_of(ptr, type, member) | ^~~~~~~~~~~~ include/linux/list.h:522:2: note: in expansion of macro 'list_entry' 522 | list_entry((ptr)->next, type, member) | ^~~~~~~~~~ include/linux/list.h:628:13: note: in expansion of macro 'list_first_entry' 628 | for (pos = list_first_entry(head, typeof(*pos), member); \ | ^~~~~~~~~~~~~~~~ include/linux/msi.h:139:2: note: in expansion of macro 'list_for_each_entry' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~~~~~ include/linux/msi.h:139:30: note: in expansion of macro 'dev_to_msi_list' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~ drivers/vfio/platform/vfio_platform_irq.c:305:2: note: in expansion of macro 'for_each_msi_entry' 305 | for_each_msi_entry(desc, dev) { | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/wait.h:7, from include/linux/eventfd.h:13, from drivers/vfio/platform/vfio_platform_irq.c:9: >> include/linux/msi.h:135:38: error: 'struct device' has no member named 'msi_list' 135 | #define dev_to_msi_list(dev) (&(dev)->msi_list) | ^~ include/linux/list.h:619:20: note: in definition of macro 'list_entry_is_head' 619 | (&pos->member == (head)) | ^~~~ include/linux/msi.h:139:2: note: in expansion of macro 'list_for_each_entry' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~~~~~ include/linux/msi.h:139:30: note: in expansion of macro 'dev_to_msi_list' 139 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ^~~~~~~~~~~~~~~ drivers/vfio/platform/vfio_platform_irq.c:305:2: note: in expansion of macro 'for_each_msi_entry' 305 | for_each_msi_entry(desc, dev) { | ^~~~~~~~~~~~~~~~~~ drivers/vfio/platform/vfio_platform_irq.c: In function 'vfio_msi_disable': >> drivers/vfio/platform/vfio_platform_irq.c:390:2: error: implicit declaration of function 'platform_msi_domain_free_irqs' [-Werror=implicit-function-declaration] 390 | platform_msi_domain_free_irqs(dev); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +/platform_msi_domain_alloc_irqs +299 drivers/vfio/platform/vfio_platform_irq.c 285 286 static int vfio_msi_enable(struct vfio_platform_device *vdev, 287 struct vfio_platform_irq *irq, int nvec) 288 { 289 int ret; 290 int msi_idx = 0; 291 struct msi_desc *desc; 292 struct device *dev = vdev->device; 293 294 irq->ctx = kcalloc(nvec, sizeof(struct vfio_irq_ctx), GFP_KERNEL); 295 if (!irq->ctx) 296 return -ENOMEM; 297 298 /* Allocate platform MSIs */ > 299 ret = platform_msi_domain_alloc_irqs(dev, nvec, msi_write); 300 if (ret < 0) { 301 kfree(irq->ctx); 302 return ret; 303 } 304 305 for_each_msi_entry(desc, dev) { 306 irq->ctx[msi_idx].hwirq = desc->irq; 307 msi_idx++; 308 } 309 310 irq->num_ctx = nvec; 311 irq->config_msi = 1; 312 313 return 0; 314 } 315 316 static int vfio_msi_set_vector_signal(struct vfio_platform_irq *irq, 317 int vector, int fd) 318 { 319 struct eventfd_ctx *trigger; 320 int irq_num, ret; 321 322 if (vector < 0 || vector >= irq->num_ctx) 323 return -EINVAL; 324 325 irq_num = irq->ctx[vector].hwirq; 326 327 if (irq->ctx[vector].trigger) { 328 free_irq(irq_num, irq->ctx[vector].trigger); 329 kfree(irq->ctx[vector].name); 330 eventfd_ctx_put(irq->ctx[vector].trigger); 331 irq->ctx[vector].trigger = NULL; 332 } 333 334 if (fd < 0) 335 return 0; 336 337 irq->ctx[vector].name = kasprintf(GFP_KERNEL, 338 "vfio-msi[%d]", vector); 339 if (!irq->ctx[vector].name) 340 return -ENOMEM; 341 342 trigger = eventfd_ctx_fdget(fd); 343 if (IS_ERR(trigger)) { 344 kfree(irq->ctx[vector].name); 345 return PTR_ERR(trigger); 346 } 347 348 ret = request_irq(irq_num, vfio_msihandler, 0, 349 irq->ctx[vector].name, trigger); 350 if (ret) { 351 kfree(irq->ctx[vector].name); 352 eventfd_ctx_put(trigger); 353 return ret; 354 } 355 356 irq->ctx[vector].trigger = trigger; 357 358 return 0; 359 } 360 361 static int vfio_msi_set_block(struct vfio_platform_irq *irq, unsigned int start, 362 unsigned int count, int32_t *fds) 363 { 364 int i, j, ret = 0; 365 366 if (start >= irq->num_ctx || start + count > irq->num_ctx) 367 return -EINVAL; 368 369 for (i = 0, j = start; i < count && !ret; i++, j++) { 370 int fd = fds ? fds[i] : -1; 371 372 ret = vfio_msi_set_vector_signal(irq, j, fd); 373 } 374 375 if (ret) { 376 for (--j; j >= (int)start; j--) 377 vfio_msi_set_vector_signal(irq, j, -1); 378 } 379 380 return ret; 381 } 382 383 static void vfio_msi_disable(struct vfio_platform_device *vdev, 384 struct vfio_platform_irq *irq) 385 { 386 struct device *dev = vdev->device; 387 388 vfio_msi_set_block(irq, 0, irq->num_ctx, NULL); 389 > 390 platform_msi_domain_free_irqs(dev); 391 392 irq->config_msi = 0; 393 irq->num_ctx = 0; 394 395 kfree(irq->ctx); 396 } 397 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org