All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb@linux.ibm.com>
To: "Cédric Le Goater" <clg@kaod.org>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, fbarrat@linux.ibm.com,
	mark.cave-ayland@ilande.co.uk
Subject: Re: [PATCH 01/11] ppc/pnv: move root port attach to pnv_phb4_realize()
Date: Tue, 14 Jun 2022 11:10:05 -0300	[thread overview]
Message-ID: <104be42f-25e3-20b5-60f1-3db943ec65f8@linux.ibm.com> (raw)
In-Reply-To: <eb6b85a6-d70a-aa1c-cde1-ffc5f86b2218@kaod.org>



On 6/14/22 09:02, Cédric Le Goater wrote:
> On 6/13/22 17:44, Daniel Henrique Barboza wrote:
>> Creating a root port is something related to the PHB, not the PEC. It
>> also makes the logic more in line with what pnv-phb3 does.
>>
>> Signed-off-by: Daniel Henrique Barboza <danielhb@linux.ibm.com>
> 
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> 
> So the root port is back where it was.
> 
> Could we avoid the pci_new() and use object_initialize_child() instead ?


We could but then we would need to deal with yet another difference with
default versus user created devices, given that for user devices we can't
initialize_child(). And since we're also unifying the root ports later on
I'd rather wait to see how it turns out when everything is finished.


Tanks,

Daniel

> 
> Thanks,
> 
> C.
> 
> 
>> ---
>>   hw/pci-host/pnv_phb4.c     | 4 ++++
>>   hw/pci-host/pnv_phb4_pec.c | 3 ---
>>   2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
>> index 6594016121..23ad8de7ee 100644
>> --- a/hw/pci-host/pnv_phb4.c
>> +++ b/hw/pci-host/pnv_phb4.c
>> @@ -1547,6 +1547,7 @@ static void pnv_phb4_instance_init(Object *obj)
>>   static void pnv_phb4_realize(DeviceState *dev, Error **errp)
>>   {
>>       PnvPHB4 *phb = PNV_PHB4(dev);
>> +    PnvPhb4PecClass *pecc = PNV_PHB4_PEC_GET_CLASS(phb->pec);
>>       PCIHostState *pci = PCI_HOST_BRIDGE(dev);
>>       XiveSource *xsrc = &phb->xsrc;
>>       int nr_irqs;
>> @@ -1583,6 +1584,9 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
>>       pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb);
>>       pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;
>> +    /* Add a single Root port if running with defaults */
>> +    pnv_phb_attach_root_port(pci, pecc->rp_model);
>> +
>>       /* Setup XIVE Source */
>>       if (phb->big_phb) {
>>           nr_irqs = PNV_PHB4_MAX_INTs;
>> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
>> index 8b7e823fa5..c9aaf1c28e 100644
>> --- a/hw/pci-host/pnv_phb4_pec.c
>> +++ b/hw/pci-host/pnv_phb4_pec.c
>> @@ -130,9 +130,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
>>       if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) {
>>           return;
>>       }
>> -
>> -    /* Add a single Root port if running with defaults */
>> -    pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), pecc->rp_model);
>>   }
>>   static void pnv_pec_realize(DeviceState *dev, Error **errp)
> 


  reply	other threads:[~2022-06-14 14:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13 15:44 [PATCH 00/11] pnv-phb related cleanups Daniel Henrique Barboza
2022-06-13 15:44 ` [PATCH 01/11] ppc/pnv: move root port attach to pnv_phb4_realize() Daniel Henrique Barboza
2022-06-14  9:08   ` Frederic Barrat
2022-06-14 12:02   ` Cédric Le Goater
2022-06-14 14:10     ` Daniel Henrique Barboza [this message]
2022-06-13 15:44 ` [PATCH 02/11] ppc/pnv: attach phb3/phb4 root ports in QOM tree Daniel Henrique Barboza
2022-06-14  9:09   ` Frederic Barrat
2022-06-14  9:53     ` Cédric Le Goater
2022-06-14 12:03   ` Cédric Le Goater
2022-06-13 15:44 ` [PATCH 03/11] ppc/pnv: use dev->parent_bus->parent to get the PHB Daniel Henrique Barboza
2022-06-14  9:10   ` Frederic Barrat
2022-06-17 20:02     ` Daniel Henrique Barboza
2022-06-14 12:10   ` Cédric Le Goater
2022-06-17 21:15     ` Daniel Henrique Barboza
2022-06-13 15:44 ` [PATCH 04/11] ppc/pnv: use dev instead of pci->qdev in root_port_realize() Daniel Henrique Barboza
2022-06-14  9:10   ` Frederic Barrat
2022-06-13 15:44 ` [PATCH 05/11] ppc/pnv: make pnv_ics_get() use the chip8->phbs[] array Daniel Henrique Barboza
2022-06-14  9:13   ` Frederic Barrat
2022-06-14  9:52   ` Cédric Le Goater
2022-06-13 15:44 ` [PATCH 06/11] ppc/pnv: make pnv_ics_resend() use chip8->phbs[] Daniel Henrique Barboza
2022-06-14  9:24   ` Frederic Barrat
2022-06-14  9:54     ` Cédric Le Goater
2022-06-14 15:11     ` Daniel Henrique Barboza
2022-06-13 15:44 ` [PATCH 07/11] ppc/pnv: make pnv_chip_power8_pic_print_info() " Daniel Henrique Barboza
2022-06-14  9:36   ` Frederic Barrat
2022-06-13 15:44 ` [PATCH 08/11] ppc/pnv: turn chip8->phbs[] into a PnvPHB3* array Daniel Henrique Barboza
2022-06-14  9:53   ` Frederic Barrat
2022-06-14 15:39     ` Daniel Henrique Barboza
2022-06-14 15:52       ` Frederic Barrat
2022-06-14 16:11       ` Cédric Le Goater
2022-06-13 15:44 ` [PATCH 09/11] ppc/pnv: add PHB object/bus parenting helpers Daniel Henrique Barboza
2022-06-13 15:44 ` [PATCH 10/11] ppc/pnv: move PHB3 initialization to realize time Daniel Henrique Barboza
2022-06-14 10:14   ` Frederic Barrat
2022-06-13 15:44 ` [PATCH 11/11] ppc/pnv: move PHB4 parent fixup to phb4_realize() 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=104be42f-25e3-20b5-60f1-3db943ec65f8@linux.ibm.com \
    --to=danielhb@linux.ibm.com \
    --cc=clg@kaod.org \
    --cc=fbarrat@linux.ibm.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --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.