All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: ipipe: Do full exit checks after __ipipe_call_mayday
@ 2019-12-19 16:46 Jan Kiszka
  2019-12-19 16:53 ` Jan Kiszka
  2019-12-20 22:19 ` Steven Seeger
  0 siblings, 2 replies; 10+ messages in thread
From: Jan Kiszka @ 2019-12-19 16:46 UTC (permalink / raw)
  To: Steven Seeger; +Cc: Xenomai, Philippe Gerum

From: Jan Kiszka <jan.kiszka@siemens.com>

The mayday event tends to push us into root mode. So we must check
__ipipe_root_p again afterwards.

This fixes the gdb synchronous stop test case in Xenomai.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Ho, ho, this is an early X-mas gift.

 arch/powerpc/kernel/ipipe.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/ipipe.c b/arch/powerpc/kernel/ipipe.c
index 30c56d922a2c..fefb0542acd8 100644
--- a/arch/powerpc/kernel/ipipe.c
+++ b/arch/powerpc/kernel/ipipe.c
@@ -240,9 +240,7 @@ EXPORT_SYMBOL_GPL(ipipe_get_sysinfo);
 
 static int __ipipe_exit_irq(struct pt_regs *regs)
 {
-	int root = __ipipe_root_p;
-
-	if (root) {
+	if (__ipipe_root_p) {
 #ifdef CONFIG_PPC_970_NAP
 		struct thread_info *ti = current_thread_info();
 		/* Emulate the napping check when 100% sure we do run
@@ -258,7 +256,8 @@ static int __ipipe_exit_irq(struct pt_regs *regs)
 	if (user_mode(regs) && ipipe_test_thread_flag(TIP_MAYDAY))
 		__ipipe_call_mayday(regs);
 
-	if (root && !test_bit(IPIPE_STALL_FLAG, &__ipipe_root_status))
+	if (__ipipe_root_p &&
+	    !test_bit(IPIPE_STALL_FLAG, &__ipipe_root_status))
 		return 1;
 
 	return 0;
-- 
2.16.4


-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-12-21 12:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-19 16:46 [PATCH] powerpc: ipipe: Do full exit checks after __ipipe_call_mayday Jan Kiszka
2019-12-19 16:53 ` Jan Kiszka
2019-12-19 17:01   ` Steven Seeger
2019-12-19 17:14     ` Jan Kiszka
2019-12-19 17:15       ` Steven Seeger
2019-12-19 17:24         ` Jan Kiszka
2019-12-21  0:14           ` Steven Seeger
2019-12-20 23:38   ` Steven Seeger
2019-12-21 12:09     ` Jan Kiszka
2019-12-20 22:19 ` Steven Seeger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.