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