]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rv/ltl: Do not execute the Buchi automaton twice on start condition
authorNam Cao <namcao@linutronix.de>
Fri, 11 Jul 2025 13:17:37 +0000 (15:17 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 23 Jul 2025 00:34:41 +0000 (20:34 -0400)
On start condition of a Buchi automaton, the automaton is executed twice.

This is fine for now, as all the current LTL operators do not care about
this. But it would break the 'next' operator, which will be introduced in a
follow-up patch.

Prepare for the introduction of the 'next' operator, only execute the
automaton once on start condition.

Cc: John Ogness <john.ogness@linutronix.de>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Gabriele Monaco <gmonaco@redhat.com>
Link: https://lore.kernel.org/9379f4e7b9c1c69a6dca3e20a22936c850a25ca7.1752239482.git.namcao@linutronix.de
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
include/rv/ltl_monitor.h

index 9a583125b566bfb4f58c1823e2aded9c85e85512..67031a774e3d3c1e07653f5ddffca433f0ec4493 100644 (file)
@@ -167,8 +167,10 @@ static void ltl_atom_update(struct task_struct *task, enum ltl_atom atom, bool v
        ltl_atom_set(mon, atom, value);
        ltl_atoms_fetch(task, mon);
 
-       if (!rv_ltl_valid_state(mon))
+       if (!rv_ltl_valid_state(mon)) {
                ltl_attempt_start(task, mon);
+               return;
+       }
 
        ltl_validate(task, mon);
 }