Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dc2f0c7 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds
Browse files

[PATCH] ppc64: cleanup iseries runlight support



The iseries has a bar graph on the front panel that shows how busy it is.
The operating system sets and clears a bit in the CTRL register to control
it.

Instead of going to the complexity of using a thread info bit, just set and
clear it in the idle loop.

Also create two helper functions, ppc64_runlatch_on and ppc64_runlatch_off.

Finally don't use the short form of the SPR defines.

Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Acked-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 79f12489
Loading
Loading
Loading
Loading
+0 −9
Original line number Original line Diff line number Diff line
@@ -436,15 +436,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
	REST_8GPRS(14, r1)
	REST_8GPRS(14, r1)
	REST_10GPRS(22, r1)
	REST_10GPRS(22, r1)


#ifdef CONFIG_PPC_ISERIES
	clrrdi	r7,r1,THREAD_SHIFT	/* get current_thread_info() */
	ld	r7,TI_FLAGS(r7)		/* Get run light flag */
	mfspr	r9,CTRLF
	srdi	r7,r7,TIF_RUN_LIGHT
	insrdi	r9,r7,1,63		/* Insert run light into CTRL */
	mtspr	CTRLT,r9
#endif

	/* convert old thread to its task_struct for return value */
	/* convert old thread to its task_struct for return value */
	addi	r3,r3,-THREAD
	addi	r3,r3,-THREAD
	ld	r7,_NIP(r1)	/* Return to _switch caller in new task */
	ld	r7,_NIP(r1)	/* Return to _switch caller in new task */
+5 −5
Original line number Original line Diff line number Diff line
@@ -626,10 +626,10 @@ system_reset_iSeries:
	lhz	r24,PACAPACAINDEX(r13)	/* Get processor # */
	lhz	r24,PACAPACAINDEX(r13)	/* Get processor # */
	cmpwi	0,r24,0			/* Are we processor 0? */
	cmpwi	0,r24,0			/* Are we processor 0? */
	beq	.__start_initialization_iSeries	/* Start up the first processor */
	beq	.__start_initialization_iSeries	/* Start up the first processor */
	mfspr	r4,CTRLF
	mfspr	r4,SPRN_CTRLF
	li	r5,RUNLATCH		/* Turn off the run light */
	li	r5,CTRL_RUNLATCH	/* Turn off the run light */
	andc	r4,r4,r5
	andc	r4,r4,r5
	mtspr	CTRLT,r4
	mtspr	SPRN_CTRLT,r4


1:
1:
	HMT_LOW
	HMT_LOW
@@ -2082,9 +2082,9 @@ _GLOBAL(hmt_start_secondary)
	mfspr	r4, HID0
	mfspr	r4, HID0
	ori	r4, r4, 0x1
	ori	r4, r4, 0x1
	mtspr	HID0, r4
	mtspr	HID0, r4
	mfspr	r4, CTRLF
	mfspr	r4, SPRN_CTRLF
	oris	r4, r4, 0x40
	oris	r4, r4, 0x40
	mtspr	CTRLT, r4
	mtspr	SPRN_CTRLT, r4
	blr
	blr
#endif
#endif


+3 −5
Original line number Original line Diff line number Diff line
@@ -75,13 +75,9 @@ static int iSeries_idle(void)
{
{
	struct paca_struct *lpaca;
	struct paca_struct *lpaca;
	long oldval;
	long oldval;
	unsigned long CTRL;


	/* ensure iSeries run light will be out when idle */
	/* ensure iSeries run light will be out when idle */
	clear_thread_flag(TIF_RUN_LIGHT);
	ppc64_runlatch_off();
	CTRL = mfspr(CTRLF);
	CTRL &= ~RUNLATCH;
	mtspr(CTRLT, CTRL);


	lpaca = get_paca();
	lpaca = get_paca();


@@ -111,7 +107,9 @@ static int iSeries_idle(void)
			}
			}
		}
		}


		ppc64_runlatch_on();
		schedule();
		schedule();
		ppc64_runlatch_off();
	}
	}


	return 0;
	return 0;
+0 −3
Original line number Original line Diff line number Diff line
@@ -378,9 +378,6 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
		childregs->gpr[1] = sp + sizeof(struct pt_regs);
		childregs->gpr[1] = sp + sizeof(struct pt_regs);
		p->thread.regs = NULL;	/* no user register state */
		p->thread.regs = NULL;	/* no user register state */
		clear_ti_thread_flag(p->thread_info, TIF_32BIT);
		clear_ti_thread_flag(p->thread_info, TIF_32BIT);
#ifdef CONFIG_PPC_ISERIES
		set_ti_thread_flag(p->thread_info, TIF_RUN_LIGHT);
#endif
	} else {
	} else {
		childregs->gpr[1] = usp;
		childregs->gpr[1] = usp;
		p->thread.regs = childregs;
		p->thread.regs = childregs;
+2 −6
Original line number Original line Diff line number Diff line
@@ -113,7 +113,6 @@ void ppc64_enable_pmcs(void)
#ifdef CONFIG_PPC_PSERIES
#ifdef CONFIG_PPC_PSERIES
	unsigned long set, reset;
	unsigned long set, reset;
	int ret;
	int ret;
	unsigned int ctrl;
#endif /* CONFIG_PPC_PSERIES */
#endif /* CONFIG_PPC_PSERIES */


	/* Only need to enable them once */
	/* Only need to enable them once */
@@ -167,11 +166,8 @@ void ppc64_enable_pmcs(void)
	 * On SMT machines we have to set the run latch in the ctrl register
	 * On SMT machines we have to set the run latch in the ctrl register
	 * in order to make PMC6 spin.
	 * in order to make PMC6 spin.
	 */
	 */
	if (cpu_has_feature(CPU_FTR_SMT)) {
	if (cpu_has_feature(CPU_FTR_SMT))
		ctrl = mfspr(CTRLF);
		ppc64_runlatch_on();
		ctrl |= RUNLATCH;
		mtspr(CTRLT, ctrl);
	}
#endif /* CONFIG_PPC_PSERIES */
#endif /* CONFIG_PPC_PSERIES */
}
}


Loading