* [PATCH v2 0/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST
@ 2022-11-16 20:50 Bjorn Helgaas
2022-11-16 20:50 ` [PATCH v2 1/2] PCI: Drop of_match_ptr() to avoid unused variables Bjorn Helgaas
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2022-11-16 20:50 UTC (permalink / raw)
To: linux-pci
Cc: Lorenzo Pieralisi, Geert Uytterhoeven, Pali Rohár,
Rob Herring, Krzysztof Wilczyński, linux-arm-kernel,
linux-kernel, Bjorn Helgaas
From: Bjorn Helgaas <bhelgaas@google.com>
Update CONFIG_OF dependencies so we can compile-test drivers (with
CONFIG_COMPILE_TEST=y) even without CONFIG_OF being enabled. OF provides
stub functions when CONFIG_OF is not set.
Changes from v1 to v2:
- Retain "depends on OF || COMPILE_TEST" instead of dropping "depends on
OF" completely so drivers are only offered when they are applicable or
COMPILE_SET is enabled (many thanks to Geert for pointing out this
major mistake)
v1: https://lore.kernel.org/r/20221025191339.667614-1-helgaas@kernel.org
Bjorn Helgaas (2):
PCI: Drop of_match_ptr() to avoid unused variables
PCI: Allow building CONFIG_OF drivers with COMPILE_TEST
drivers/pci/controller/Kconfig | 34 +++++++++++----------
drivers/pci/controller/cadence/Kconfig | 12 ++++----
drivers/pci/controller/dwc/Kconfig | 40 ++++++++++++++++---------
drivers/pci/controller/mobiveil/Kconfig | 2 +-
drivers/pci/controller/pci-ftpci100.c | 2 +-
drivers/pci/controller/pci-v3-semi.c | 2 +-
6 files changed, 53 insertions(+), 39 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 1/2] PCI: Drop of_match_ptr() to avoid unused variables 2022-11-16 20:50 [PATCH v2 0/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas @ 2022-11-16 20:50 ` Bjorn Helgaas 2022-11-16 20:51 ` [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas 2022-11-17 22:32 ` [PATCH v2 0/2] " Bjorn Helgaas 2 siblings, 0 replies; 8+ messages in thread From: Bjorn Helgaas @ 2022-11-16 20:50 UTC (permalink / raw) To: linux-pci Cc: Lorenzo Pieralisi, Geert Uytterhoeven, Pali Rohár, Rob Herring, Krzysztof Wilczyński, linux-arm-kernel, linux-kernel, Bjorn Helgaas From: Bjorn Helgaas <bhelgaas@google.com> We have stubs for most OF interfaces even when CONFIG_OF is not set, so we allow building of most controller drivers in that case for compile testing. When CONFIG_OF is not set, "of_match_ptr(<match_table>)" compiles to NULL, which leaves <match_table> unused, resulting in errors like this: $ make W=1 drivers/pci/controller/pci-xgene.c:636:34: error: ‘xgene_pcie_match_table’ defined but not used [-Werror=unused-const-variable=] Drop of_match_ptr() to avoid the unused variable warning. See also 1dff012f636d ("PCI: Drop of_match_ptr() to avoid unused variables"). Link: https://lore.kernel.org/r/20221025191339.667614-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- drivers/pci/controller/pci-ftpci100.c | 2 +- drivers/pci/controller/pci-v3-semi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pci-ftpci100.c b/drivers/pci/controller/pci-ftpci100.c index 0cfd9d5a497c..ecd3009df586 100644 --- a/drivers/pci/controller/pci-ftpci100.c +++ b/drivers/pci/controller/pci-ftpci100.c @@ -553,7 +553,7 @@ static const struct of_device_id faraday_pci_of_match[] = { static struct platform_driver faraday_pci_driver = { .driver = { .name = "ftpci100", - .of_match_table = of_match_ptr(faraday_pci_of_match), + .of_match_table = faraday_pci_of_match, .suppress_bind_attrs = true, }, .probe = faraday_pci_probe, diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c index 784fcf35599c..ca44b0c83d1b 100644 --- a/drivers/pci/controller/pci-v3-semi.c +++ b/drivers/pci/controller/pci-v3-semi.c @@ -901,7 +901,7 @@ static const struct of_device_id v3_pci_of_match[] = { static struct platform_driver v3_pci_driver = { .driver = { .name = "pci-v3-semi", - .of_match_table = of_match_ptr(v3_pci_of_match), + .of_match_table = v3_pci_of_match, .suppress_bind_attrs = true, }, .probe = v3_pci_probe, -- 2.25.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST 2022-11-16 20:50 [PATCH v2 0/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas 2022-11-16 20:50 ` [PATCH v2 1/2] PCI: Drop of_match_ptr() to avoid unused variables Bjorn Helgaas @ 2022-11-16 20:51 ` Bjorn Helgaas 2022-11-17 8:55 ` Geert Uytterhoeven 2022-11-30 14:29 ` Bjorn Helgaas 2022-11-17 22:32 ` [PATCH v2 0/2] " Bjorn Helgaas 2 siblings, 2 replies; 8+ messages in thread From: Bjorn Helgaas @ 2022-11-16 20:51 UTC (permalink / raw) To: linux-pci Cc: Lorenzo Pieralisi, Geert Uytterhoeven, Pali Rohár, Rob Herring, Krzysztof Wilczyński, linux-arm-kernel, linux-kernel, Bjorn Helgaas From: Bjorn Helgaas <bhelgaas@google.com> Many drivers depend on OF interfaces, so they won't be functional if CONFIG_OF is not set. But OF provides stub functions in that case, so make them buildable if CONFIG_COMPILE_TEST is set. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- drivers/pci/controller/Kconfig | 34 +++++++++++---------- drivers/pci/controller/cadence/Kconfig | 12 ++++---- drivers/pci/controller/dwc/Kconfig | 40 ++++++++++++++++--------- drivers/pci/controller/mobiveil/Kconfig | 2 +- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig index bfd9bac37e24..a62e9fbb69ca 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig @@ -8,7 +8,7 @@ config PCI_MVEBU depends on ARCH_MVEBU || ARCH_DOVE || COMPILE_TEST depends on MVEBU_MBUS depends on ARM - depends on OF + depends on OF || COMPILE_TEST select PCI_BRIDGE_EMUL help Add support for Marvell EBU PCIe controller. This PCIe controller @@ -18,7 +18,7 @@ config PCI_MVEBU config PCI_AARDVARK tristate "Aardvark PCIe controller" depends on (ARCH_MVEBU && ARM64) || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCI_BRIDGE_EMUL help @@ -38,13 +38,14 @@ config PCIE_XILINX_NWL config PCI_FTPCI100 bool "Faraday Technology FTPCI100 PCI controller" - depends on OF + depends on OF || COMPILE_TEST default ARCH_GEMINI config PCI_IXP4XX bool "Intel IXP4xx PCI controller" - depends on ARM && OF + depends on ARM depends on ARCH_IXP4XX || COMPILE_TEST + depends on OF || COMPILE_TEST default ARCH_IXP4XX help Say Y here if you want support for the PCI host controller found @@ -89,7 +90,7 @@ config PCI_HOST_COMMON config PCI_HOST_GENERIC tristate "Generic PCI host controller" - depends on OF + depends on OF || COMPILE_TEST select PCI_HOST_COMMON select IRQ_DOMAIN help @@ -115,7 +116,7 @@ config PCIE_XILINX_CPM config PCI_XGENE bool "X-Gene PCIe controller" depends on ARM64 || COMPILE_TEST - depends on OF || (ACPI && PCI_QUIRKS) + depends on (OF || COMPILE_TEST) || (ACPI && PCI_QUIRKS) help Say Y here if you want internal PCI support on APM X-Gene SoC. There are 5 internal PCIe ports available. Each port is GEN3 capable @@ -132,7 +133,7 @@ config PCI_XGENE_MSI config PCI_V3_SEMI bool "V3 Semiconductor PCI controller" - depends on OF + depends on OF || COMPILE_TEST depends on ARM || COMPILE_TEST default ARCH_INTEGRATOR_AP @@ -150,7 +151,7 @@ config PCIE_IPROC config PCIE_IPROC_PLATFORM tristate "Broadcom iProc PCIe platform bus driver" depends on ARCH_BCM_IPROC || (ARM && COMPILE_TEST) - depends on OF + depends on OF || COMPILE_TEST select PCIE_IPROC default ARCH_BCM_IPROC help @@ -194,7 +195,7 @@ config PCIE_ALTERA_MSI config PCI_HOST_THUNDER_PEM bool "Cavium Thunder PCIe controller to off-chip devices" depends on ARM64 || COMPILE_TEST - depends on OF || (ACPI && PCI_QUIRKS) + depends on (OF || COMPILE_TEST) || (ACPI && PCI_QUIRKS) select PCI_HOST_COMMON help Say Y here if you want PCIe support for CN88XX Cavium Thunder SoCs. @@ -202,7 +203,7 @@ config PCI_HOST_THUNDER_PEM config PCI_HOST_THUNDER_ECAM bool "Cavium Thunder ECAM controller to on-chip devices on pass-1.x silicon" depends on ARM64 || COMPILE_TEST - depends on OF || (ACPI && PCI_QUIRKS) + depends on (OF || COMPILE_TEST) || (ACPI && PCI_QUIRKS) select PCI_HOST_COMMON help Say Y here if you want ECAM support for CN88XX-Pass-1.x Cavium Thunder SoCs. @@ -214,7 +215,7 @@ config PCIE_ROCKCHIP config PCIE_ROCKCHIP_HOST tristate "Rockchip PCIe host controller" depends on ARCH_ROCKCHIP || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select MFD_SYSCON select PCIE_ROCKCHIP @@ -226,7 +227,7 @@ config PCIE_ROCKCHIP_HOST config PCIE_ROCKCHIP_EP bool "Rockchip PCIe endpoint controller" depends on ARCH_ROCKCHIP || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST depends on PCI_ENDPOINT select MFD_SYSCON select PCIE_ROCKCHIP @@ -238,7 +239,7 @@ config PCIE_ROCKCHIP_EP config PCIE_MEDIATEK tristate "MediaTek PCIe controller" depends on ARCH_AIROHA || ARCH_MEDIATEK || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN help Say Y here if you want to enable PCIe controller support on @@ -276,7 +277,7 @@ config PCIE_BRCMSTB tristate "Broadcom Brcmstb PCIe host controller" depends on ARCH_BRCMSTB || ARCH_BCM2835 || ARCH_BCMBCA || \ BMIPS_GENERIC || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN default ARCH_BRCMSTB || BMIPS_GENERIC help @@ -302,7 +303,8 @@ config PCI_LOONGSON config PCIE_MICROCHIP_HOST bool "Microchip AXI PCIe host bridge support" - depends on PCI_MSI && OF + depends on OF || COMPILE_TEST + depends on PCI_MSI select PCI_MSI_IRQ_DOMAIN select GENERIC_MSI_IRQ_DOMAIN select PCI_HOST_COMMON @@ -325,7 +327,7 @@ config PCIE_APPLE_MSI_DOORBELL_ADDR config PCIE_APPLE tristate "Apple PCIe controller" depends on ARCH_APPLE || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCI_HOST_COMMON help diff --git a/drivers/pci/controller/cadence/Kconfig b/drivers/pci/controller/cadence/Kconfig index 5d30564190e1..44f18b88817f 100644 --- a/drivers/pci/controller/cadence/Kconfig +++ b/drivers/pci/controller/cadence/Kconfig @@ -8,13 +8,13 @@ config PCIE_CADENCE config PCIE_CADENCE_HOST bool - depends on OF + depends on OF || COMPILE_TEST select IRQ_DOMAIN select PCIE_CADENCE config PCIE_CADENCE_EP bool - depends on OF + depends on OF || COMPILE_TEST depends on PCI_ENDPOINT select PCIE_CADENCE @@ -23,7 +23,7 @@ config PCIE_CADENCE_PLAT config PCIE_CADENCE_PLAT_HOST bool "Cadence PCIe platform host controller" - depends on OF + depends on OF || COMPILE_TEST select PCIE_CADENCE_HOST select PCIE_CADENCE_PLAT help @@ -33,7 +33,7 @@ config PCIE_CADENCE_PLAT_HOST config PCIE_CADENCE_PLAT_EP bool "Cadence PCIe platform endpoint controller" - depends on OF + depends on OF || COMPILE_TEST depends on PCI_ENDPOINT select PCIE_CADENCE_EP select PCIE_CADENCE_PLAT @@ -47,7 +47,7 @@ config PCI_J721E config PCI_J721E_HOST bool "TI J721E PCIe platform host controller" - depends on OF + depends on OF || COMPILE_TEST select PCIE_CADENCE_HOST select PCI_J721E help @@ -57,7 +57,7 @@ config PCI_J721E_HOST config PCI_J721E_EP bool "TI J721E PCIe platform endpoint controller" - depends on OF + depends on OF || COMPILE_TEST depends on PCI_ENDPOINT select PCIE_CADENCE_EP select PCI_J721E diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig index 62ce3abf0f19..aa0a2fcd41f1 100644 --- a/drivers/pci/controller/dwc/Kconfig +++ b/drivers/pci/controller/dwc/Kconfig @@ -20,7 +20,8 @@ config PCI_DRA7XX config PCI_DRA7XX_HOST tristate "TI DRA7xx PCIe controller Host Mode" depends on SOC_DRA7XX || COMPILE_TEST - depends on OF && HAS_IOMEM && TI_PIPE3 + depends on OF || COMPILE_TEST + depends on HAS_IOMEM && TI_PIPE3 depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST select PCI_DRA7XX @@ -36,7 +37,8 @@ config PCI_DRA7XX_HOST config PCI_DRA7XX_EP tristate "TI DRA7xx PCIe controller Endpoint Mode" depends on SOC_DRA7XX || COMPILE_TEST - depends on OF && HAS_IOMEM && TI_PIPE3 + depends on OF || COMPILE_TEST + depends on HAS_IOMEM && TI_PIPE3 depends on PCI_ENDPOINT select PCIE_DW_EP select PCI_DRA7XX @@ -134,7 +136,8 @@ config PCI_KEYSTONE_EP config PCI_LAYERSCAPE bool "Freescale Layerscape PCIe controller - Host mode" - depends on OF && (ARM || ARCH_LAYERSCAPE || COMPILE_TEST) + depends on ARM || ARCH_LAYERSCAPE || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST select MFD_SYSCON @@ -147,7 +150,8 @@ config PCI_LAYERSCAPE config PCI_LAYERSCAPE_EP bool "Freescale Layerscape PCIe controller - Endpoint mode" - depends on OF && (ARM || ARCH_LAYERSCAPE || COMPILE_TEST) + depends on ARM || ARCH_LAYERSCAPE || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_ENDPOINT select PCIE_DW_EP help @@ -158,8 +162,9 @@ config PCI_LAYERSCAPE_EP controller works in RC mode. config PCI_HISI - depends on OF && (ARM64 || COMPILE_TEST) bool "HiSilicon Hip05 and Hip06 SoCs PCIe controllers" + depends on ARM64 || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST select PCI_HOST_COMMON @@ -169,7 +174,8 @@ config PCI_HISI config PCIE_QCOM bool "Qualcomm PCIe controller" - depends on OF && (ARCH_QCOM || COMPILE_TEST) + depends on ARCH_QCOM || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST select CRC8 @@ -180,7 +186,8 @@ config PCIE_QCOM config PCIE_QCOM_EP tristate "Qualcomm PCIe controller - Endpoint mode" - depends on OF && (ARCH_QCOM || COMPILE_TEST) + depends on ARCH_QCOM || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_ENDPOINT select PCIE_DW_EP help @@ -226,16 +233,17 @@ config PCIE_ROCKCHIP_DW_HOST bool "Rockchip DesignWare PCIe controller" select PCIE_DW select PCIE_DW_HOST - depends on PCI_MSI_IRQ_DOMAIN depends on ARCH_ROCKCHIP || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST + depends on PCI_MSI_IRQ_DOMAIN help Enables support for the DesignWare PCIe controller in the Rockchip SoC except RK3399. config PCIE_INTEL_GW bool "Intel Gateway PCIe host controller support" - depends on OF && (X86 || COMPILE_TEST) + depends on X86 || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST help @@ -273,8 +281,9 @@ config PCIE_KEEMBAY_EP DesignWare core functions. config PCIE_KIRIN - depends on OF && (ARM64 || COMPILE_TEST) tristate "HiSilicon Kirin series SoCs PCIe controllers" + depends on ARM64 || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST help @@ -345,7 +354,8 @@ config PCIE_VISCONTI_HOST config PCIE_UNIPHIER bool "Socionext UniPhier PCIe host controllers" depends on ARCH_UNIPHIER || COMPILE_TEST - depends on OF && HAS_IOMEM + depends on OF || COMPILE_TEST + depends on HAS_IOMEM depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST help @@ -355,7 +365,8 @@ config PCIE_UNIPHIER config PCIE_UNIPHIER_EP bool "Socionext UniPhier PCIe endpoint controllers" depends on ARCH_UNIPHIER || COMPILE_TEST - depends on OF && HAS_IOMEM + depends on OF || COMPILE_TEST + depends on HAS_IOMEM depends on PCI_ENDPOINT select PCIE_DW_EP help @@ -364,7 +375,8 @@ config PCIE_UNIPHIER_EP config PCIE_AL bool "Amazon Annapurna Labs PCIe controller" - depends on OF && (ARM64 || COMPILE_TEST) + depends on ARM64 || COMPILE_TEST + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST select PCI_ECAM diff --git a/drivers/pci/controller/mobiveil/Kconfig b/drivers/pci/controller/mobiveil/Kconfig index e4643fb94e78..24ea35927185 100644 --- a/drivers/pci/controller/mobiveil/Kconfig +++ b/drivers/pci/controller/mobiveil/Kconfig @@ -14,7 +14,7 @@ config PCIE_MOBIVEIL_HOST config PCIE_MOBIVEIL_PLAT bool "Mobiveil AXI PCIe controller" depends on ARCH_ZYNQMP || COMPILE_TEST - depends on OF + depends on OF || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_MOBIVEIL_HOST help -- 2.25.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST 2022-11-16 20:51 ` [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas @ 2022-11-17 8:55 ` Geert Uytterhoeven 2022-11-17 8:55 ` Geert Uytterhoeven 2022-11-17 19:38 ` Bjorn Helgaas 2022-11-30 14:29 ` Bjorn Helgaas 1 sibling, 2 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2022-11-17 8:55 UTC (permalink / raw) To: Bjorn Helgaas Cc: linux-pci, Lorenzo Pieralisi, Pali Rohár, Rob Herring, Krzysztof Wilczyński, linux-arm-kernel, linux-kernel, Bjorn Helgaas Hi Bjorn, On Wed, Nov 16, 2022 at 9:51 PM Bjorn Helgaas <helgaas@kernel.org> wrote: > From: Bjorn Helgaas <bhelgaas@google.com> > > Many drivers depend on OF interfaces, so they won't be functional if > CONFIG_OF is not set. But OF provides stub functions in that case, so make > them buildable if CONFIG_COMPILE_TEST is set. > > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Thanks for the update! > --- a/drivers/pci/controller/cadence/Kconfig > +++ b/drivers/pci/controller/cadence/Kconfig > @@ -158,8 +162,9 @@ config PCI_LAYERSCAPE_EP > controller works in RC mode. > > config PCI_HISI > - depends on OF && (ARM64 || COMPILE_TEST) > bool "HiSilicon Hip05 and Hip06 SoCs PCIe controllers" > + depends on ARM64 || COMPILE_TEST > + depends on OF || COMPILE_TEST Note that ARM64 selects OF, so this (and a few others) could be simplified by dropping the "depends on OF || COMPILE_TEST". But that might be the scope of a different patch? > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > select PCI_HOST_COMMON Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST 2022-11-17 8:55 ` Geert Uytterhoeven @ 2022-11-17 8:55 ` Geert Uytterhoeven 2022-11-17 19:38 ` Bjorn Helgaas 1 sibling, 0 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2022-11-17 8:55 UTC (permalink / raw) To: Bjorn Helgaas Cc: linux-pci, Lorenzo Pieralisi, Pali Rohár, Rob Herring, Krzysztof Wilczyński, linux-arm-kernel, linux-kernel, Bjorn Helgaas On Thu, Nov 17, 2022 at 9:55 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > On Wed, Nov 16, 2022 at 9:51 PM Bjorn Helgaas <helgaas@kernel.org> wrote: > > From: Bjorn Helgaas <bhelgaas@google.com> > > > > Many drivers depend on OF interfaces, so they won't be functional if > > CONFIG_OF is not set. But OF provides stub functions in that case, so make > > them buildable if CONFIG_COMPILE_TEST is set. > > > > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> > > Thanks for the update! Forgot the most important part ;-) Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST 2022-11-17 8:55 ` Geert Uytterhoeven 2022-11-17 8:55 ` Geert Uytterhoeven @ 2022-11-17 19:38 ` Bjorn Helgaas 1 sibling, 0 replies; 8+ messages in thread From: Bjorn Helgaas @ 2022-11-17 19:38 UTC (permalink / raw) To: Geert Uytterhoeven Cc: linux-pci, Lorenzo Pieralisi, Pali Rohár, Rob Herring, Krzysztof Wilczyński, linux-arm-kernel, linux-kernel, Bjorn Helgaas On Thu, Nov 17, 2022 at 09:55:08AM +0100, Geert Uytterhoeven wrote: > On Wed, Nov 16, 2022 at 9:51 PM Bjorn Helgaas <helgaas@kernel.org> wrote: > > From: Bjorn Helgaas <bhelgaas@google.com> > > config PCI_HISI > > - depends on OF && (ARM64 || COMPILE_TEST) > > bool "HiSilicon Hip05 and Hip06 SoCs PCIe controllers" > > + depends on ARM64 || COMPILE_TEST > > + depends on OF || COMPILE_TEST > > Note that ARM64 selects OF, so this (and a few others) could be > simplified by dropping the "depends on OF || COMPILE_TEST". > But that might be the scope of a different patch? Hmm, yes. I don't really know what to do here, so I left it for now. ARM64 does indeed select OF, but I'm not sure whether that's an actual arch dependency or just a convenience because most ARM64 platforms rely on it. I know there are some that use ACPI, and I don't know whether they *also* need OF. Bjorn ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST 2022-11-16 20:51 ` [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas 2022-11-17 8:55 ` Geert Uytterhoeven @ 2022-11-30 14:29 ` Bjorn Helgaas 1 sibling, 0 replies; 8+ messages in thread From: Bjorn Helgaas @ 2022-11-30 14:29 UTC (permalink / raw) To: linux-pci Cc: Lorenzo Pieralisi, Geert Uytterhoeven, Pali Rohár, Rob Herring, Krzysztof Wilczyński, linux-arm-kernel, linux-kernel, Bjorn Helgaas, Jean Delvare [+cc Jean] On Wed, Nov 16, 2022 at 02:51:00PM -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas <bhelgaas@google.com> > > Many drivers depend on OF interfaces, so they won't be functional if > CONFIG_OF is not set. But OF provides stub functions in that case, so make > them buildable if CONFIG_COMPILE_TEST is set. > > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> After wasting all your time on this, I think this patch is a bad idea and I should drop it. Jean pointed out at [1] that after 0166dc11be91 ("of: make CONFIG_OF user selectable"), we can enable CONFIG_OF on any architecture regardless of whether it *needs* OF, and doing so yields better compile testing than simply using COMPILE_TEST to build without CONFIG_OF. Thank you very much, Jean, for pointing this out! [1] https://lore.kernel.org/r/20221124142441.3a230524@endymion.delvare > --- > drivers/pci/controller/Kconfig | 34 +++++++++++---------- > drivers/pci/controller/cadence/Kconfig | 12 ++++---- > drivers/pci/controller/dwc/Kconfig | 40 ++++++++++++++++--------- > drivers/pci/controller/mobiveil/Kconfig | 2 +- > 4 files changed, 51 insertions(+), 37 deletions(-) > > diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig > index bfd9bac37e24..a62e9fbb69ca 100644 > --- a/drivers/pci/controller/Kconfig > +++ b/drivers/pci/controller/Kconfig > @@ -8,7 +8,7 @@ config PCI_MVEBU > depends on ARCH_MVEBU || ARCH_DOVE || COMPILE_TEST > depends on MVEBU_MBUS > depends on ARM > - depends on OF > + depends on OF || COMPILE_TEST > select PCI_BRIDGE_EMUL > help > Add support for Marvell EBU PCIe controller. This PCIe controller > @@ -18,7 +18,7 @@ config PCI_MVEBU > config PCI_AARDVARK > tristate "Aardvark PCIe controller" > depends on (ARCH_MVEBU && ARM64) || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCI_BRIDGE_EMUL > help > @@ -38,13 +38,14 @@ config PCIE_XILINX_NWL > > config PCI_FTPCI100 > bool "Faraday Technology FTPCI100 PCI controller" > - depends on OF > + depends on OF || COMPILE_TEST > default ARCH_GEMINI > > config PCI_IXP4XX > bool "Intel IXP4xx PCI controller" > - depends on ARM && OF > + depends on ARM > depends on ARCH_IXP4XX || COMPILE_TEST > + depends on OF || COMPILE_TEST > default ARCH_IXP4XX > help > Say Y here if you want support for the PCI host controller found > @@ -89,7 +90,7 @@ config PCI_HOST_COMMON > > config PCI_HOST_GENERIC > tristate "Generic PCI host controller" > - depends on OF > + depends on OF || COMPILE_TEST > select PCI_HOST_COMMON > select IRQ_DOMAIN > help > @@ -115,7 +116,7 @@ config PCIE_XILINX_CPM > config PCI_XGENE > bool "X-Gene PCIe controller" > depends on ARM64 || COMPILE_TEST > - depends on OF || (ACPI && PCI_QUIRKS) > + depends on (OF || COMPILE_TEST) || (ACPI && PCI_QUIRKS) > help > Say Y here if you want internal PCI support on APM X-Gene SoC. > There are 5 internal PCIe ports available. Each port is GEN3 capable > @@ -132,7 +133,7 @@ config PCI_XGENE_MSI > > config PCI_V3_SEMI > bool "V3 Semiconductor PCI controller" > - depends on OF > + depends on OF || COMPILE_TEST > depends on ARM || COMPILE_TEST > default ARCH_INTEGRATOR_AP > > @@ -150,7 +151,7 @@ config PCIE_IPROC > config PCIE_IPROC_PLATFORM > tristate "Broadcom iProc PCIe platform bus driver" > depends on ARCH_BCM_IPROC || (ARM && COMPILE_TEST) > - depends on OF > + depends on OF || COMPILE_TEST > select PCIE_IPROC > default ARCH_BCM_IPROC > help > @@ -194,7 +195,7 @@ config PCIE_ALTERA_MSI > config PCI_HOST_THUNDER_PEM > bool "Cavium Thunder PCIe controller to off-chip devices" > depends on ARM64 || COMPILE_TEST > - depends on OF || (ACPI && PCI_QUIRKS) > + depends on (OF || COMPILE_TEST) || (ACPI && PCI_QUIRKS) > select PCI_HOST_COMMON > help > Say Y here if you want PCIe support for CN88XX Cavium Thunder SoCs. > @@ -202,7 +203,7 @@ config PCI_HOST_THUNDER_PEM > config PCI_HOST_THUNDER_ECAM > bool "Cavium Thunder ECAM controller to on-chip devices on pass-1.x silicon" > depends on ARM64 || COMPILE_TEST > - depends on OF || (ACPI && PCI_QUIRKS) > + depends on (OF || COMPILE_TEST) || (ACPI && PCI_QUIRKS) > select PCI_HOST_COMMON > help > Say Y here if you want ECAM support for CN88XX-Pass-1.x Cavium Thunder SoCs. > @@ -214,7 +215,7 @@ config PCIE_ROCKCHIP > config PCIE_ROCKCHIP_HOST > tristate "Rockchip PCIe host controller" > depends on ARCH_ROCKCHIP || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select MFD_SYSCON > select PCIE_ROCKCHIP > @@ -226,7 +227,7 @@ config PCIE_ROCKCHIP_HOST > config PCIE_ROCKCHIP_EP > bool "Rockchip PCIe endpoint controller" > depends on ARCH_ROCKCHIP || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_ENDPOINT > select MFD_SYSCON > select PCIE_ROCKCHIP > @@ -238,7 +239,7 @@ config PCIE_ROCKCHIP_EP > config PCIE_MEDIATEK > tristate "MediaTek PCIe controller" > depends on ARCH_AIROHA || ARCH_MEDIATEK || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > help > Say Y here if you want to enable PCIe controller support on > @@ -276,7 +277,7 @@ config PCIE_BRCMSTB > tristate "Broadcom Brcmstb PCIe host controller" > depends on ARCH_BRCMSTB || ARCH_BCM2835 || ARCH_BCMBCA || \ > BMIPS_GENERIC || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > default ARCH_BRCMSTB || BMIPS_GENERIC > help > @@ -302,7 +303,8 @@ config PCI_LOONGSON > > config PCIE_MICROCHIP_HOST > bool "Microchip AXI PCIe host bridge support" > - depends on PCI_MSI && OF > + depends on OF || COMPILE_TEST > + depends on PCI_MSI > select PCI_MSI_IRQ_DOMAIN > select GENERIC_MSI_IRQ_DOMAIN > select PCI_HOST_COMMON > @@ -325,7 +327,7 @@ config PCIE_APPLE_MSI_DOORBELL_ADDR > config PCIE_APPLE > tristate "Apple PCIe controller" > depends on ARCH_APPLE || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCI_HOST_COMMON > help > diff --git a/drivers/pci/controller/cadence/Kconfig b/drivers/pci/controller/cadence/Kconfig > index 5d30564190e1..44f18b88817f 100644 > --- a/drivers/pci/controller/cadence/Kconfig > +++ b/drivers/pci/controller/cadence/Kconfig > @@ -8,13 +8,13 @@ config PCIE_CADENCE > > config PCIE_CADENCE_HOST > bool > - depends on OF > + depends on OF || COMPILE_TEST > select IRQ_DOMAIN > select PCIE_CADENCE > > config PCIE_CADENCE_EP > bool > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_ENDPOINT > select PCIE_CADENCE > > @@ -23,7 +23,7 @@ config PCIE_CADENCE_PLAT > > config PCIE_CADENCE_PLAT_HOST > bool "Cadence PCIe platform host controller" > - depends on OF > + depends on OF || COMPILE_TEST > select PCIE_CADENCE_HOST > select PCIE_CADENCE_PLAT > help > @@ -33,7 +33,7 @@ config PCIE_CADENCE_PLAT_HOST > > config PCIE_CADENCE_PLAT_EP > bool "Cadence PCIe platform endpoint controller" > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_ENDPOINT > select PCIE_CADENCE_EP > select PCIE_CADENCE_PLAT > @@ -47,7 +47,7 @@ config PCI_J721E > > config PCI_J721E_HOST > bool "TI J721E PCIe platform host controller" > - depends on OF > + depends on OF || COMPILE_TEST > select PCIE_CADENCE_HOST > select PCI_J721E > help > @@ -57,7 +57,7 @@ config PCI_J721E_HOST > > config PCI_J721E_EP > bool "TI J721E PCIe platform endpoint controller" > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_ENDPOINT > select PCIE_CADENCE_EP > select PCI_J721E > diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig > index 62ce3abf0f19..aa0a2fcd41f1 100644 > --- a/drivers/pci/controller/dwc/Kconfig > +++ b/drivers/pci/controller/dwc/Kconfig > @@ -20,7 +20,8 @@ config PCI_DRA7XX > config PCI_DRA7XX_HOST > tristate "TI DRA7xx PCIe controller Host Mode" > depends on SOC_DRA7XX || COMPILE_TEST > - depends on OF && HAS_IOMEM && TI_PIPE3 > + depends on OF || COMPILE_TEST > + depends on HAS_IOMEM && TI_PIPE3 > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > select PCI_DRA7XX > @@ -36,7 +37,8 @@ config PCI_DRA7XX_HOST > config PCI_DRA7XX_EP > tristate "TI DRA7xx PCIe controller Endpoint Mode" > depends on SOC_DRA7XX || COMPILE_TEST > - depends on OF && HAS_IOMEM && TI_PIPE3 > + depends on OF || COMPILE_TEST > + depends on HAS_IOMEM && TI_PIPE3 > depends on PCI_ENDPOINT > select PCIE_DW_EP > select PCI_DRA7XX > @@ -134,7 +136,8 @@ config PCI_KEYSTONE_EP > > config PCI_LAYERSCAPE > bool "Freescale Layerscape PCIe controller - Host mode" > - depends on OF && (ARM || ARCH_LAYERSCAPE || COMPILE_TEST) > + depends on ARM || ARCH_LAYERSCAPE || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > select MFD_SYSCON > @@ -147,7 +150,8 @@ config PCI_LAYERSCAPE > > config PCI_LAYERSCAPE_EP > bool "Freescale Layerscape PCIe controller - Endpoint mode" > - depends on OF && (ARM || ARCH_LAYERSCAPE || COMPILE_TEST) > + depends on ARM || ARCH_LAYERSCAPE || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_ENDPOINT > select PCIE_DW_EP > help > @@ -158,8 +162,9 @@ config PCI_LAYERSCAPE_EP > controller works in RC mode. > > config PCI_HISI > - depends on OF && (ARM64 || COMPILE_TEST) > bool "HiSilicon Hip05 and Hip06 SoCs PCIe controllers" > + depends on ARM64 || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > select PCI_HOST_COMMON > @@ -169,7 +174,8 @@ config PCI_HISI > > config PCIE_QCOM > bool "Qualcomm PCIe controller" > - depends on OF && (ARCH_QCOM || COMPILE_TEST) > + depends on ARCH_QCOM || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > select CRC8 > @@ -180,7 +186,8 @@ config PCIE_QCOM > > config PCIE_QCOM_EP > tristate "Qualcomm PCIe controller - Endpoint mode" > - depends on OF && (ARCH_QCOM || COMPILE_TEST) > + depends on ARCH_QCOM || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_ENDPOINT > select PCIE_DW_EP > help > @@ -226,16 +233,17 @@ config PCIE_ROCKCHIP_DW_HOST > bool "Rockchip DesignWare PCIe controller" > select PCIE_DW > select PCIE_DW_HOST > - depends on PCI_MSI_IRQ_DOMAIN > depends on ARCH_ROCKCHIP || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > + depends on PCI_MSI_IRQ_DOMAIN > help > Enables support for the DesignWare PCIe controller in the > Rockchip SoC except RK3399. > > config PCIE_INTEL_GW > bool "Intel Gateway PCIe host controller support" > - depends on OF && (X86 || COMPILE_TEST) > + depends on X86 || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > help > @@ -273,8 +281,9 @@ config PCIE_KEEMBAY_EP > DesignWare core functions. > > config PCIE_KIRIN > - depends on OF && (ARM64 || COMPILE_TEST) > tristate "HiSilicon Kirin series SoCs PCIe controllers" > + depends on ARM64 || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > help > @@ -345,7 +354,8 @@ config PCIE_VISCONTI_HOST > config PCIE_UNIPHIER > bool "Socionext UniPhier PCIe host controllers" > depends on ARCH_UNIPHIER || COMPILE_TEST > - depends on OF && HAS_IOMEM > + depends on OF || COMPILE_TEST > + depends on HAS_IOMEM > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > help > @@ -355,7 +365,8 @@ config PCIE_UNIPHIER > config PCIE_UNIPHIER_EP > bool "Socionext UniPhier PCIe endpoint controllers" > depends on ARCH_UNIPHIER || COMPILE_TEST > - depends on OF && HAS_IOMEM > + depends on OF || COMPILE_TEST > + depends on HAS_IOMEM > depends on PCI_ENDPOINT > select PCIE_DW_EP > help > @@ -364,7 +375,8 @@ config PCIE_UNIPHIER_EP > > config PCIE_AL > bool "Amazon Annapurna Labs PCIe controller" > - depends on OF && (ARM64 || COMPILE_TEST) > + depends on ARM64 || COMPILE_TEST > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_DW_HOST > select PCI_ECAM > diff --git a/drivers/pci/controller/mobiveil/Kconfig b/drivers/pci/controller/mobiveil/Kconfig > index e4643fb94e78..24ea35927185 100644 > --- a/drivers/pci/controller/mobiveil/Kconfig > +++ b/drivers/pci/controller/mobiveil/Kconfig > @@ -14,7 +14,7 @@ config PCIE_MOBIVEIL_HOST > config PCIE_MOBIVEIL_PLAT > bool "Mobiveil AXI PCIe controller" > depends on ARCH_ZYNQMP || COMPILE_TEST > - depends on OF > + depends on OF || COMPILE_TEST > depends on PCI_MSI_IRQ_DOMAIN > select PCIE_MOBIVEIL_HOST > help > -- > 2.25.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST 2022-11-16 20:50 [PATCH v2 0/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas 2022-11-16 20:50 ` [PATCH v2 1/2] PCI: Drop of_match_ptr() to avoid unused variables Bjorn Helgaas 2022-11-16 20:51 ` [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas @ 2022-11-17 22:32 ` Bjorn Helgaas 2 siblings, 0 replies; 8+ messages in thread From: Bjorn Helgaas @ 2022-11-17 22:32 UTC (permalink / raw) To: linux-pci Cc: Lorenzo Pieralisi, Geert Uytterhoeven, Pali Rohár, Rob Herring, Krzysztof Wilczyński, linux-arm-kernel, linux-kernel, Bjorn Helgaas On Wed, Nov 16, 2022 at 02:50:58PM -0600, Bjorn Helgaas wrote: > From: Bjorn Helgaas <bhelgaas@google.com> > > Update CONFIG_OF dependencies so we can compile-test drivers (with > CONFIG_COMPILE_TEST=y) even without CONFIG_OF being enabled. OF provides > stub functions when CONFIG_OF is not set. > > Changes from v1 to v2: > - Retain "depends on OF || COMPILE_TEST" instead of dropping "depends on > OF" completely so drivers are only offered when they are applicable or > COMPILE_SET is enabled (many thanks to Geert for pointing out this > major mistake) > > v1: https://lore.kernel.org/r/20221025191339.667614-1-helgaas@kernel.org > > Bjorn Helgaas (2): > PCI: Drop of_match_ptr() to avoid unused variables > PCI: Allow building CONFIG_OF drivers with COMPILE_TEST > > drivers/pci/controller/Kconfig | 34 +++++++++++---------- > drivers/pci/controller/cadence/Kconfig | 12 ++++---- > drivers/pci/controller/dwc/Kconfig | 40 ++++++++++++++++--------- > drivers/pci/controller/mobiveil/Kconfig | 2 +- > drivers/pci/controller/pci-ftpci100.c | 2 +- > drivers/pci/controller/pci-v3-semi.c | 2 +- > 6 files changed, 53 insertions(+), 39 deletions(-) Applied to pci/kbuild for v6.2. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-11-30 14:29 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-11-16 20:50 [PATCH v2 0/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas 2022-11-16 20:50 ` [PATCH v2 1/2] PCI: Drop of_match_ptr() to avoid unused variables Bjorn Helgaas 2022-11-16 20:51 ` [PATCH v2 2/2] PCI: Allow building CONFIG_OF drivers with COMPILE_TEST Bjorn Helgaas 2022-11-17 8:55 ` Geert Uytterhoeven 2022-11-17 8:55 ` Geert Uytterhoeven 2022-11-17 19:38 ` Bjorn Helgaas 2022-11-30 14:29 ` Bjorn Helgaas 2022-11-17 22:32 ` [PATCH v2 0/2] " Bjorn Helgaas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox