[PATCH 3/6] vt: keyboard: publish dead_key_next with release semantics

From: Jaidev Shastri via B4 Relay

Date: Mon Sep 21 2026 - 21:29:58 EST


From: Jaidev Shastri <jaidevshastri@xxxxxx>

fn_compose() arms the dead-key state in dead_key_next and k_unicode()
consumes it together with diacr.

Store the flag with smp_store_release() and read it with
smp_load_acquire().

Found with MBCheck, a static herd7-based memory consistency checker.

Signed-off-by: Jaidev Shastri <jaidevshastri@xxxxxx>
---
drivers/tty/vt/keyboard.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 6f3472cd4..d7db5e226 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -618,7 +618,8 @@ static void fn_boot_it(struct vc_data *vc)

static void fn_compose(struct vc_data *vc)
{
- dead_key_next = true;
+ /* Pairs with the smp_load_acquire() in k_unicode(). */
+ smp_store_release(&dead_key_next, true);
}

static void fn_spawn_con(struct vc_data *vc)
@@ -672,7 +673,8 @@ static void k_unicode(struct vc_data *vc, unsigned int value, char up_flag)
if (diacr)
value = handle_diacr(vc, value);

- if (dead_key_next) {
+ /* Pairs with the smp_store_release() in fn_compose(). */
+ if (smp_load_acquire(&dead_key_next)) {
dead_key_next = false;
diacr = value;
return;

--
2.43.0