Skip to contentSkip to conversation

PCI/MSI: mvebu: Re-enable arch fallbacks

PATCH In review Domenico Andreoli 2 participants 3 messages Mar 16, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/MSI: mvebu: Re-enable arch fallbacks

From: Domenico Andreoli <[email protected]>

Since v5.10, my QNAP happily barks at boot as follows (5.17.0-rc8):

[    0.923811] ------------[ cut here ]------------
[    0.928458] WARNING: CPU: 0 PID: 1 at drivers/pci/msi/msi.h:17 pci_msi_setup_msi_irqs+0x54/0x6c
[    0.937219] Modules linked in:
[    0.940290] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-rc8-marvell #6
[    0.947117] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[    0.953428]  unwind_backtrace from show_stack+0x10/0x14
[    0.958698]  show_stack from __warn+0xac/0xe4
[    0.963093]  __warn from warn_slowpath_fmt+0x68/0x80
[    0.968098]  warn_slowpath_fmt from pci_msi_setup_msi_irqs+0x54/0x6c
[    0.974499]  pci_msi_setup_msi_irqs from __pci_enable_msi_range+0x260/0x340
[    0.981509]  __pci_enable_msi_range from pci_alloc_irq_vectors_affinity+0xb8/0xf8
[    0.989043]  pci_alloc_irq_vectors_affinity from xhci_run+0x164/0x474
[    0.995532]  xhci_run from usb_add_hcd+0x444/0x6e0
[    1.000362]  usb_add_hcd from usb_hcd_pci_probe+0x30c/0x37c
[    1.005979]  usb_hcd_pci_probe from xhci_pci_probe+0x10/0xec
[    1.011689]  xhci_pci_probe from pci_device_probe+0x74/0xe8
[    1.017305]  pci_device_probe from really_probe+0x1c0/0x3f8
[    1.022921]  really_probe from driver_probe_device+0x30/0xb0
[    1.028623]  driver_probe_device from __driver_attach+0x11c/0x148
[    1.034762]  __driver_attach from bus_for_each_dev+0x54/0x78
[    1.040466]  bus_for_each_dev from bus_add_driver+0x170/0x1d8
[    1.046256]  bus_add_driver from driver_register+0xac/0xf0
[    1.051783]  driver_register from do_one_initcall+0x74/0x1b8
[    1.057495]  do_one_initcall from kernel_init_freeable+0x1a8/0x1ec
[    1.063723]  kernel_init_freeable from kernel_init+0x10/0x108
[    1.069514]  kernel_init from ret_from_fork+0x14/0x3c
[    1.074604] Exception stack(0xc1835fb0 to 0xc1835ff8)
[    1.079691] 5fa0:                                     00000000 00000000 00000000 00000000
[    1.087915] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.096136] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    1.102787] ---[ end trace 0000000000000000 ]---
[    1.107435] ------------[ cut here ]------------

I bisected it down to commit 077ee78e392869e46ae (PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable).

Re-enabling PCI/MSI arch fallbacks restores a clean bootlog.

---
 arch/arm/mach-mvebu/Kconfig |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-mvebu/Kconfig +1 -0
Index: b/arch/arm/mach-mvebu/Kconfig
===================================================================
@@ -123,6 +123,7 @@ config MACH_KIRKWOOD
 	select ORION_IRQCHIP
 	select ORION_TIMER
 	select FORCE_PCI
+	select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
 	select PCI_QUIRKS
 	select PINCTRL_KIRKWOOD
 	help

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#1 lore raw
Quoted 60 lines · Domenico Andreoli

From: Domenico Andreoli <[email protected]>

Since v5.10, my QNAP happily barks at boot as follows (5.17.0-rc8):

