linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stewart Smith <stewart@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Stewart Smith <stewart@linux.vnet.ibm.com>
Subject: [PATCH 4/4] powerpc/powernv: remove logic for pre-OPALv3 firmware
Date: Fri, 27 Nov 2015 15:45:26 +1100	[thread overview]
Message-ID: <1448599526-31073-5-git-send-email-stewart@linux.vnet.ibm.com> (raw)
In-Reply-To: <1448599526-31073-1-git-send-email-stewart@linux.vnet.ibm.com>

There was already a check for OPALv3, so we just remove the if/else
check and go for it.

OPAL pre-v3 no longer exists. Anywhere.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/smp.c | 68 +++++++++++++++---------------------
 1 file changed, 29 insertions(+), 39 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 9b968a315103..e04d2d4da948 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -61,6 +61,7 @@ static int pnv_smp_kick_cpu(int nr)
 	unsigned long start_here =
 			__pa(ppc_function_entry(generic_secondary_smp_init));
 	long rc;
+	uint8_t status;
 
 	BUG_ON(nr < 0 || nr >= NR_CPUS);
 
@@ -77,53 +78,42 @@ static int pnv_smp_kick_cpu(int nr)
 	 * first time. OPAL v3 allows us to query OPAL to know if it
 	 * has the CPUs, so we do that
 	 */
-	if (firmware_has_feature(FW_FEATURE_OPALv3)) {
-		uint8_t status;
+	rc = opal_query_cpu_status(pcpu, &status);
+	if (rc != OPAL_SUCCESS) {
+		pr_warn("OPAL Error %ld querying CPU %d state\n",
+			rc, nr);
+		return -ENODEV;
+	}
+
+	/*
+	 * Already started, just kick it, probably coming from
+	 * kexec and spinning
+	 */
+	if (status == OPAL_THREAD_STARTED)
+		goto kick;
 
-		rc = opal_query_cpu_status(pcpu, &status);
+	/*
+	 * Available/inactive, let's kick it
+	 */
+	if (status == OPAL_THREAD_INACTIVE) {
+		pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n",
+			 nr, pcpu);
+		rc = opal_start_cpu(pcpu, start_here);
 		if (rc != OPAL_SUCCESS) {
-			pr_warn("OPAL Error %ld querying CPU %d state\n",
+			pr_warn("OPAL Error %ld starting CPU %d\n",
 				rc, nr);
 			return -ENODEV;
 		}
-
-		/*
-		 * Already started, just kick it, probably coming from
-		 * kexec and spinning
-		 */
-		if (status == OPAL_THREAD_STARTED)
-			goto kick;
-
-		/*
-		 * Available/inactive, let's kick it
-		 */
-		if (status == OPAL_THREAD_INACTIVE) {
-			pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n",
-				 nr, pcpu);
-			rc = opal_start_cpu(pcpu, start_here);
-			if (rc != OPAL_SUCCESS) {
-				pr_warn("OPAL Error %ld starting CPU %d\n",
-					rc, nr);
-				return -ENODEV;
-			}
-		} else {
-			/*
-			 * An unavailable CPU (or any other unknown status)
-			 * shouldn't be started. It should also
-			 * not be in the possible map but currently it can
-			 * happen
-			 */
-			pr_devel("OPAL: CPU %d (HW 0x%x) is unavailable"
-				 " (status %d)...\n", nr, pcpu, status);
-			return -ENODEV;
-		}
 	} else {
 		/*
-		 * On OPAL v2, we just kick it and hope for the best,
-		 * we must not test the error from opal_start_cpu() or
-		 * we would fail to get CPUs from kexec.
+		 * An unavailable CPU (or any other unknown status)
+		 * shouldn't be started. It should also
+		 * not be in the possible map but currently it can
+		 * happen
 		 */
-		opal_start_cpu(pcpu, start_here);
+		pr_devel("OPAL: CPU %d (HW 0x%x) is unavailable"
+			 " (status %d)...\n", nr, pcpu, status);
+		return -ENODEV;
 	}
  kick:
 	return smp_generic_kick_cpu(nr);
-- 
2.1.4

  parent reply	other threads:[~2015-11-27  4:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27  4:45 [PATCH 0/4] Remove OPAL pre-v3 support Stewart Smith
2015-11-27  4:45 ` [PATCH 1/4] powerpc/powernv: panic() on OPAL < V3 Stewart Smith
2015-11-27  5:36   ` Andrew Donnellan
2015-11-27  5:43     ` Stewart Smith
2015-11-27  5:56       ` Andrew Donnellan
2015-11-30  0:20     ` Andrew Donnellan
2015-11-27  7:13   ` kbuild test robot
2015-11-27  4:45 ` [PATCH 2/4] powerpc/powernv: Remove OPALv2 firmware define and references Stewart Smith
2015-11-27  5:31   ` Andrew Donnellan
2015-11-27  4:45 ` [PATCH 3/4] powerpc/powernv: remove FW_FEATURE_OPAL and just use FW_FEATURE_OPALv3 Stewart Smith
2015-11-27  5:45   ` Andrew Donnellan
2015-12-01  3:56   ` Michael Ellerman
2015-12-03  6:06     ` Stewart Smith
2015-12-03  8:55       ` Michael Ellerman
2015-11-27  4:45 ` Stewart Smith [this message]
2015-11-27  5:55   ` [PATCH 4/4] powerpc/powernv: remove logic for pre-OPALv3 firmware Andrew Donnellan
2015-12-09  6:18 ` [PATCH v2 0/3] Remove OPAL pre-v3 support Stewart Smith
2015-12-09  6:18 ` [PATCH v2 1/3] powerpc/powernv: panic() on OPAL < V3 Stewart Smith
2015-12-17 11:57   ` [v2,1/3] " Michael Ellerman
2015-12-09  6:18 ` [PATCH v2 2/3] powerpc/powernv: Remove OPALv2 firmware define and references Stewart Smith
2015-12-09  6:18 ` [PATCH v2 3/3] powerpc/powernv: remove FW_FEATURE_OPALv3 and just use FW_FEATURE_OPAL Stewart Smith

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=1448599526-31073-5-git-send-email-stewart@linux.vnet.ibm.com \
    --to=stewart@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.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).