From: Loïc Kassel The simulated TSF is based on boottime, and the beacon timer is re-armed with an absolute expiry derived from the TSF through mac80211_hwsim_tsf_to_boottime(). The timer itself is however still set up with CLOCK_MONOTONIC. Boottime keeps running while the system is suspended, monotonic does not. After the host has been suspended once, every beacon is therefore scheduled too late by the total time spent in suspend, and APs practically stop sending beacons. Set the beacon timer up with CLOCK_BOOTTIME so that it is consistent with the TSF. The bug was analysed, and this change and commit message drafted, with the help of an AI assistant (Claude, Opus 5.5). I reviewed the change and tested it on v7.2.11 (Fedora 44), applying the same one-line change to that kernel's mac80211_hwsim and loading it as an out-of-tree module. With hostapd started after a suspend (boottime 61 s ahead of monotonic), an associated station received about 10 beacons per second with no beacon loss, and scans found all APs. With the unmodified module, in the same situation, beacons practically stopped and APs without associated stations were not found by scans. Fixes: 933f5bec98a1 ("wifi: mac80211_hwsim: register beacon timer by calculating TBTT") Closes: https://lore.kernel.org/linux-wireless/CAAzpgGdksHZjx4jc20zqnAG_PQ2e1ggANQjt2eiycUiWc+vPHg@mail.gmail.com/ Signed-off-by: Loïc Kassel --- Benjamin confirmed the analysis in the report thread and suggested that I send the fix myself. This is my first kernel patch. --- drivers/net/wireless/virtual/mac80211_hwsim_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c index b9446577ff..203bf9a4b9 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c @@ -6136,7 +6136,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, for (i = 0; i < ARRAY_SIZE(data->link_data); i++) { hrtimer_setup(&data->link_data[i].beacon_timer, mac80211_hwsim_beacon, - CLOCK_MONOTONIC, HRTIMER_MODE_ABS_SOFT); + CLOCK_BOOTTIME, HRTIMER_MODE_ABS_SOFT); data->link_data[i].link_id = i; } --- base-commit: 9d8ec0b5b5295bd23d979d1b2b905de25c36fff2 change-id: 20261023-hwsim-beacon-clock-ea8fe1d0c998 Best regards, -- Loïc Kassel