[PATCH v2 0/1] wifi: mac80211: don't coalesce a new ROC onto an expired one

James-LY Huang james-ly.huang at mediatek.com
Tue Nov 10 04:33:50 PST 2026


From: mtk18285 <james-ly.huang at mediatek.com>

ieee80211_coalesce_hw_started_roc() merges a new remain-on-channel
request into a running one when the new duration fits into the time
the running ROC has left. That remaining time is computed with an
unsigned subtraction which wraps when the running ROC has already
expired, so the "fits" check passes and the new request is queued
behind a ROC that has already delivered its events: the new ROC is
never started, and the cookie handed to userspace never expires.

The expired-but-still-listed state is not rare: a driver usually
processes ieee80211_remain_on_channel_expired() in a work item, so
until that work runs every ROC whose time is up stays listed with
started=true.

This series refuses to coalesce once the running ROC's end time has
passed, so a new request always gets a fresh ROC of its own. It has
been verified with a full x86_64 defconfig kernel build and passes
scripts/checkpatch.pl with no errors or warnings.

Changes in v2:
  - rewrite the commit message and the code comment as requested
    by the reviewer; no functional change.

james-ly huang (1):
  wifi: mac80211: don't coalesce a new ROC onto an expired one

 net/mac80211/offchannel.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

--
2.45.2




More information about the Linux-mediatek mailing list