diff mbox series

[2/2] ppc/pnv: Fix PCI_EXPRESS dependency

Message ID 20200205204115.555212-3-lvivier@redhat.com (mailing list archive)
State New, archived
Headers show
Series ppc/pnv: fix build dependencies | expand

Commit Message

Laurent Vivier Feb. 5, 2020, 8:41 p.m. UTC
When PHB4 bridge has been added, the dependencies to PCIE_PORT has been
added to XIVE_SPAPR and indirectly to PSERIES.
The build of the PowerNV machine is fine while we also build the PSERIES
machine.
If we disable the PSERIES machine, the PowerNV build fails because the
PCI Express files are not built:

/usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':
.../hw/ppc/pnv.c:623: undefined reference to `pnv_phb3_msi_pic_print_info'
/usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power9_pic_print_info':
.../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'
/usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':
.../hw/usb/hcd-ehci-pci.c:129: undefined reference to `pci_default_write_config'
/usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_realize':
.../hw/usb/hcd-ehci-pci.c:68: undefined reference to `pci_allocate_irq'
/usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference to `pci_register_bar'
/usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'

This patch fixes the problem by adding needed dependencies to POWERNV.

Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 hw/ppc/Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Greg Kurz Feb. 5, 2020, 9:20 p.m. UTC | #1
On Wed,  5 Feb 2020 21:41:15 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> When PHB4 bridge has been added, the dependencies to PCIE_PORT has been
> added to XIVE_SPAPR and indirectly to PSERIES.
> The build of the PowerNV machine is fine while we also build the PSERIES
> machine.
> If we disable the PSERIES machine, the PowerNV build fails because the
> PCI Express files are not built:
> 
> /usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':
> .../hw/ppc/pnv.c:623: undefined reference to `pnv_phb3_msi_pic_print_info'
> /usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power9_pic_print_info':
> .../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'
> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':
> .../hw/usb/hcd-ehci-pci.c:129: undefined reference to `pci_default_write_config'
> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_realize':
> .../hw/usb/hcd-ehci-pci.c:68: undefined reference to `pci_allocate_irq'
> /usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference to `pci_register_bar'
> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'
> 
> This patch fixes the problem by adding needed dependencies to POWERNV.
> 
> Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  hw/ppc/Kconfig | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
> index 354828bf132f..3e11d0b53e11 100644
> --- a/hw/ppc/Kconfig
> +++ b/hw/ppc/Kconfig
> @@ -29,6 +29,10 @@ config POWERNV
>      select XICS
>      select XIVE
>      select FDT_PPC
> +    select PCI

Is it needed since PCI_EXPRESS already selects PCI in hw/pci/Kconfig ?

Apart from that:

Reviewed-by: Greg Kurz <groug@kaod.org>

> +    select PCI_EXPRESS
> +    select MSI_NONBROKEN
> +    select PCIE_PORT
>  
>  config PPC405
>      bool
> @@ -135,8 +139,6 @@ config XIVE_SPAPR
>      default y
>      depends on PSERIES
>      select XIVE
> -    select PCI
> -    select PCIE_PORT
>  
>  config XIVE_KVM
>      bool
Laurent Vivier Feb. 5, 2020, 11:17 p.m. UTC | #2
On 05/02/2020 22:20, Greg Kurz wrote:
> On Wed,  5 Feb 2020 21:41:15 +0100
> Laurent Vivier <lvivier@redhat.com> wrote:
> 
>> When PHB4 bridge has been added, the dependencies to PCIE_PORT has been
>> added to XIVE_SPAPR and indirectly to PSERIES.
>> The build of the PowerNV machine is fine while we also build the PSERIES
>> machine.
>> If we disable the PSERIES machine, the PowerNV build fails because the
>> PCI Express files are not built:
>>
>> /usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':
>> .../hw/ppc/pnv.c:623: undefined reference to `pnv_phb3_msi_pic_print_info'
>> /usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power9_pic_print_info':
>> .../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'
>> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':
>> .../hw/usb/hcd-ehci-pci.c:129: undefined reference to `pci_default_write_config'
>> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_realize':
>> .../hw/usb/hcd-ehci-pci.c:68: undefined reference to `pci_allocate_irq'
>> /usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference to `pci_register_bar'
>> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'
>>
>> This patch fixes the problem by adding needed dependencies to POWERNV.
>>
>> Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>>  hw/ppc/Kconfig | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
>> index 354828bf132f..3e11d0b53e11 100644
>> --- a/hw/ppc/Kconfig
>> +++ b/hw/ppc/Kconfig
>> @@ -29,6 +29,10 @@ config POWERNV
>>      select XICS
>>      select XIVE
>>      select FDT_PPC
>> +    select PCI
> 
> Is it needed since PCI_EXPRESS already selects PCI in hw/pci/Kconfig ?
> 

