raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
10.95k stars 4.93k forks source link

BCM2712_MIP missing dependency #5890

Open callistix opened 6 months ago

callistix commented 6 months ago

Describe the bug

When compiling a minimal kernel targeting the RPi 4 with bcm2711 SoC, I ran into a missing dependency of the BCM2712_MIP symbol defined at drivers/irqchip/Kconfig:112, which led to the following compile time error:

drivers/irqchip/irq-bcm2712-mip.c: In function 'mip_init_domains':
drivers/irqchip/irq-bcm2712-mip.c:222:22: error: implicit declaration of function 'pci_msi_create_irq_domain'; did you mean 'msi_create_irq_domain'? [-Werror=implicit-function-declaration]
  222 |         msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(node),
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                      msi_create_irq_domain

I had to enable "PCI support" in the "Device drivers" page, which in turn enables CONFIG_PCI_MSI, and it compiles correctly.

I suggest to add CONFIG_PCI_MSI as a dependency for BCM2712_MIP.

Steps to reproduce the behaviour

Device (s)

Raspberry Pi 4 Mod. B

System

Custom Debian based Linux OS using kernel from https://github.com/raspberrypi/linux, branch rpi-6.1.y.

Logs

make V=1 -j4 Image.gz dtbs
[...]
drivers/irqchip/irq-bcm2712-mip.c: In function 'mip_init_domains':
drivers/irqchip/irq-bcm2712-mip.c:222:22: error: implicit declaration of function 'pci_msi_create_irq_domain'; did you mean 'msi_create_irq_domain'? [-Werror=implicit-function-declaration]
  222 |         msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(node),
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                      msi_create_irq_domain

Additional context

No response

Smyl3 commented 4 months ago

I ran into the same issue, when tried to cross compile kernel main branch rpi-6.6.y Solution was the same. Had to reenable "Device drivers" -> "PCI support" VERSION = 6 PATCHLEVEL = 6 SUBLEVEL = 22

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j 10
drivers/irqchip/irq-bcm2712-mip.c: In function ‘mip_mask_msi_irq’:
drivers/irqchip/irq-bcm2712-mip.c:41:9: error: implicit declaration of function ‘pci_msi_mask_irq’ [-Werror=implicit-function-declaration]
   41 |         pci_msi_mask_irq(d);
      |         ^~~~~~~~~~~~~~~~
drivers/irqchip/irq-bcm2712-mip.c: In function ‘mip_unmask_msi_irq’:
drivers/irqchip/irq-bcm2712-mip.c:47:9: error: implicit declaration of function ‘pci_msi_unmask_irq’ [-Werror=implicit-function-declaration]
   47 |         pci_msi_unmask_irq(d);
      |         ^~~~~~~~~~~~~~~~~~
drivers/irqchip/irq-bcm2712-mip.c: In function ‘mip_init_domains’:
drivers/irqchip/irq-bcm2712-mip.c:220:22: error: implicit declaration of function ‘pci_msi_create_irq_domain’; did you mean ‘msi_create_irq_domain’? [-Werror=implicit-function-declaration]
  220 |         msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(node),
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                      msi_create_irq_domain
drivers/irqchip/irq-bcm2712-mip.c:220:20: warning: assignment to ‘struct irq_domain *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  220 |         msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(node),
      |                    ^