All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.ibm.com>
To: Daniel Henrique Barboza <danielhb413@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, clg@kaod.org
Subject: Re: [PATCH v3 12/12] ppc/pnv: move attach_root_port helper to pnv-phb.c
Date: Wed, 27 Jul 2022 19:44:36 +0200	[thread overview]
Message-ID: <6263ea8b-fe2b-492e-087e-d15b33d91863@linux.ibm.com> (raw)
In-Reply-To: <20220624084921.399219-13-danielhb413@gmail.com>



On 24/06/2022 10:49, Daniel Henrique Barboza wrote:
> The helper is only used in this file.
> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---


Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>

   Fred


>   hw/pci-host/pnv_phb.c | 24 ++++++++++++++++++++++++
>   hw/ppc/pnv.c          | 25 -------------------------
>   include/hw/ppc/pnv.h  |  1 -
>   3 files changed, 24 insertions(+), 26 deletions(-)
> 
> diff --git a/hw/pci-host/pnv_phb.c b/hw/pci-host/pnv_phb.c
> index cc15a949c9..c47ed92462 100644
> --- a/hw/pci-host/pnv_phb.c
> +++ b/hw/pci-host/pnv_phb.c
> @@ -18,6 +18,30 @@
>   #include "hw/qdev-properties.h"
>   #include "qom/object.h"
>   
> +/*
> + * Attach a root port device.
> + *
> + * 'index' will be used both as a PCIE slot value and to calculate
> + * QOM id. 'chip_id' is going to be used as PCIE chassis for the
> + * root port.
> + */
> +static void pnv_phb_attach_root_port(PCIHostState *pci, int index, int chip_id)
> +{
> +    PCIDevice *root = pci_new(PCI_DEVFN(0, 0), TYPE_PNV_PHB_ROOT_PORT);
> +    g_autofree char *default_id = g_strdup_printf("%s[%d]",
> +                                                  TYPE_PNV_PHB_ROOT_PORT,
> +                                                  index);
> +    const char *dev_id = DEVICE(root)->id;
> +
> +    object_property_add_child(OBJECT(pci->bus), dev_id ? dev_id : default_id,
> +                              OBJECT(root));
> +
> +    /* Set unique chassis/slot values for the root port */
> +    qdev_prop_set_uint8(DEVICE(root), "chassis", chip_id);
> +    qdev_prop_set_uint16(DEVICE(root), "slot", index);
> +
> +    pci_realize_and_unref(root, pci->bus, &error_fatal);
> +}
>   
>   static void pnv_phb_realize(DeviceState *dev, Error **errp)
>   {
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 5b7cbfc699..d649ed6b1b 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -1192,31 +1192,6 @@ static void pnv_chip_icp_realize(Pnv8Chip *chip8, Error **errp)
>       }
>   }
>   
> -/*
> - * Attach a root port device.
> - *
> - * 'index' will be used both as a PCIE slot value and to calculate
> - * QOM id. 'chip_id' is going to be used as PCIE chassis for the
> - * root port.
> - */
> -void pnv_phb_attach_root_port(PCIHostState *pci, int index, int chip_id)
> -{
> -    PCIDevice *root = pci_new(PCI_DEVFN(0, 0), TYPE_PNV_PHB_ROOT_PORT);
> -    g_autofree char *default_id = g_strdup_printf("%s[%d]",
> -                                                  TYPE_PNV_PHB_ROOT_PORT,
> -                                                  index);
> -    const char *dev_id = DEVICE(root)->id;
> -
> -    object_property_add_child(OBJECT(pci->bus), dev_id ? dev_id : default_id,
> -                              OBJECT(root));
> -
> -    /* Set unique chassis/slot values for the root port */
> -    qdev_prop_set_uint8(DEVICE(root), "chassis", chip_id);
> -    qdev_prop_set_uint16(DEVICE(root), "slot", index);
> -
> -    pci_realize_and_unref(root, pci->bus, &error_fatal);
> -}
> -
>   static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
>   {
>       PnvChipClass *pcc = PNV_CHIP_GET_CLASS(dev);
> diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
> index fbad11d6a7..033d907287 100644
> --- a/include/hw/ppc/pnv.h
> +++ b/include/hw/ppc/pnv.h
> @@ -190,7 +190,6 @@ DECLARE_INSTANCE_CHECKER(PnvChip, PNV_CHIP_POWER10,
>                            TYPE_PNV_CHIP_POWER10)
>   
>   PowerPCCPU *pnv_chip_find_cpu(PnvChip *chip, uint32_t pir);
> -void pnv_phb_attach_root_port(PCIHostState *pci, int index, int chip_id);
>   
>   #define TYPE_PNV_MACHINE       MACHINE_TYPE_NAME("powernv")
>   typedef struct PnvMachineClass PnvMachineClass;


  reply	other threads:[~2022-07-27 18:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24  8:49 [PATCH v3 00/12] powernv: introduce pnv-phb base/proxy devices Daniel Henrique Barboza
2022-06-24  8:49 ` [PATCH v3 01/12] ppc/pnv: add PHB3 bus init helper Daniel Henrique Barboza
2022-06-24 13:44   ` Cédric Le Goater
2022-06-27 17:09     ` Daniel Henrique Barboza
2022-07-27 17:29   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 02/12] ppc/pnv: add PnvPHB base/proxy device Daniel Henrique Barboza
2022-07-27 17:29   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 03/12] ppc/pnv: turn PnvPHB3 into a PnvPHB backend Daniel Henrique Barboza
2022-07-27 17:31   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 04/12] ppc/pnv: add PHB4 bus init helper Daniel Henrique Barboza
2022-07-27 17:32   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 05/12] ppc/pnv: turn PnvPHB4 into a PnvPHB backend Daniel Henrique Barboza
2022-07-27 17:41   ` Frederic Barrat
2022-07-28 13:09     ` Daniel Henrique Barboza
2022-06-24  8:49 ` [PATCH v3 06/12] ppc/pnv: add pnv-phb-root-port device Daniel Henrique Barboza
2022-07-27 17:42   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 07/12] ppc/pnv: remove pnv-phb3-root-port Daniel Henrique Barboza
2022-07-27 17:43   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 08/12] ppc/pnv: remove pnv-phb4-root-port Daniel Henrique Barboza
2022-07-27 17:43   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 09/12] ppc/pnv: remove root port name from pnv_phb_attach_root_port() Daniel Henrique Barboza
2022-07-27 17:43   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 10/12] ppc/pnv: remove pecc->rp_model Daniel Henrique Barboza
2022-07-27 17:43   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 11/12] ppc/pnv: remove PnvPHB4.version Daniel Henrique Barboza
2022-07-27 17:44   ` Frederic Barrat
2022-06-24  8:49 ` [PATCH v3 12/12] ppc/pnv: move attach_root_port helper to pnv-phb.c Daniel Henrique Barboza
2022-07-27 17:44   ` Frederic Barrat [this message]
2022-07-27 17:28 ` [PATCH v3 00/12] powernv: introduce pnv-phb base/proxy devices Frederic Barrat
2022-07-28 13:12   ` Daniel Henrique Barboza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6263ea8b-fe2b-492e-087e-d15b33d91863@linux.ibm.com \
    --to=fbarrat@linux.ibm.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.