From 536395141b8bfb9c5219c1779282b5abc66970a9 Mon Sep 17 00:00:00 2001 From: Bhanu Kiran Atturu Date: Fri, 7 Aug 2026 19:37:16 -0400 Subject: [PATCH] [KUBE-54] gimamdsmi: gate watcher device polling on watch subscribers The GIM watcher's timer callback opened /dev/gim-smi0 and issued full-access SMI reads every tick unconditionally, even with no GPUWatch subscribers -- a permanent 1Hz gim poll with no consumer, and the exposure surface for the KUBE-54 hang (a wedged gim ioctl in this path livelocks the caller in-kernel). Port the subscriber guard the baremetal amdsmi path already has. Validated by strace on banff MI300X (GIM) and localhost MI210 (baremetal): patched build opens the device only at startup discovery, zero periodic opens after; stock polls gim-smi0 ~1Hz indefinitely. --- sw/nic/gpuagent/api/smi/gimamdsmi/smi_state.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sw/nic/gpuagent/api/smi/gimamdsmi/smi_state.cc b/sw/nic/gpuagent/api/smi/gimamdsmi/smi_state.cc index ffc9f7a2..117c712f 100644 --- a/sw/nic/gpuagent/api/smi/gimamdsmi/smi_state.cc +++ b/sw/nic/gpuagent/api/smi/gimamdsmi/smi_state.cc @@ -561,6 +561,11 @@ watch_timer_cb_ (event::timer_t *timer) aga_task_spec_t task_spec = {}; static uint16_t timer_ticks = 0; + // only start updating watch fields once at least one client has subscribed + // to a watch group + if (!g_smi_state.any_watch_group_subscribed()) { + return; + } // get latest values of all watch fields g_smi_state.watcher_update_watch_db(&task_spec.watch_db);