From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: Use nid as fallback for chip_id
Date: Wed, 31 Jul 2019 17:39:34 +0530 [thread overview]
Message-ID: <20190731120934.GB11365@linux.vnet.ibm.com> (raw)
In-Reply-To: <87lfwhypv0.fsf@concordia.ellerman.id.au>
* Michael Ellerman <mpe@ellerman.id.au> [2019-07-29 22:41:55]:
> >
> > + chip_id = of_get_ibm_chip_id(np);
> > + if (chip_id == -1)
> > + chip_id = of_node_to_nid(np);
> > +
> > of_node_put(np);
> > - return of_get_ibm_chip_id(np);
> > + return chip_id;
> > }
>
> A nid is not a chip-id.
>
Agree that nid is not a chip-id.
> This obviously happens to work for the case you've identified above but
> it's not something I'm happy to merge in general.
>
Okay.
> We could do a similar change in the topology code, but I'd probably like
> it to be restricted to when we're running under PowerVM and there are no
> chip-ids found at all.
>
So for PowerNV case and KVM guest, of_get_ibm_chip_id() always seems to
returns a valid chip-id. Its *only* in the PowerVM case that we are
returning nid as the fallback chip-id.
Do you think checking for OPAL firmware would help?
chip_id = of_get_ibm_chip_id(np);
if (chip_id == -1 && !firmware_has_feature(FW_FEATURE_OPAL))
chip_id = of_node_to_nid(np);
of_node_put(np);
or should we do
int topology_physical_package_id(int cpu)
{
int chip_id = cpu_to_chip_id(cpu)
if (chip_id == -1 && !firmware_has_feature(FW_FEATURE_OPAL))
//Fallback to nid instead of chip-id.
....
return chip_id;
}
> I'm also not clear how it will interact with migration.
>
On migration, this function would be triggered when the cpumasks are getting
updated. So I would expect this to continue working.
Or Am I missing someother migration related quirk?
> cheers
>
The other alternative that I see is
--
Thanks and Regards
Srikar Dronamraju
prev parent reply other threads:[~2019-07-31 13:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 10:19 [PATCH] powerpc: Use nid as fallback for chip_id Srikar Dronamraju
2019-07-29 12:41 ` Michael Ellerman
2019-07-31 12:09 ` Srikar Dronamraju [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=20190731120934.GB11365@linux.vnet.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=hegdevasant@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=svaidy@linux.vnet.ibm.com \
/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).