Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157478
b: refs/heads/master
c: 5c0b912
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Sep 11, 2009
1 parent 6ac278c commit 3661434
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 47 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e86a6ed63f46fe8fb555fda531084bca3ef62fd7
refs/heads/master: 5c0b912e755caaad555eb6feefdb1124462d8f37
32 changes: 1 addition & 31 deletions trunk/arch/s390/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,7 @@ extern void machine_power_off_smp(void);
#define PROC_CHANGE_PENALTY 20 /* Schedule penalty */

#define raw_smp_processor_id() (S390_lowcore.cpu_nr)

/*
* 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)
#define cpu_logical_map(cpu) (cpu)

extern int __cpu_disable (void);
extern void __cpu_die (unsigned int cpu);
Expand All @@ -91,11 +66,6 @@ extern void arch_send_call_function_ipi(cpumask_t mask);

#endif

#ifndef CONFIG_SMP
#define hard_smp_processor_id() 0
#define smp_cpu_not_running(cpu) 1
#endif

#ifdef CONFIG_HOTPLUG_CPU
extern int smp_rescan_cpus(void);
#else
Expand Down
34 changes: 19 additions & 15 deletions trunk/arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);

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)
{
int cpu, rc;
Expand All @@ -87,7 +104,7 @@ void smp_send_stop(void)
rc = signal_processor(cpu, sigp_stop);
} while (rc == sigp_busy);

while (!smp_cpu_not_running(cpu))
while (!cpu_stopped(cpu))
cpu_relax();
}
}
Expand Down Expand Up @@ -270,19 +287,6 @@ static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { }

#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)
{
int cpu;
Expand Down Expand Up @@ -636,7 +640,7 @@ int __cpu_disable(void)
void __cpu_die(unsigned int cpu)
{
/* Wait until target cpu is down */
while (!smp_cpu_not_running(cpu))
while (!cpu_stopped(cpu))
cpu_relax();
smp_free_lowcore(cpu);
pr_info("Processor %d stopped\n", cpu);
Expand Down

0 comments on commit 3661434

Please sign in to comment.