[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210201434.PPlZ6yC1-lkp@intel.com>
Date: Thu, 20 Oct 2022 15:08:50 +0800
From: kernel test robot <lkp@...el.com>
To: Bjorn Helgaas <helgaas@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
Kishon Vijay Abraham I <kishon@...nel.org>,
Tom Joseph <tjoseph@...ence.com>,
Rob Herring <robh@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Minghuan Lian <minghuan.Lian@....com>,
Mingkai Hu <mingkai.hu@....com>, Roy Zang <roy.zang@....com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Linus Walleij <linus.walleij@...aro.org>,
Toan Le <toan@...amperecomputing.com>,
Joyce Ooi <joyce.ooi@...el.com>, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Conor Dooley <conor.dooley@...rochip.com>,
Daire McNamara <daire.mcnamara@...rochip.com>,
Shawn Lin <shawn.lin@...k-chips.com>,
Heiko Stuebner <heiko@...ech.de>,
Bharat Kumar Gogada <bharat.kumar.gogada@....com>,
Michal Simek <monstr@...str.eu>,
bcm-kernel-feedback-list@...adcom.com, linux-omap@...r.kernel.org,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-tegra@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] PCI: Remove unnecessary of_irq.h includes
Hi Bjorn,
I love your patch! Yet something to improve:
[auto build test ERROR on helgaas-pci/next]
[also build test ERROR on xilinx-xlnx/master rockchip/for-next linus/master v6.1-rc1 next-20221020]
[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/Bjorn-Helgaas/PCI-Remove-unnecessary-of_irq-h-includes/20221020-100633
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
patch link: https://lore.kernel.org/r/20221019195452.37606-1-helgaas%40kernel.org
patch subject: [PATCH] PCI: Remove unnecessary of_irq.h includes
config: riscv-randconfig-r011-20221019
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/273a24b16a40ffd6a64c6c55aecbfae00a1cd996
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Bjorn-Helgaas/PCI-Remove-unnecessary-of_irq-h-includes/20221020-100633
git checkout 273a24b16a40ffd6a64c6c55aecbfae00a1cd996
# 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=riscv SHELL=/bin/bash drivers/pci/controller/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
>> drivers/pci/controller/pcie-microchip-host.c:473:31: error: incomplete definition of type 'struct irq_domain'
struct mc_pcie *port = domain->host_data;
~~~~~~^
include/linux/irq.h:130:8: note: forward declaration of 'struct irq_domain'
struct irq_domain;
^
>> drivers/pci/controller/pcie-microchip-host.c:489:2: error: call to undeclared function 'irq_domain_set_info'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
irq_domain_set_info(domain, virq, bit, &mc_msi_bottom_irq_chip,
^
drivers/pci/controller/pcie-microchip-host.c:490:14: error: incomplete definition of type 'struct irq_domain'
domain->host_data, handle_edge_irq, NULL, NULL);
~~~~~~^
include/linux/irq.h:130:8: note: forward declaration of 'struct irq_domain'
struct irq_domain;
^
>> drivers/pci/controller/pcie-microchip-host.c:505:23: error: call to undeclared function 'irq_domain_get_irq_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
struct irq_data *d = irq_domain_get_irq_data(domain, virq);
^
drivers/pci/controller/pcie-microchip-host.c:505:23: note: did you mean 'irq_desc_get_irq_data'?
include/linux/irqdesc.h:132:32: note: 'irq_desc_get_irq_data' declared here
static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc)
^
>> drivers/pci/controller/pcie-microchip-host.c:505:19: error: incompatible integer to pointer conversion initializing 'struct irq_data *' with an expression of type 'int' [-Wint-conversion]
struct irq_data *d = irq_domain_get_irq_data(domain, virq);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pci/controller/pcie-microchip-host.c:519:36: error: variable has incomplete type 'const struct irq_domain_ops'
static const struct irq_domain_ops msi_domain_ops = {
^
include/linux/msi.h:301:8: note: forward declaration of 'struct irq_domain_ops'
struct irq_domain_ops;
^
>> drivers/pci/controller/pcie-microchip-host.c:540:33: error: call to undeclared function 'of_node_to_fwnode'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
struct fwnode_handle *fwnode = of_node_to_fwnode(dev->of_node);
^
drivers/pci/controller/pcie-microchip-host.c:540:33: note: did you mean 'of_node_to_nid'?
include/linux/of.h:866:19: note: 'of_node_to_nid' declared here
static inline int of_node_to_nid(struct device_node *device)
^
>> drivers/pci/controller/pcie-microchip-host.c:540:24: error: incompatible integer to pointer conversion initializing 'struct fwnode_handle *' with an expression of type 'int' [-Wint-conversion]
struct fwnode_handle *fwnode = of_node_to_fwnode(dev->of_node);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pci/controller/pcie-microchip-host.c:545:20: error: call to undeclared function 'irq_domain_add_linear'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
msi->dev_domain = irq_domain_add_linear(NULL, msi->num_vectors,
^
>> drivers/pci/controller/pcie-microchip-host.c:556:3: error: call to undeclared function 'irq_domain_remove'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
irq_domain_remove(msi->dev_domain);
^
drivers/pci/controller/pcie-microchip-host.c:644:31: error: incomplete definition of type 'struct irq_domain'
irq_set_chip_data(irq, domain->host_data);
~~~~~~^
include/linux/irq.h:130:8: note: forward declaration of 'struct irq_domain'
struct irq_domain;
^
drivers/pci/controller/pcie-microchip-host.c:649:36: error: variable has incomplete type 'const struct irq_domain_ops'
static const struct irq_domain_ops intx_domain_ops = {
^
include/linux/msi.h:301:8: note: forward declaration of 'struct irq_domain_ops'
struct irq_domain_ops;
^
drivers/pci/controller/pcie-microchip-host.c:727:9: error: call to undeclared function 'irq_domain_get_irq_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
data = irq_domain_get_irq_data(port->event_domain, irq);
^
>> drivers/pci/controller/pcie-microchip-host.c:727:7: error: incompatible integer to pointer conversion assigning to 'struct irq_data *' from 'int' [-Wint-conversion]
data = irq_domain_get_irq_data(port->event_domain, irq);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip-host.c:841:31: error: incomplete definition of type 'struct irq_domain'
irq_set_chip_data(irq, domain->host_data);
~~~~~~^
include/linux/irq.h:130:8: note: forward declaration of 'struct irq_domain'
struct irq_domain;
^
drivers/pci/controller/pcie-microchip-host.c:846:36: error: variable has incomplete type 'const struct irq_domain_ops'
static const struct irq_domain_ops event_domain_ops = {
^
include/linux/msi.h:301:8: note: forward declaration of 'struct irq_domain_ops'
struct irq_domain_ops;
^
drivers/pci/controller/pcie-microchip-host.c:902:23: error: call to undeclared function 'irq_domain_add_linear'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
port->event_domain = irq_domain_add_linear(pcie_intc_node, NUM_EVENTS,
^
>> drivers/pci/controller/pcie-microchip-host.c:910:2: error: call to undeclared function 'irq_domain_update_bus_token'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
irq_domain_update_bus_token(port->event_domain, DOMAIN_BUS_NEXUS);
^
>> drivers/pci/controller/pcie-microchip-host.c:910:50: error: use of undeclared identifier 'DOMAIN_BUS_NEXUS'
irq_domain_update_bus_token(port->event_domain, DOMAIN_BUS_NEXUS);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
vim +473 drivers/pci/controller/pcie-microchip-host.c
6f15a9c9f94133 Daire McNamara 2021-01-25 469
6f15a9c9f94133 Daire McNamara 2021-01-25 470 static int mc_irq_msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
6f15a9c9f94133 Daire McNamara 2021-01-25 471 unsigned int nr_irqs, void *args)
6f15a9c9f94133 Daire McNamara 2021-01-25 472 {
5fe714fd922360 Bjorn Helgaas 2021-12-22 @473 struct mc_pcie *port = domain->host_data;
6f15a9c9f94133 Daire McNamara 2021-01-25 474 struct mc_msi *msi = &port->msi;
6f15a9c9f94133 Daire McNamara 2021-01-25 475 void __iomem *bridge_base_addr =
6f15a9c9f94133 Daire McNamara 2021-01-25 476 port->axi_base_addr + MC_PCIE_BRIDGE_ADDR;
6f15a9c9f94133 Daire McNamara 2021-01-25 477 unsigned long bit;
6f15a9c9f94133 Daire McNamara 2021-01-25 478 u32 val;
6f15a9c9f94133 Daire McNamara 2021-01-25 479
6f15a9c9f94133 Daire McNamara 2021-01-25 480 mutex_lock(&msi->lock);
6f15a9c9f94133 Daire McNamara 2021-01-25 481 bit = find_first_zero_bit(msi->used, msi->num_vectors);
6f15a9c9f94133 Daire McNamara 2021-01-25 482 if (bit >= msi->num_vectors) {
6f15a9c9f94133 Daire McNamara 2021-01-25 483 mutex_unlock(&msi->lock);
6f15a9c9f94133 Daire McNamara 2021-01-25 484 return -ENOSPC;
6f15a9c9f94133 Daire McNamara 2021-01-25 485 }
6f15a9c9f94133 Daire McNamara 2021-01-25 486
6f15a9c9f94133 Daire McNamara 2021-01-25 487 set_bit(bit, msi->used);
6f15a9c9f94133 Daire McNamara 2021-01-25 488
6f15a9c9f94133 Daire McNamara 2021-01-25 @489 irq_domain_set_info(domain, virq, bit, &mc_msi_bottom_irq_chip,
6f15a9c9f94133 Daire McNamara 2021-01-25 490 domain->host_data, handle_edge_irq, NULL, NULL);
6f15a9c9f94133 Daire McNamara 2021-01-25 491
6f15a9c9f94133 Daire McNamara 2021-01-25 492 /* Enable MSI interrupts */
6f15a9c9f94133 Daire McNamara 2021-01-25 493 val = readl_relaxed(bridge_base_addr + IMASK_LOCAL);
6f15a9c9f94133 Daire McNamara 2021-01-25 494 val |= PM_MSI_INT_MSI_MASK;
6f15a9c9f94133 Daire McNamara 2021-01-25 495 writel_relaxed(val, bridge_base_addr + IMASK_LOCAL);
6f15a9c9f94133 Daire McNamara 2021-01-25 496
6f15a9c9f94133 Daire McNamara 2021-01-25 497 mutex_unlock(&msi->lock);
6f15a9c9f94133 Daire McNamara 2021-01-25 498
6f15a9c9f94133 Daire McNamara 2021-01-25 499 return 0;
6f15a9c9f94133 Daire McNamara 2021-01-25 500 }
6f15a9c9f94133 Daire McNamara 2021-01-25 501
6f15a9c9f94133 Daire McNamara 2021-01-25 502 static void mc_irq_msi_domain_free(struct irq_domain *domain, unsigned int virq,
6f15a9c9f94133 Daire McNamara 2021-01-25 503 unsigned int nr_irqs)
6f15a9c9f94133 Daire McNamara 2021-01-25 504 {
6f15a9c9f94133 Daire McNamara 2021-01-25 @505 struct irq_data *d = irq_domain_get_irq_data(domain, virq);
5fe714fd922360 Bjorn Helgaas 2021-12-22 506 struct mc_pcie *port = irq_data_get_irq_chip_data(d);
6f15a9c9f94133 Daire McNamara 2021-01-25 507 struct mc_msi *msi = &port->msi;
6f15a9c9f94133 Daire McNamara 2021-01-25 508
6f15a9c9f94133 Daire McNamara 2021-01-25 509 mutex_lock(&msi->lock);
6f15a9c9f94133 Daire McNamara 2021-01-25 510
6f15a9c9f94133 Daire McNamara 2021-01-25 511 if (test_bit(d->hwirq, msi->used))
6f15a9c9f94133 Daire McNamara 2021-01-25 512 __clear_bit(d->hwirq, msi->used);
6f15a9c9f94133 Daire McNamara 2021-01-25 513 else
6f15a9c9f94133 Daire McNamara 2021-01-25 514 dev_err(port->dev, "trying to free unused MSI%lu\n", d->hwirq);
6f15a9c9f94133 Daire McNamara 2021-01-25 515
6f15a9c9f94133 Daire McNamara 2021-01-25 516 mutex_unlock(&msi->lock);
6f15a9c9f94133 Daire McNamara 2021-01-25 517 }
6f15a9c9f94133 Daire McNamara 2021-01-25 518
6f15a9c9f94133 Daire McNamara 2021-01-25 @519 static const struct irq_domain_ops msi_domain_ops = {
6f15a9c9f94133 Daire McNamara 2021-01-25 520 .alloc = mc_irq_msi_domain_alloc,
6f15a9c9f94133 Daire McNamara 2021-01-25 521 .free = mc_irq_msi_domain_free,
6f15a9c9f94133 Daire McNamara 2021-01-25 522 };
6f15a9c9f94133 Daire McNamara 2021-01-25 523
6f15a9c9f94133 Daire McNamara 2021-01-25 524 static struct irq_chip mc_msi_irq_chip = {
6f15a9c9f94133 Daire McNamara 2021-01-25 525 .name = "Microchip PCIe MSI",
6f15a9c9f94133 Daire McNamara 2021-01-25 526 .irq_ack = irq_chip_ack_parent,
6f15a9c9f94133 Daire McNamara 2021-01-25 527 .irq_mask = pci_msi_mask_irq,
6f15a9c9f94133 Daire McNamara 2021-01-25 528 .irq_unmask = pci_msi_unmask_irq,
6f15a9c9f94133 Daire McNamara 2021-01-25 529 };
6f15a9c9f94133 Daire McNamara 2021-01-25 530
6f15a9c9f94133 Daire McNamara 2021-01-25 531 static struct msi_domain_info mc_msi_domain_info = {
6f15a9c9f94133 Daire McNamara 2021-01-25 532 .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
6f15a9c9f94133 Daire McNamara 2021-01-25 533 MSI_FLAG_PCI_MSIX),
6f15a9c9f94133 Daire McNamara 2021-01-25 534 .chip = &mc_msi_irq_chip,
6f15a9c9f94133 Daire McNamara 2021-01-25 535 };
6f15a9c9f94133 Daire McNamara 2021-01-25 536
5fe714fd922360 Bjorn Helgaas 2021-12-22 537 static int mc_allocate_msi_domains(struct mc_pcie *port)
6f15a9c9f94133 Daire McNamara 2021-01-25 538 {
6f15a9c9f94133 Daire McNamara 2021-01-25 539 struct device *dev = port->dev;
6f15a9c9f94133 Daire McNamara 2021-01-25 @540 struct fwnode_handle *fwnode = of_node_to_fwnode(dev->of_node);
6f15a9c9f94133 Daire McNamara 2021-01-25 541 struct mc_msi *msi = &port->msi;
6f15a9c9f94133 Daire McNamara 2021-01-25 542
6f15a9c9f94133 Daire McNamara 2021-01-25 543 mutex_init(&port->msi.lock);
6f15a9c9f94133 Daire McNamara 2021-01-25 544
6f15a9c9f94133 Daire McNamara 2021-01-25 @545 msi->dev_domain = irq_domain_add_linear(NULL, msi->num_vectors,
6f15a9c9f94133 Daire McNamara 2021-01-25 546 &msi_domain_ops, port);
6f15a9c9f94133 Daire McNamara 2021-01-25 547 if (!msi->dev_domain) {
6f15a9c9f94133 Daire McNamara 2021-01-25 548 dev_err(dev, "failed to create IRQ domain\n");
6f15a9c9f94133 Daire McNamara 2021-01-25 549 return -ENOMEM;
6f15a9c9f94133 Daire McNamara 2021-01-25 550 }
6f15a9c9f94133 Daire McNamara 2021-01-25 551
6f15a9c9f94133 Daire McNamara 2021-01-25 552 msi->msi_domain = pci_msi_create_irq_domain(fwnode, &mc_msi_domain_info,
6f15a9c9f94133 Daire McNamara 2021-01-25 553 msi->dev_domain);
6f15a9c9f94133 Daire McNamara 2021-01-25 554 if (!msi->msi_domain) {
6f15a9c9f94133 Daire McNamara 2021-01-25 555 dev_err(dev, "failed to create MSI domain\n");
6f15a9c9f94133 Daire McNamara 2021-01-25 @556 irq_domain_remove(msi->dev_domain);
6f15a9c9f94133 Daire McNamara 2021-01-25 557 return -ENOMEM;
6f15a9c9f94133 Daire McNamara 2021-01-25 558 }
6f15a9c9f94133 Daire McNamara 2021-01-25 559
6f15a9c9f94133 Daire McNamara 2021-01-25 560 return 0;
6f15a9c9f94133 Daire McNamara 2021-01-25 561 }
6f15a9c9f94133 Daire McNamara 2021-01-25 562
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (150799 bytes)
Powered by blists - more mailing lists