Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: JB Tsai <jb.tsai@mediatek.com>
Cc: nbd@nbd.name, lorenzo@kernel.org, linux-wireless@vger.kernel.org,
	 linux-mediatek@lists.infradead.org, Sean.Wang@mediatek.com,
	 James-LY.Huang@mediatek.com
Subject: Re: [PATCH 1/1] wifi: mac80211: don't coalesce a new ROC onto an expired one
Date: Tue, 10 Nov 2026 10:51:46 +0100	[thread overview]
Message-ID: <72bf69b140827263fc4dec20f757d54d85f4cc65.camel@sipsolutions.net> (raw)
In-Reply-To: <20261104092050.1930716-1-jb.tsai@mediatek.com>

On Wed, 2026-11-04 at 17:20 +0800, JB Tsai wrote:
> From: james-ly huang <james-ly.huang@mediatek.com>
> 
> ieee80211_coalesce_hw_started_roc() computed the remaining time of the
> running ROC as
> 
> 	remaining = cur_roc->start_time +
> 		    msecs_to_jiffies(cur_roc->duration) - now;
> 
> and merged the new request into it when the new duration fits. When the
> running ROC is already over, that subtraction wraps around (unsigned),
> the "fits" check passes, and the new request gets added behind a ROC
> that will never produce another on_channel or expired event.
> 
> The expired-but-still-listed state is not rare at all: the driver's
> ieee80211_remain_on_channel_expired() only queues the hw_roc_done work,
> so until that work runs - the driver's UNI_ROC_ABORT round trip can
> take tens of ms - every ROC on the list whose time is up stays listed
> with started=true. A remain-on-channel / mgmt-TX request arriving in
> that window hits exactly this path.
> 
> Check the ROC's end time explicitly with time_after_eq() and refuse to
> coalesce once it has passed; compute the (now guaranteed positive)
> remaining window from the same end time.

Please rewrite this with a useful commit message and comment.

johannes


      reply	other threads:[~2026-11-10  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  9:20 [PATCH 1/1] wifi: mac80211: don't coalesce a new ROC onto an expired one JB Tsai
2026-11-10  9:51 ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72bf69b140827263fc4dec20f757d54d85f4cc65.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=James-LY.Huang@mediatek.com \
    --cc=Sean.Wang@mediatek.com \
    --cc=jb.tsai@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox