All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] sched: dovetail: pass thread-info bits to arch_dovetail_switch_finish()
@ 2022-04-02 14:21 Philippe Gerum
  2022-04-02 14:21 ` [PATCH 2/4] ARM: dovetail: fix up arch_dovetail_switch_finish() signature Philippe Gerum
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Philippe Gerum @ 2022-04-02 14:21 UTC (permalink / raw)
  To: xenomai

From: Philippe Gerum <rpm@xenomai.org>

The out-of-band switch tail code may need the thread-info work bits to
reinstate the current context appropriately, pass them to
arch_dovetail_switch_finish().

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
---
 kernel/sched/core.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a1159a263894..75b506bb60bb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -10902,6 +10902,7 @@ int dovetail_leave_inband(void)
 {
 	struct task_struct *p = current;
 	struct irq_pipeline_data *pd;
+	unsigned int ti_work;
 	unsigned long flags;
 
 	preempt_disable();
@@ -10930,7 +10931,8 @@ int dovetail_leave_inband(void)
 	 * architecture-specific fixups (e.g. fpu context reload).
 	 */
 	if (likely(__schedule(SM_NONE))) {
-		arch_dovetail_switch_finish(false);
+		ti_work = READ_ONCE(current_thread_info()->flags);
+		arch_dovetail_switch_finish(false, ti_work);
 		return 0;
 	}
 
@@ -10987,6 +10989,7 @@ bool dovetail_context_switch(struct dovetail_altsched_context *out,
 	struct task_struct *next, *prev, *last;
 	struct mm_struct *prev_mm, *next_mm;
 	bool inband_tail = false;
+	unsigned long ti_work;
 
 	WARN_ON_ONCE(dovetail_debug() && on_pipeline_entry());
 
@@ -11108,7 +11111,8 @@ bool dovetail_context_switch(struct dovetail_altsched_context *out,
 		lockdep_write_irqs_state(lockdep_irqs);
 	}
 
-	arch_dovetail_switch_finish(leave_inband);
+	ti_work = READ_ONCE(current_thread_info()->flags);
+	arch_dovetail_switch_finish(leave_inband, ti_work);
 
 	/*
 	 * inband_tail is true whenever we are finalizing a transition
-- 
2.34.1



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

end of thread, other threads:[~2022-04-03 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-02 14:21 [PATCH 1/4] sched: dovetail: pass thread-info bits to arch_dovetail_switch_finish() Philippe Gerum
2022-04-02 14:21 ` [PATCH 2/4] ARM: dovetail: fix up arch_dovetail_switch_finish() signature Philippe Gerum
2022-04-02 14:21 ` [PATCH 3/4] arm64: " Philippe Gerum
2022-04-02 14:21 ` [PATCH 4/4] x86: dovetail: reinstate I/O bitmap on out-of-band user entry Philippe Gerum
2022-04-02 19:18 ` [PATCH 1/4] sched: dovetail: pass thread-info bits to arch_dovetail_switch_finish() Richard Weinberger
2022-04-03 14:40   ` Philippe Gerum

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.