linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: [PATCH v2 3/3] powerpc/numa: Move POWER4 restriction to the helper
Date: Mon, 17 Aug 2020 16:02:38 +0530	[thread overview]
Message-ID: <20200817103238.158133-3-aneesh.kumar@linux.ibm.com> (raw)
In-Reply-To: <20200817103238.158133-1-aneesh.kumar@linux.ibm.com>

Even though the comment says POWER4 usage, I guess it applies to all
platforms since there is no PVR check there. This patch moves the check
to the helper.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index d29f60e15777..7319084345e1 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -250,7 +250,8 @@ int affinity_domain_to_nid(struct affinity_domain *domain)
 	if (!firmware_has_feature(FW_FEATURE_LPAR))
 		return domain_id;
 
-	if (domain_id ==  -1)
+	/* POWER4 LPAR uses 0xffff as invalid node */
+	if (domain_id ==  -1 || domain_id == 0xffff)
 		return NUMA_NO_NODE;
 
 	nid = __affinity_domain_to_nid(domain_id, last_nid);
@@ -283,10 +284,6 @@ static int associativity_to_nid(const __be32 *associativity)
 	if (of_read_number(associativity, 1) >= min_common_depth)
 		domain.id = of_read_number(&associativity[min_common_depth], 1);
 
-	/* POWER4 LPAR uses 0xffff as invalid node */
-	if (domain.id == 0xffff)
-		domain.id = -1;
-
 	nid = affinity_domain_to_nid(&domain);
 
 	if (nid > 0 &&
@@ -499,9 +496,6 @@ static int of_drconf_to_nid_single(struct drmem_lmb *lmb)
 		index = lmb->aa_index * aa.array_sz + min_common_depth - 1;
 		domain.id = of_read_number(&aa.arrays[index], 1);
 
-		if (domain.id == 0xffff)
-			domain.id = -1;
-
 		nid = affinity_domain_to_nid(&domain);
 
 		if (nid > 0) {
-- 
2.26.2


  parent reply	other threads:[~2020-08-17 10:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 10:32 [PATCH v2 1/3] powerpc/numa: Introduce logical numa id Aneesh Kumar K.V
2020-08-17 10:32 ` [PATCH v2 2/3] powerpc/powernv/cpufreq: Don't assume chip id is same as Linux node id Aneesh Kumar K.V
2020-08-17 10:32 ` Aneesh Kumar K.V [this message]
2020-08-17 10:59 ` [PATCH v2 1/3] powerpc/numa: Introduce logical numa id Srikar Dronamraju
2020-08-17 11:34   ` Aneesh Kumar K.V
2020-08-17 11:49     ` Srikar Dronamraju
2020-08-18  8:21       ` Aneesh Kumar K.V

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=20200817103238.158133-3-aneesh.kumar@linux.ibm.com \
    --to=aneesh.kumar@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nathanl@linux.ibm.com \
    --cc=srikar@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).