[    0.923811] ------------[ cut here ]------------
[    0.928458] WARNING: CPU: 0 PID: 1 at drivers/pci/msi/msi.h:17
pci_msi_setup_msi_irqs+0x54/0x6c
[    0.937219] Modules linked in:
[    0.940290] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-rc8-marvell #6
[    0.947117] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[    0.953428]  unwind_backtrace from show_stack+0x10/0x14
[    0.958698]  show_stack from __warn+0xac/0xe4
[    0.963093]  __warn from warn_slowpath_fmt+0x68/0x80
[    0.968098]  warn_slowpath_fmt from pci_msi_setup_msi_irqs+0x54/0x6c
[    0.974499]  pci_msi_setup_msi_irqs from __pci_enable_msi_range+0x260/0x340
[    0.981509]  __pci_enable_msi_range from
pci_alloc_irq_vectors_affinity+0xb8/0xf8
[    0.989043]  pci_alloc_irq_vectors_affinity from xhci_run+0x164/0x474
[    0.995532]  xhci_run from usb_add_hcd+0x444/0x6e0
[    1.000362]  usb_add_hcd from usb_hcd_pci_probe+0x30c/0x37c
[    1.005979]  usb_hcd_pci_probe from xhci_pci_probe+0x10/0xec
[    1.011689]  xhci_pci_probe from pci_device_probe+0x74/0xe8
[    1.017305]  pci_device_probe from really_probe+0x1c0/0x3f8
[    1.022921]  really_probe from driver_probe_device+0x30/0xb0
[    1.028623]  driver_probe_device from __driver_attach+0x11c/0x148
[    1.034762]  __driver_attach from bus_for_each_dev+0x54/0x78
[    1.040466]  bus_for_each_dev from bus_add_driver+0x170/0x1d8
[    1.046256]  bus_add_driver from driver_register+0xac/0xf0
[    1.051783]  driver_register from do_one_initcall+0x74/0x1b8
[    1.057495]  do_one_initcall from kernel_init_freeable+0x1a8/0x1ec
[    1.063723]  kernel_init_freeable from kernel_init+0x10/0x108
[    1.069514]  kernel_init from ret_from_fork+0x14/0x3c
[    1.074604] Exception stack(0xc1835fb0 to 0xc1835ff8)
[    1.079691] 5fa0:                                     00000000
00000000 00000000 00000000
[    1.087915] 5fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[    1.096136] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    1.102787] ---[ end trace 0000000000000000 ]---
[    1.107435] ------------[ cut here ]------------

I bisected it down to commit 077ee78e392869e46ae (PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable).

Re-enabling PCI/MSI arch fallbacks restores a clean bootlog.

---
 arch/arm/mach-mvebu/Kconfig |    1 +
 1 file changed, 1 insertion(+)

Index: b/arch/arm/mach-mvebu/Kconfig
===================================================================

arch/arm/mach-mvebu/Kconfig config MACH_KIRKWOOD · line 129

Quoted 7 lines
arch/arm/mach-mvebu/Kconfig +1 -0
@@ -123,6 +123,7 @@ config MACH_KIRKWOOD
 	select ORION_IRQCHIP
 	select ORION_TIMER
 	select FORCE_PCI
+	select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
 	select PCI_QUIRKS
 	select PINCTRL_KIRKWOOD
 	help

This really is papering over the real issue, which probably is that the platform *doesn't* support MSIs, and yet the PCI controller driver doesn't advertises that.

See 645e9c38383d ("PCI: mediatek: Advertise lack of built-in MSI handling") for an example of how to fix your PCI controller driver.

Thanks,

        M.
Signature · 6 lines
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw
Quoted 59 lines · Marc Zyngier
Quoted 58 lines · Domenico Andreoli

From: Domenico Andreoli <[email protected]>

Since v5.10, my QNAP happily barks at boot as follows (5.17.0-rc8):

