* [jirislaby:devel 17/64] arch/powerpc/sysdev/fsl_msi.c:415:42: error: controlling expression type 'struct device' not compatible with any generic association type
@ 2025-05-13 1:38 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-13 1:38 UTC (permalink / raw)
To: Jiri Slaby (SUSE); +Cc: llvm, oe-kbuild-all, Christophe Leroy
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head: f060943a6971b43116b370a038e41046e9421154
commit: b14c14c5417d39a08c935f3755ae6e99f56f97d7 [17/64] irqdomain: ppc: Use dev_fwnode() TODO
config: powerpc-randconfig-003-20250513 (https://download.01.org/0day-ci/archive/20250513/202505130927.noFfGNBZ-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250513/202505130927.noFfGNBZ-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505130927.noFfGNBZ-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/powerpc/sysdev/fsl_msi.c:415:42: error: controlling expression type 'struct device' not compatible with any generic association type
415 | msi->irqhost = irq_domain_create_linear(dev_fwnode(dev->dev), NR_MSI_IRQS_MAX,
| ^~~~~~~~~~~~~~~~~~~~
include/linux/property.h:35:11: note: expanded from macro 'dev_fwnode'
35 | _Generic((dev), \
| ^~~~~
1 error generated.
vim +415 arch/powerpc/sysdev/fsl_msi.c
391
392 static const struct of_device_id fsl_of_msi_ids[];
393 static int fsl_of_msi_probe(struct platform_device *dev)
394 {
395 struct fsl_msi *msi;
396 struct resource res, msiir;
397 int err, i, j, irq_index, count;
398 const u32 *p;
399 const struct fsl_msi_feature *features;
400 int len;
401 u32 offset;
402 struct pci_controller *phb;
403
404 features = device_get_match_data(&dev->dev);
405
406 printk(KERN_DEBUG "Setting up Freescale MSI support\n");
407
408 msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL);
409 if (!msi) {
410 dev_err(&dev->dev, "No memory for MSI structure\n");
411 return -ENOMEM;
412 }
413 platform_set_drvdata(dev, msi);
414
> 415 msi->irqhost = irq_domain_create_linear(dev_fwnode(dev->dev), NR_MSI_IRQS_MAX,
416 &fsl_msi_host_ops, msi);
417 if (msi->irqhost == NULL) {
418 dev_err(&dev->dev, "No memory for MSI irqhost\n");
419 err = -ENOMEM;
420 goto error_out;
421 }
422
423 /*
424 * Under the Freescale hypervisor, the msi nodes don't have a 'reg'
425 * property. Instead, we use hypercalls to access the MSI.
426 */
427 if ((features->fsl_pic_ip & FSL_PIC_IP_MASK) != FSL_PIC_IP_VMPIC) {
428 err = of_address_to_resource(dev->dev.of_node, 0, &res);
429 if (err) {
430 dev_err(&dev->dev, "invalid resource for node %pOF\n",
431 dev->dev.of_node);
432 goto error_out;
433 }
434
435 msi->msi_regs = ioremap(res.start, resource_size(&res));
436 if (!msi->msi_regs) {
437 err = -ENOMEM;
438 dev_err(&dev->dev, "could not map node %pOF\n",
439 dev->dev.of_node);
440 goto error_out;
441 }
442 msi->msiir_offset =
443 features->msiir_offset + (res.start & 0xfffff);
444
445 /*
446 * First read the MSIIR/MSIIR1 offset from dts
447 * On failure use the hardcode MSIIR offset
448 */
449 if (of_address_to_resource(dev->dev.of_node, 1, &msiir))
450 msi->msiir_offset = features->msiir_offset +
451 (res.start & MSIIR_OFFSET_MASK);
452 else
453 msi->msiir_offset = msiir.start & MSIIR_OFFSET_MASK;
454 }
455
456 msi->feature = features->fsl_pic_ip;
457
458 /* For erratum PIC1 on MPIC version 2.0*/
459 if ((features->fsl_pic_ip & FSL_PIC_IP_MASK) == FSL_PIC_IP_MPIC
460 && (fsl_mpic_primary_get_version() == 0x0200))
461 msi->feature |= MSI_HW_ERRATA_ENDIAN;
462
463 /*
464 * Remember the phandle, so that we can match with any PCI nodes
465 * that have an "fsl,msi" property.
466 */
467 msi->phandle = dev->dev.of_node->phandle;
468
469 err = fsl_msi_init_allocator(msi);
470 if (err) {
471 dev_err(&dev->dev, "Error allocating MSI bitmap\n");
472 goto error_out;
473 }
474
475 p = of_get_property(dev->dev.of_node, "msi-available-ranges", &len);
476
477 if (of_device_is_compatible(dev->dev.of_node, "fsl,mpic-msi-v4.3") ||
478 of_device_is_compatible(dev->dev.of_node, "fsl,vmpic-msi-v4.3")) {
479 msi->srs_shift = MSIIR1_SRS_SHIFT;
480 msi->ibs_shift = MSIIR1_IBS_SHIFT;
481 if (p)
482 dev_warn(&dev->dev, "%s: dose not support msi-available-ranges property\n",
483 __func__);
484
485 for (irq_index = 0; irq_index < NR_MSI_REG_MSIIR1;
486 irq_index++) {
487 err = fsl_msi_setup_hwirq(msi, dev,
488 irq_index, irq_index);
489 if (err)
490 goto error_out;
491 }
492 } else {
493 static const u32 all_avail[] =
494 { 0, NR_MSI_REG_MSIIR * IRQS_PER_MSI_REG };
495
496 msi->srs_shift = MSIIR_SRS_SHIFT;
497 msi->ibs_shift = MSIIR_IBS_SHIFT;
498
499 if (p && len % (2 * sizeof(u32)) != 0) {
500 dev_err(&dev->dev, "%s: Malformed msi-available-ranges property\n",
501 __func__);
502 err = -EINVAL;
503 goto error_out;
504 }
505
506 if (!p) {
507 p = all_avail;
508 len = sizeof(all_avail);
509 }
510
511 for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) {
512 if (p[i * 2] % IRQS_PER_MSI_REG ||
513 p[i * 2 + 1] % IRQS_PER_MSI_REG) {
514 pr_warn("%s: %pOF: msi available range of %u at %u is not IRQ-aligned\n",
515 __func__, dev->dev.of_node,
516 p[i * 2 + 1], p[i * 2]);
517 err = -EINVAL;
518 goto error_out;
519 }
520
521 offset = p[i * 2] / IRQS_PER_MSI_REG;
522 count = p[i * 2 + 1] / IRQS_PER_MSI_REG;
523
524 for (j = 0; j < count; j++, irq_index++) {
525 err = fsl_msi_setup_hwirq(msi, dev, offset + j,
526 irq_index);
527 if (err)
528 goto error_out;
529 }
530 }
531 }
532
533 list_add_tail(&msi->list, &msi_head);
534
535 /*
536 * Apply the MSI ops to all the controllers.
537 * It doesn't hurt to reassign the same ops,
538 * but bail out if we find another MSI driver.
539 */
540 list_for_each_entry(phb, &hose_list, list_node) {
541 if (!phb->controller_ops.setup_msi_irqs) {
542 phb->controller_ops.setup_msi_irqs = fsl_setup_msi_irqs;
543 phb->controller_ops.teardown_msi_irqs = fsl_teardown_msi_irqs;
544 } else if (phb->controller_ops.setup_msi_irqs != fsl_setup_msi_irqs) {
545 dev_err(&dev->dev, "Different MSI driver already installed!\n");
546 err = -ENODEV;
547 goto error_out;
548 }
549 }
550 return 0;
551 error_out:
552 fsl_of_msi_remove(dev);
553 return err;
554 }
555
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-13 1:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 1:38 [jirislaby:devel 17/64] arch/powerpc/sysdev/fsl_msi.c:415:42: error: controlling expression type 'struct device' not compatible with any generic association type kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).