All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Issue with CONFIG_PREEMPT_VOLUNTARY
@ 2015-10-11 13:05 Gilles Chanteperdrix
  2015-10-12  7:23 ` Jan Kiszka
  0 siblings, 1 reply; 8+ messages in thread
From: Gilles Chanteperdrix @ 2015-10-11 13:05 UTC (permalink / raw)
  To: Xenomai

Hi,

It seems commit fdb5d54d04b8c3b6b6a6ad7ac2b6248cf0b415e0 in the
I-pipe kernels cause a warning when CONFIG_PREEMPT_VOLUNTARY and
CONFIG_IPIPE_DEBUG_INTERNAL are enabled. The culprit is the call to
__ipipe_root_p.

The following patch avoids this warning:

diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
index 0320453..a5e440d 100644
--- a/kernel/ipipe/core.c
+++ b/kernel/ipipe/core.c
@@ -1730,17 +1730,19 @@ int notrace __ipipe_check_percpu_access(void)
 	if (raw_irqs_disabled_flags(flags))
 		goto out;
 
+	if (!IS_ENABLED(CONFIG_PREEMPT_COUNT))
+		goto out;
+
 	/*
 	 * Last chance: hw interrupts were enabled on entry while
 	 * running over the root domain, but the root stage might be
 	 * currently stalled, in which case preemption would be
 	 * disabled, and no migration could occur.
 	 */
-	if (this_domain == ipipe_root_domain) {
-		p = raw_cpu_ptr(&ipipe_percpu.root);
-		if (test_bit(IPIPE_STALL_FLAG, &p->status) || preempt_count())
+
+	p = raw_cpu_ptr(&ipipe_percpu.root);
+	if (test_bit(IPIPE_STALL_FLAG, &p->status) || preempt_count())
 			goto out;
-	}
 	/*
 	 * Our caller may end up accessing the wrong per-cpu variable
 	 * instance due to CPU migration; tell it to complain about


-- 
					    Gilles.
https://click-hack.org


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

end of thread, other threads:[~2015-10-12 17:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11 13:05 [Xenomai] Issue with CONFIG_PREEMPT_VOLUNTARY Gilles Chanteperdrix
2015-10-12  7:23 ` Jan Kiszka
2015-10-12  8:10   ` Gilles Chanteperdrix
2015-10-12  8:37     ` Jan Kiszka
2015-10-12  8:48       ` Gilles Chanteperdrix
2015-10-12  8:58         ` Jan Kiszka
2015-10-12 17:40           ` [Xenomai] [PATCH 1/2] ipipe: simplify __ipipe_check_perccpu_access() Gilles Chanteperdrix
2015-10-12 17:40             ` [Xenomai] [PATCH 2/2] ipipe: fix __ipipe_check_percpu_access() Gilles Chanteperdrix

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.