[    0.923811] ------------[ cut here ]------------
[    0.928458] WARNING: CPU: 0 PID: 1 at drivers/pci/msi/msi.h:17
pci_msi_setup_msi_irqs+0x54/0x6c
[    0.937219] Modules linked in:
[    0.940290] CPU: 0 PID: 1 Comm: swapper Not tainted
5.17.0-rc8-marvell #6
[    0.947117] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[    0.953428]  unwind_backtrace from show_stack+0x10/0x14
[    0.958698]  show_stack from __warn+0xac/0xe4
[    0.963093]  __warn from warn_slowpath_fmt+0x68/0x80
[    0.968098]  warn_slowpath_fmt from pci_msi_setup_msi_irqs+0x54/0x6c
[    0.974499]  pci_msi_setup_msi_irqs from
__pci_enable_msi_range+0x260/0x340
[    0.981509]  __pci_enable_msi_range from
pci_alloc_irq_vectors_affinity+0xb8/0xf8
[    0.989043]  pci_alloc_irq_vectors_affinity from xhci_run+0x164/0x474
[    0.995532]  xhci_run from usb_add_hcd+0x444/0x6e0
[    1.000362]  usb_add_hcd from usb_hcd_pci_probe+0x30c/0x37c
[    1.005979]  usb_hcd_pci_probe from xhci_pci_probe+0x10/0xec
[    1.011689]  xhci_pci_probe from pci_device_probe+0x74/0xe8
[    1.017305]  pci_device_probe from really_probe+0x1c0/0x3f8
[    1.022921]  really_probe from driver_probe_device+0x30/0xb0
[    1.028623]  driver_probe_device from __driver_attach+0x11c/0x148
[    1.034762]  __driver_attach from bus_for_each_dev+0x54/0x78
[    1.040466]  bus_for_each_dev from bus_add_driver+0x170/0x1d8
[    1.046256]  bus_add_driver from driver_register+0xac/0xf0
[    1.051783]  driver_register from do_one_initcall+0x74/0x1b8
[    1.057495]  do_one_initcall from kernel_init_freeable+0x1a8/0x1ec
[    1.063723]  kernel_init_freeable from kernel_init+0x10/0x108
[    1.069514]  kernel_init from ret_from_fork+0x14/0x3c
[    1.074604] Exception stack(0xc1835fb0 to 0xc1835ff8)
[    1.079691] 5fa0:                                     00000000
00000000 00000000 00000000
[    1.087915] 5fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[    1.096136] 5fe0: 00000000 00000000 00000000 00000000 00000013
00000000
[    1.102787] ---[ end trace 0000000000000000 ]---
[    1.107435] ------------[ cut here ]------------

I bisected it down to commit 077ee78e392869e46ae (PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable).

Re-enabling PCI/MSI arch fallbacks restores a clean bootlog.

---
 arch/arm/mach-mvebu/Kconfig |    1 +
 1 file changed, 1 insertion(+)
Quoted 16 lines

arch/arm/mach-mvebu/Kconfig config MACH_KIRKWOOD · line 129

Quoted 12 lines

Index: b/arch/arm/mach-mvebu/Kconfig
===================================================================

arch/arm/mach-mvebu/Kconfig +1 -0
@@ -123,6 +123,7 @@ config MACH_KIRKWOOD
 	select ORION_IRQCHIP
 	select ORION_TIMER
 	select FORCE_PCI
+	select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
 	select PCI_QUIRKS
 	select PINCTRL_KIRKWOOD
 	help

This really is papering over the real issue, which probably is that the platform *doesn't* support MSIs, and yet the PCI controller driver doesn't advertises that.

I'll investigate this.

Quoted 3 lines

See 645e9c38383d ("PCI: mediatek: Advertise lack of built-in MSI handling") for an example of how to fix your PCI controller driver.

Thanks for the pointer!

Dom

Quoted 6 lines

Thanks,

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Signature · 7 lines
rsa4096: 3B10 0CA1 8674 ACBA B4FE  FCD2 CE5B CF17 9960 DE13
ed25519: FFB4 0CC3 7F2E 091D F7DA  356E CC79 2832 ED38 CB05

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel