[S390] Remove smp_cpu_not_running.
smp_cpu_not_running() and cpu_stopped() are doing the same. Remove one and also get rid of the last hard_smp_processor_id() leftover. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>hifive-unleashed-5.1
parent
e86a6ed63f
commit
5c0b912e75
|
@ -51,32 +51,7 @@ extern void machine_power_off_smp(void);
|
||||||
#define PROC_CHANGE_PENALTY 20 /* Schedule penalty */
|
#define PROC_CHANGE_PENALTY 20 /* Schedule penalty */
|
||||||
|
|
||||||
#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
|
#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
|
||||||
|
#define cpu_logical_map(cpu) (cpu)
|
||||||
/*
|
|
||||||
* returns 1 if cpu is in stopped/check stopped state or not operational
|
|
||||||
* returns 0 otherwise
|
|
||||||
*/
|
|
||||||
static inline int
|
|
||||||
smp_cpu_not_running(int cpu)
|
|
||||||
{
|
|
||||||
__u32 status;
|
|
||||||
|
|
||||||
switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) {
|
|
||||||
case sigp_order_code_accepted:
|
|
||||||
case sigp_status_stored:
|
|
||||||
/* Check for stopped and check stop state */
|
|
||||||
if (status & 0x50)
|
|
||||||
return 1;
|
|
||||||
break;
|
|
||||||
case sigp_not_operational:
|
|
||||||
return 1;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define cpu_logical_map(cpu) (cpu)
|
|
||||||
|
|
||||||
extern int __cpu_disable (void);
|
extern int __cpu_disable (void);
|
||||||
extern void __cpu_die (unsigned int cpu);
|
extern void __cpu_die (unsigned int cpu);
|
||||||
|
@ -91,11 +66,6 @@ extern void arch_send_call_function_ipi(cpumask_t mask);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_SMP
|
|
||||||
#define hard_smp_processor_id() 0
|
|
||||||
#define smp_cpu_not_running(cpu) 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
extern int smp_rescan_cpus(void);
|
extern int smp_rescan_cpus(void);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -71,6 +71,23 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
|
||||||
|
|
||||||
static void smp_ext_bitcall(int, ec_bit_sig);
|
static void smp_ext_bitcall(int, ec_bit_sig);
|
||||||
|
|
||||||
|
static int cpu_stopped(int cpu)
|
||||||
|
{
|
||||||
|
__u32 status;
|
||||||
|
|
||||||
|
switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) {
|
||||||
|
case sigp_order_code_accepted:
|
||||||
|
case sigp_status_stored:
|
||||||
|
/* Check for stopped and check stop state */
|
||||||
|
if (status & 0x50)
|
||||||
|
return 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void smp_send_stop(void)
|
void smp_send_stop(void)
|
||||||
{
|
{
|
||||||
int cpu, rc;
|
int cpu, rc;
|
||||||
|
@ -87,7 +104,7 @@ void smp_send_stop(void)
|
||||||
rc = signal_processor(cpu, sigp_stop);
|
rc = signal_processor(cpu, sigp_stop);
|
||||||
} while (rc == sigp_busy);
|
} while (rc == sigp_busy);
|
||||||
|
|
||||||
while (!smp_cpu_not_running(cpu))
|
while (!cpu_stopped(cpu))
|
||||||
cpu_relax();
|
cpu_relax();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,19 +287,6 @@ static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { }
|
||||||
|
|
||||||
#endif /* CONFIG_ZFCPDUMP */
|
#endif /* CONFIG_ZFCPDUMP */
|
||||||
|
|
||||||
static int cpu_stopped(int cpu)
|
|
||||||
{
|
|
||||||
__u32 status;
|
|
||||||
|
|
||||||
/* Check for stopped state */
|
|
||||||
if (signal_processor_ps(&status, 0, cpu, sigp_sense) ==
|
|
||||||
sigp_status_stored) {
|
|
||||||
if (status & 0x40)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cpu_known(int cpu_id)
|
static int cpu_known(int cpu_id)
|
||||||
{
|
{
|
||||||
int cpu;
|
int cpu;
|
||||||
|
@ -636,7 +640,7 @@ int __cpu_disable(void)
|
||||||
void __cpu_die(unsigned int cpu)
|
void __cpu_die(unsigned int cpu)
|
||||||
{
|
{
|
||||||
/* Wait until target cpu is down */
|
/* Wait until target cpu is down */
|
||||||
while (!smp_cpu_not_running(cpu))
|
while (!cpu_stopped(cpu))
|
||||||
cpu_relax();
|
cpu_relax();
|
||||||
smp_free_lowcore(cpu);
|
smp_free_lowcore(cpu);
|
||||||
pr_info("Processor %d stopped\n", cpu);
|
pr_info("Processor %d stopped\n", cpu);
|
||||||
|
|
Loading…
Reference in New Issue