summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2020-03-16 12:39:55 +0100
committerVasily Gorbik <gor@linux.ibm.com>2020-03-23 13:41:54 +0100
commit872f27103874a73783aeff2aac2b41a489f67d7c (patch)
tree13193af9f6905949ed3ccd6051b0122179e86ebb /arch/s390
parents390/cpuinfo: show number of online CPUs within a package (diff)
downloadlinux-872f27103874a73783aeff2aac2b41a489f67d7c.tar.xz
linux-872f27103874a73783aeff2aac2b41a489f67d7c.zip
s390/cpuinfo: fix wrong output when CPU0 is offline
/proc/cpuinfo should not print information about CPU 0 when it is offline. Fixes: 281eaa8cb67c ("s390/cpuinfo: simplify locking and skip offline cpus early") Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> [heiko.carstens@de.ibm.com: shortened commit message] Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/processor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c
index 39bf777e140e..f36acc8d2631 100644
--- a/arch/s390/kernel/processor.c
+++ b/arch/s390/kernel/processor.c
@@ -188,8 +188,9 @@ static void show_cpu_mhz(struct seq_file *m, unsigned long n)
static int show_cpuinfo(struct seq_file *m, void *v)
{
unsigned long n = (unsigned long) v - 1;
+ unsigned long first = cpumask_first(cpu_online_mask);
- if (!n)
+ if (n == first)
show_cpu_summary(m, v);
if (!machine_has_cpu_mhz)
return 0;
@@ -204,6 +205,8 @@ static inline void *c_update(loff_t *pos)
{
if (*pos)
*pos = cpumask_next(*pos - 1, cpu_online_mask);
+ else
+ *pos = cpumask_first(cpu_online_mask);
return *pos < nr_cpu_ids ? (void *)*pos + 1 : NULL;
}