Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: mac80211: use wiphy_hrtimer_work for CAC timeout

Prior initiating communication in a DFS channel, there should be a
monitoring of RADAR in that channel for a minimum of 600 seconds if it
is a Weather RADAR channel and 60 seconds for other DFS channels. This
Channel Availability Check(CAC) is currently implemented by scheduling
a work item for execution with a delay equal to an appropriate timeout.
But this work item is observed to take more delay than specified
(4-5 seconds in regular DFS channels and 25-30 seconds in Weather RADAR
channels). Even though this delay is expected in case of delayed work
queue as there is no guarantee that the work will be scheduled exactly
after the specified delay, a delay of more than 20 seconds is too much
for the AP to be in non-operational state.

Recently commit 7ceba45a6658 ("wifi: cfg80211: add an hrtimer based
delayed work item") added an infrastructure to overcome this issue by
supporting high resolution timers for mac80211 delayed work, which do not
have this timeout latency. Switch the CAC timeout to use this
infrastructure, so the CAC completion handling is triggered with tighter
timing and reduced latency.

Signed-off-by: Amith A <amith.a@oss.qualcomm.com>
Link: https://patch.msgid.link/20260130035511.2328713-1-amith.a@oss.qualcomm.com
[fix delay handling]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Amith A and committed by
Johannes Berg
ba90a7af c3e92c78

+9 -9
+4 -4
net/mac80211/cfg.c
··· 1916 1916 1917 1917 if (sdata->wdev.links[link_id].cac_started) { 1918 1918 chandef = link_conf->chanreq.oper; 1919 - wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); 1919 + wiphy_hrtimer_work_cancel(wiphy, &link->dfs_cac_timer_work); 1920 1920 cfg80211_cac_event(sdata->dev, &chandef, 1921 1921 NL80211_RADAR_CAC_ABORTED, 1922 1922 GFP_KERNEL, link_id); ··· 3874 3874 if (err) 3875 3875 return err; 3876 3876 3877 - wiphy_delayed_work_queue(wiphy, &link_data->dfs_cac_timer_work, 3878 - msecs_to_jiffies(cac_time_ms)); 3877 + wiphy_hrtimer_work_queue(wiphy, &link_data->dfs_cac_timer_work, 3878 + ms_to_ktime(cac_time_ms)); 3879 3879 3880 3880 return 0; 3881 3881 } ··· 3894 3894 if (!link_data) 3895 3895 continue; 3896 3896 3897 - wiphy_delayed_work_cancel(wiphy, 3897 + wiphy_hrtimer_work_cancel(wiphy, 3898 3898 &link_data->dfs_cac_timer_work); 3899 3899 3900 3900 if (sdata->wdev.links[link_id].cac_started) {
+1 -1
net/mac80211/ieee80211_i.h
··· 1099 1099 int ap_power_level; /* in dBm */ 1100 1100 1101 1101 bool radar_required; 1102 - struct wiphy_delayed_work dfs_cac_timer_work; 1102 + struct wiphy_hrtimer_work dfs_cac_timer_work; 1103 1103 1104 1104 union { 1105 1105 struct ieee80211_link_data_managed mgd;
+1 -1
net/mac80211/iface.c
··· 565 565 wiphy_work_cancel(local->hw.wiphy, &sdata->deflink.csa.finalize_work); 566 566 wiphy_work_cancel(local->hw.wiphy, 567 567 &sdata->deflink.color_change_finalize_work); 568 - wiphy_delayed_work_cancel(local->hw.wiphy, 568 + wiphy_hrtimer_work_cancel(local->hw.wiphy, 569 569 &sdata->deflink.dfs_cac_timer_work); 570 570 571 571 if (sdata->wdev.links[0].cac_started) {
+2 -2
net/mac80211/link.c
··· 116 116 ieee80211_color_change_finalize_work); 117 117 wiphy_delayed_work_init(&link->color_collision_detect_work, 118 118 ieee80211_color_collision_detection_work); 119 - wiphy_delayed_work_init(&link->dfs_cac_timer_work, 119 + wiphy_hrtimer_work_init(&link->dfs_cac_timer_work, 120 120 ieee80211_dfs_cac_timer_work); 121 121 122 122 if (!deflink) { ··· 155 155 &link->csa.finalize_work); 156 156 157 157 if (link->sdata->wdev.links[link->link_id].cac_started) { 158 - wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, 158 + wiphy_hrtimer_work_cancel(link->sdata->local->hw.wiphy, 159 159 &link->dfs_cac_timer_work); 160 160 cfg80211_cac_event(link->sdata->dev, 161 161 &link->conf->chanreq.oper,
+1 -1
net/mac80211/util.c
··· 3597 3597 if (ctx && &ctx->conf != chanctx_conf) 3598 3598 continue; 3599 3599 3600 - wiphy_delayed_work_cancel(local->hw.wiphy, 3600 + wiphy_hrtimer_work_cancel(local->hw.wiphy, 3601 3601 &link->dfs_cac_timer_work); 3602 3602 3603 3603 if (!sdata->wdev.links[link_id].cac_started)