mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yuan ZhaoXiong <yuanzhx326@gmail.com>
To: tglx@linutronix.de, steven.price@arm.com, Jason@zx2c4.com,
	juri.lelli@redhat.com, tony.luck@intel.com, frederic@kernel.org,
	yuanzhx326@gmail.com, sathyanarayanan.kuppuswamy@linux.intel.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] cpu: printk error information when call cpu_up() failed.
Date: Mon, 28 Nov 2022 21:28:03 +0800	[thread overview]
Message-ID: <20221128132803.17599-1-yuanzhx326@gmail.com> (raw)

It is better to printk error information out when calling cpu_up() failed.
Users will observe cpu up error conveniently via the kernel log.

Signed-off-by: Yuan ZhaoXiong <yuanzhx326@gmail.com>
---
 kernel/cpu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index bbad5e375d3b..28b0202e7744 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1481,12 +1481,16 @@ int bringup_hibernate_cpu(unsigned int sleep_cpu)
 void bringup_nonboot_cpus(unsigned int setup_max_cpus)
 {
 	unsigned int cpu;
+	int error;
 
 	for_each_present_cpu(cpu) {
 		if (num_online_cpus() >= setup_max_cpus)
 			break;
-		if (!cpu_online(cpu))
-			cpu_up(cpu, CPUHP_ONLINE);
+		if (!cpu_online(cpu)) {
+			error = cpu_up(cpu, CPUHP_ONLINE);
+			if (error)
+				pr_err("Error taking CPU%d up: %d\n", cpu, error);
+		}
 	}
 }
 
-- 
2.27.0


             reply	other threads:[~2022-11-28 13:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 13:28 Yuan ZhaoXiong [this message]
2022-12-01 11:40 ` Thomas Gleixner

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=20221128132803.17599-1-yuanzhx326@gmail.com \
    --to=yuanzhx326@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=frederic@kernel.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=steven.price@arm.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.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

all inboxes | Powered by JetHome®