diff mbox

[for-2.11,17/26] spapr_pci: introduce drc_id property

Message ID 150100569817.27487.947951250042841104.stgit@bahia
State New
Headers show

Commit Message

Greg Kurz July 25, 2017, 6:01 p.m. UTC
With the addition of PHB hotplug, we have a static number of DRCs
that can be used to handle hotplug/unplug operations on our PHBs,
and need a consistent way to map PHBs to these connectors, and
assign a unique identifiers for the connectors.

This patch adds a drc_id property for that purpose.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/spapr_pci.c          |    1 +
 include/hw/pci-host/spapr.h |    2 ++
 2 files changed, 3 insertions(+)

Comments

David Gibson July 28, 2017, 3:46 a.m. UTC | #1
On Tue, Jul 25, 2017 at 08:01:38PM +0200, Greg Kurz wrote:
> With the addition of PHB hotplug, we have a static number of DRCs
> that can be used to handle hotplug/unplug operations on our PHBs,
> and need a consistent way to map PHBs to these connectors, and
> assign a unique identifiers for the connectors.
> 
> This patch adds a drc_id property for that purpose.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

I'd prefer to see this folded into the patch that actually uses this
property.

> ---
>  hw/ppc/spapr_pci.c          |    1 +
>  include/hw/pci-host/spapr.h |    2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 994d2f36105f..54533d8a3841 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -1878,6 +1878,7 @@ static Property spapr_phb_properties[] = {
>                       pre_2_8_migration, false),
>      DEFINE_PROP_BOOL("pcie-extended-configuration-space", sPAPRPHBState,
>                       pcie_ecs, true),
> +    DEFINE_PROP_UINT32("drc_id", sPAPRPHBState, drc_id, -1),
>      DEFINE_PROP_END_OF_LIST(),
>  };
>  
> diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
> index 5a4e9686d562..31bae68167f2 100644
> --- a/include/hw/pci-host/spapr.h
> +++ b/include/hw/pci-host/spapr.h
> @@ -82,6 +82,8 @@ struct sPAPRPHBState {
>  
>      bool pcie_ecs; /* Allow access to PCIe extended config space? */
>  
> +    uint32_t drc_id;
> +
>      /* Fields for migration compatibility hacks */
>      bool pre_2_8_migration;
>      uint32_t mig_liobn;
>
diff mbox

Patch

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 994d2f36105f..54533d8a3841 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1878,6 +1878,7 @@  static Property spapr_phb_properties[] = {
                      pre_2_8_migration, false),
     DEFINE_PROP_BOOL("pcie-extended-configuration-space", sPAPRPHBState,
                      pcie_ecs, true),
+    DEFINE_PROP_UINT32("drc_id", sPAPRPHBState, drc_id, -1),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 5a4e9686d562..31bae68167f2 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -82,6 +82,8 @@  struct sPAPRPHBState {
 
     bool pcie_ecs; /* Allow access to PCIe extended config space? */
 
+    uint32_t drc_id;
+
     /* Fields for migration compatibility hacks */
     bool pre_2_8_migration;
     uint32_t mig_liobn;