Skip to content

Commit

Permalink
[POWERPC] Split xics_teardown_cpu()
Browse files Browse the repository at this point in the history
This splits off the kexec path bits of the xics_teardown_cpu() routine
into its own xics_kexec_teardown_cpu() routine.  With the previous
combined routine the CPPR for a cpu that is being removed may have its
CPPR reset in the plpar_eoi() call (which explicitly sets the CPPR to
a non-zero value).  Splitting of the kexec bits of the code prevents
this from happening in the cpu remove path.

Once again, this does not cause the cpu remove from the kernel to
fail, but it does cause cpu dlpar operations to not be able to return
the cpu to the hypervisor.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Nathan Fontenot authored and Paul Mackerras committed Feb 7, 2008
1 parent a52572d commit c3e8506
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/hotplug-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void pseries_mach_cpu_die(void)
{
local_irq_disable();
idle_task_exit();
xics_teardown_cpu(0);
xics_teardown_cpu();
unregister_slb_shadow(hard_smp_processor_id(), __pa(get_slb_shadow()));
rtas_stop_self();
/* Should never get here... */
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void __init setup_kexec_cpu_down_mpic(void)
static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
{
pseries_kexec_cpu_down(crash_shutdown, secondary);
xics_teardown_cpu(secondary);
xics_kexec_teardown_cpu(secondary);
}

void __init setup_kexec_cpu_down_xics(void)
Expand Down
14 changes: 10 additions & 4 deletions arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,9 @@ void xics_request_IPIs(void)
}
#endif /* CONFIG_SMP */

void xics_teardown_cpu(int secondary)
void xics_teardown_cpu()
{
int cpu = smp_processor_id();
unsigned int ipi;
struct irq_desc *desc;

xics_set_cpu_priority(0);

Expand All @@ -790,9 +788,17 @@ void xics_teardown_cpu(int secondary)
lpar_qirr_info(cpu, 0xff);
else
direct_qirr_info(cpu, 0xff);
}

void xics_kexec_teardown_cpu(int secondary)
{
unsigned int ipi;
struct irq_desc *desc;

xics_teardown_cpu();

/*
* we need to EOI the IPI if we got here from kexec down IPI
* we need to EOI the IPI
*
* probably need to check all the other interrupts too
* should we be flagging idle loop instead?
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/pseries/xics.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

extern void xics_init_IRQ(void);
extern void xics_setup_cpu(void);
extern void xics_teardown_cpu(int secondary);
extern void xics_teardown_cpu(void);
extern void xics_kexec_teardown_cpu(int secondary);
extern void xics_cause_IPI(int cpu);
extern void xics_request_IPIs(void);
extern void xics_migrate_irqs_away(void);
Expand Down

0 comments on commit c3e8506

Please sign in to comment.