Linux-rt-users archive on
 help / color / Atom feed
* [PATCH RT] powerpc: Fixup compile and lazy-preempt
@ 2019-12-03 17:37 Sebastian Andrzej Siewior
  0 siblings, 0 replies; only message in thread
From: Sebastian Andrzej Siewior @ 2019-12-03 17:37 UTC (permalink / raw)
  To: LKML; +Cc: Steven Rostedt, linux-rt-users, Thomas Gleixner

Since the softirq rework 32bit POWER does not compile because
get_current() is not provided - just the `current' macro.
Use the `current' instead.

Since the v5.2-RT series, the lazy-preempt code is broken. It loads the
lazy-counter and flags from the R9 but R2 should be used.

Signed-off-by: Sebastian Andrzej Siewior <>
 arch/powerpc/kernel/entry_32.S | 4 ++--
 include/linux/preempt.h        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index d37b373104502..004944258387b 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -893,10 +893,10 @@ user_exc_return:		/* r10 contains MSR_KERNEL here */
 	bne	restore_kuap
 	andi.	r8,r8,_TIF_NEED_RESCHED
 	bne+	1f
-	lwz	r0,TI_PREEMPT_LAZY(r9)
+	lwz	r0,TI_PREEMPT_LAZY(r2)
 	cmpwi	0,r0,0          /* if non-zero, just restore regs and return */
 	bne	restore_kuap
-	lwz	r0,TI_FLAGS(r9)
+	lwz	r0,TI_FLAGS(r2)
 	andi.	r0,r0,_TIF_NEED_RESCHED_LAZY
 	beq+	restore_kuap
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index d559e3a0379c2..7653dd58b4b21 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -100,9 +100,9 @@
-#define softirq_count()		((long)get_current()->softirq_count)
+#define softirq_count()		(current->softirq_count)
 #define in_softirq()		(softirq_count())
-#define in_serving_softirq()	(get_current()->softirq_count & SOFTIRQ_OFFSET)
+#define in_serving_softirq()	(current->softirq_count & SOFTIRQ_OFFSET)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 17:37 [PATCH RT] powerpc: Fixup compile and lazy-preempt Sebastian Andrzej Siewior

Linux-rt-users archive on

Archives are clonable:
	git clone --mirror linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ \
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone