Commit 0f81ecbf authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: iSeries fixes, from Stephen Rothwell

From: Anton Blanchard <anton@samba.org>

iSeries fixes, from Stephen Rothwell
parent fdd860a1
......@@ -18,6 +18,7 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/config.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
#include <linux/sched.h>
......
......@@ -46,40 +46,35 @@ extern long poll_pending(void);
int (*idle_loop)(void);
#ifdef CONFIG_PPC_ISERIES
unsigned long maxYieldTime = 0;
unsigned long minYieldTime = 0xffffffffffffffffUL;
static void yield_shared_processor(void)
{
struct paca_struct *lpaca = get_paca();
unsigned long tb;
unsigned long yieldTime;
HvCall_setEnabledInterrupts(HvCall_MaskIPI |
HvCall_MaskLpEvent |
HvCall_MaskLpProd |
HvCall_MaskTimeout);
if (!ItLpQueue_isLpIntPending(paca->lpQueuePtr)) {
/*
* Compute future tb value when yield should expire.
* We want to be woken up when the next decrementer is
* to fire.
*/
tb = get_tb();
/* Compute future tb value when yield should expire */
HvCall_yieldProcessor(HvCall_YieldTimed, tb+tb_ticks_per_jiffy);
local_irq_disable();
lpaca->yielded = 1; /* Indicate a prod is desired */
lpaca->xLpPaca.xIdle = 1; /* Inform the HV we are idle */
yieldTime = get_tb() - tb;
if (yieldTime > maxYieldTime)
maxYieldTime = yieldTime;
HvCall_yieldProcessor(HvCall_YieldTimed,
lpaca->next_jiffy_update_tb);
lpaca->yielded = 0; /* Back to IPI's */
local_irq_enable();
if (yieldTime < minYieldTime)
minYieldTime = yieldTime;
/*
* The decrementer stops during the yield. Force a fake
* decrementer here and let the timer_interrupt code sort
* out the actual time.
*/
lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 1;
}
/*
* The decrementer stops during the yield. Force a fake decrementer
* here and let the timer_interrupt code sort out the actual time.
*/
get_paca()->xLpPaca.xIntDword.xFields.xDecrInt = 1;
process_iSeries_events();
}
......
......@@ -146,7 +146,9 @@ void __init disable_early_printk(void)
void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
{
#ifdef CONFIG_PPC_PSERIES
unsigned int ret, i;
#endif
#ifdef CONFIG_XMON_DEFAULT
debugger = xmon;
......
......@@ -126,6 +126,9 @@ static int smp_iSeries_numProcs(void)
for (i=0; i < NR_CPUS; ++i) {
lpPaca = paca[i].xLpPacaPtr;
if ( lpPaca->xDynProcStatus < 2 ) {
cpu_set(i, cpu_available_map);
cpu_set(i, cpu_possible_map);
cpu_set(i, cpu_present_at_boot);
++np;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment