qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Miles Glenn <milesg@linux.vnet.ibm.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org, npiggin@gmail.com, fbarrat@linux.ibm.com
Subject: Re: [PATCH v2 RESEND] ppc/pnv: Fix number of I2C engines and ports for power9/10
Date: Thu, 02 Nov 2023 11:56:42 -0500	[thread overview]
Message-ID: <6c3fe8555bab6c6268a3638d08990825affdb03d.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <7f6df257-21d2-531a-3bdd-684336200698@linaro.org>

On Fri, 2023-10-27 at 07:05 +0200, Philippe Mathieu-Daudé wrote:
> On 25/10/23 08:56, Cédric Le Goater wrote:
> > On 10/24/23 23:29, Glenn Miles wrote:
> > > Power9 is supposed to have 4 PIB-connected I2C engines with the
> > > following number of ports on each engine:
> > > 
> > >      0: 2
> > >      1: 13
> > >      2: 2
> > >      3: 2
> > > 
> > > Power10 also has 4 engines but has the following number of ports
> > > on each engine:
> > > 
> > >      0: 14
> > >      1: 14
> > >      2: 2
> > >      3: 16
> > > 
> > > Current code assumes that they all have the same (maximum)
> > > number.
> > > This can be a problem if software expects to see a certain number
> > > of ports present (Power Hypervisor seems to care).
> > > 
> > > Fixed this by adding separate tables for power9 and power10 that
> > > map the I2C controller number to the number of I2C buses that
> > > should
> > > be attached for that engine.
> > > 
> > > Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
> > 
> > you could have kept :
> > 
> > Reviewed-by: Cédric Le Goater <clg@kaod.org>
> > 
> > one comment below,
> > 
> > > ---
> > > Based-on: <20231017221434.810363-1-milesg@linux.vnet.ibm.com>
> > > ([PATCH] ppc/pnv: Connect PNV I2C controller to powernv10)
> > > 
> > > Changes from v1:
> > >      - Added i2c_ports_per_engine to PnvChipClass
> > >      - replaced the word "ctlr" with "engine"
> > > 
> > >   hw/ppc/pnv.c              | 14 ++++++++++----
> > >   include/hw/ppc/pnv_chip.h |  6 ++----
> > >   2 files changed, 12 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> > > index 2655b6e506..f6dc84b869 100644
> > > --- a/hw/ppc/pnv.c
> > > +++ b/hw/ppc/pnv.c
> > > @@ -1507,6 +1507,8 @@ static void
> > > pnv_chip_power9_pec_realize(PnvChip 
> > > *chip, Error **errp)
> > >       }
> > >   }
> > > +static int pnv_power9_i2c_ports_per_engine[PNV9_CHIP_MAX_I2C] =
> > > {2, 
> > > 13, 2, 2};
> > > +
> > 
> > Generally, these class constants are located close to the class
> > definitions
> > in the file.
> 
> Either keep them close by for comparison, or, since there
> is a single use, declare it in the function using it here 
> pnv_chip_power9_class_init().

Yeah, I agree.  Version 3 of this patch places the arrays inside the
functions that use them.

Thanks,

Glenn
> 
> > Thanks,
> > 
> > C.



      reply	other threads:[~2023-11-02 16:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 21:29 [PATCH v2 RESEND] ppc/pnv: Fix number of I2C engines and ports for power9/10 Glenn Miles
2023-10-25  6:56 ` Cédric Le Goater
2023-10-27  5:05   ` Philippe Mathieu-Daudé
2023-11-02 16:56     ` Miles Glenn [this message]

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=6c3fe8555bab6c6268a3638d08990825affdb03d.camel@linux.vnet.ibm.com \
    --to=milesg@linux.vnet.ibm.com \
    --cc=clg@kaod.org \
    --cc=fbarrat@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=philmd@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).