You are right, and PCIE_PORT is not needed too, because
PCIE_PORT is default to 'y' if PCI_DEVICES.

> Apart from that:
> 
> Reviewed-by: Greg Kurz <groug@kaod.org>
> 
>> +    select PCI_EXPRESS
>> +    select MSI_NONBROKEN
>> +    select PCIE_PORT
>>  
>>  config PPC405
>>      bool
>> @@ -135,8 +139,6 @@ config XIVE_SPAPR
>>      default y
>>      depends on PSERIES
>>      select XIVE
>> -    select PCI
>> -    select PCIE_PORT
>>  
>>  config XIVE_KVM
>>      bool
>
Thomas Huth Feb. 6, 2020, 6:31 a.m. UTC | #3
On 06/02/2020 00.17, Laurent Vivier wrote:
> On 05/02/2020 22:20, Greg Kurz wrote:
>> On Wed,  5 Feb 2020 21:41:15 +0100
>> Laurent Vivier <lvivier@redhat.com> wrote:
>>
>>> When PHB4 bridge has been added, the dependencies to PCIE_PORT has been
>>> added to XIVE_SPAPR and indirectly to PSERIES.
>>> The build of the PowerNV machine is fine while we also build the PSERIES
>>> machine.
>>> If we disable the PSERIES machine, the PowerNV build fails because the
>>> PCI Express files are not built:
>>>
>>> /usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power8_pic_print_info':
>>> .../hw/ppc/pnv.c:623: undefined reference to `pnv_phb3_msi_pic_print_info'
>>> /usr/bin/ld: hw/ppc/pnv.o: in function `pnv_chip_power9_pic_print_info':
>>> .../hw/ppc/pnv.c:639: undefined reference to `pnv_phb4_pic_print_info'
>>> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_write_config':
>>> .../hw/usb/hcd-ehci-pci.c:129: undefined reference to `pci_default_write_config'
>>> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o: in function `usb_ehci_pci_realize':
>>> .../hw/usb/hcd-ehci-pci.c:68: undefined reference to `pci_allocate_irq'
>>> /usr/bin/ld: .../hw/usb/hcd-ehci-pci.c:72: undefined reference to `pci_register_bar'
>>> /usr/bin/ld: ../hw/usb/hcd-ehci-pci.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'
>>>
>>> This patch fixes the problem by adding needed dependencies to POWERNV.
>>>
>>> Fixes: 4f9924c4d4cf ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>> ---
>>>  hw/ppc/Kconfig | 6 ++++--
>>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
>>> index 354828bf132f..3e11d0b53e11 100644
>>> --- a/hw/ppc/Kconfig
>>> +++ b/hw/ppc/Kconfig
>>> @@ -29,6 +29,10 @@ config POWERNV
>>>      select XICS
>>>      select XIVE
>>>      select FDT_PPC
>>> +    select PCI
>>
>> Is it needed since PCI_EXPRESS already selects PCI in hw/pci/Kconfig ?
>>
> 
> You are right, and PCIE_PORT is not needed too, because
> PCIE_PORT is default to 'y' if PCI_DEVICES.

If it's a hard requirement for linking, then it is needed here. Try to
compile after running "configure --without-default-devices" to see
whether you've got all dependencies really right.

 Thomas
diff mbox series

Patch

diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 354828bf132f..3e11d0b53e11 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -29,6 +29,10 @@  config POWERNV
     select XICS
     select XIVE
     select FDT_PPC
+    select PCI
+    select PCI_EXPRESS
+    select MSI_NONBROKEN
+    select PCIE_PORT
 
 config PPC405
     bool
@@ -135,8 +139,6 @@  config XIVE_SPAPR
     default y
     depends on PSERIES
     select XIVE
-    select PCI
-    select PCIE_PORT
 
 config XIVE_KVM
     bool