Skip to content

Commit 59f60af

Browse files
hcahcagregkh
authored andcommitted
s390/sclp: Initialize sclp subsystem via arch_cpu_finalize_init()
[ Upstream commit 3bcc8a1 ] With the switch to GENERIC_CPU_DEVICES an early call to the sclp subsystem was added to smp_prepare_cpus(). This will usually succeed since the sclp subsystem is implicitly initialized early enough if an sclp based console is present. If no such console is present the initialization happens with an arch_initcall(); in such cases calls to the sclp subsystem will fail. For CPU detection this means that the fallback sigp loop will be used permanently to detect CPUs instead of the preferred READ_CPU_INFO sclp request. Fix this by adding an explicit early sclp_init() call via arch_cpu_finalize_init(). Reported-by: Sheshu Ramanandan <[email protected]> Fixes: 4a39f12 ("s390/smp: Switch to GENERIC_CPU_DEVICES") Reviewed-by: Peter Oberparleiter <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent b92942e commit 59f60af

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

arch/s390/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ config S390
6565
select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM
6666
select ARCH_ENABLE_MEMORY_HOTREMOVE
6767
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
68+
select ARCH_HAS_CPU_FINALIZE_INIT
6869
select ARCH_HAS_CURRENT_STACK_POINTER
6970
select ARCH_HAS_DEBUG_VIRTUAL
7071
select ARCH_HAS_DEBUG_VM_PGTABLE

arch/s390/include/asm/sclp.h

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ void sclp_early_printk(const char *s);
137137
void __sclp_early_printk(const char *s, unsigned int len);
138138
void sclp_emergency_printk(const char *s);
139139

140+
int sclp_init(void);
140141
int sclp_early_get_memsize(unsigned long *mem);
141142
int sclp_early_get_hsa_size(unsigned long *hsa_size);
142143
int _sclp_get_core_info(struct sclp_core_info *info);

arch/s390/kernel/setup.c

+5
Original file line numberDiff line numberDiff line change
@@ -1006,3 +1006,8 @@ void __init setup_arch(char **cmdline_p)
10061006
/* Add system specific data to the random pool */
10071007
setup_randomness();
10081008
}
1009+
1010+
void __init arch_cpu_finalize_init(void)
1011+
{
1012+
sclp_init();
1013+
}

drivers/s390/char/sclp.c

+2-10
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ static void sclp_request_timeout(bool force_restart);
245245
static void sclp_process_queue(void);
246246
static void __sclp_make_read_req(void);
247247
static int sclp_init_mask(int calculate);
248-
static int sclp_init(void);
249248

250249
static void
251250
__sclp_queue_read_req(void)
@@ -1251,8 +1250,7 @@ static struct platform_driver sclp_pdrv = {
12511250

12521251
/* Initialize SCLP driver. Return zero if driver is operational, non-zero
12531252
* otherwise. */
1254-
static int
1255-
sclp_init(void)
1253+
int sclp_init(void)
12561254
{
12571255
unsigned long flags;
12581256
int rc = 0;
@@ -1305,13 +1303,7 @@ sclp_init(void)
13051303

13061304
static __init int sclp_initcall(void)
13071305
{
1308-
int rc;
1309-
1310-
rc = platform_driver_register(&sclp_pdrv);
1311-
if (rc)
1312-
return rc;
1313-
1314-
return sclp_init();
1306+
return platform_driver_register(&sclp_pdrv);
13151307
}
13161308

13171309
arch_initcall(sclp_initcall);

0 commit comments

Comments
 (0)