mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Mehmet Fide <mehmet.fide@gmail.com>, Ping-Ke Shih <pkshih@realtek.com>
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	mehmet.fide@screeningeagle.com
Subject: Re: [PATCH rtw-next v13 2/3] wifi: rtw88: support channel switch in AP mode
Date: Fri, 20 Nov 2026 15:15:52 +0100	[thread overview]
Message-ID: <20261120141554.68116-1-luka.gejak@linux.dev> (raw)
In-Reply-To: <20261118231940.3950-3-mehmet.fide@gmail.com>

Hi Mehmet,

Thanks for the v13. Four comments below.

On November 19, 2026 12:19:39 AM GMT+01:00, Mehmet Fide
<mehmet.fide@gmail.com> wrote:

> diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
> index e0f3e1adb13f..9d5df3e65b97 100644
> --- a/drivers/net/wireless/realtek/rtw88/fw.c
> +++ b/drivers/net/wireless/realtek/rtw88/fw.c

[ ... ]

> +	rtwdev->csa_due = ktime_add_us(rtwdev->csa_due, interval);
> +	delay = ktime_us_delta(rtwdev->csa_due, ktime_get());
> +	ieee80211_queue_delayed_work(rtwdev->hw, &rtwdev->csa_beacon_work,
> +				     usecs_to_jiffies(max(delay, 0)));

I think this can finish before the last count gets a TBTT if the work
runs a full interval late. With a count of 2, the work installs count 1
and queues the finish immediately because csa_due has already passed.

Patch 3 measures the next TBTT after the download. Could the countdown
use that pacing from the commit that enables CSA?

[ ... ]

> +	rtwdev->csa_retry = !!rtw_fw_download_rsvd_page(rtwdev);
> +	if (!rtwdev->csa_retry)
> +		rtw_send_rsvd_page_h2c(rtwdev);
> +	rtw_fw_csa_queue(rtwdev, vif);

What happens if the page can never fit? On RTL8821C the driver has
eight 128 byte pages. A beacon that fits before the switch can exceed
that space after adding the CSA element. The builder then returns an
error every time, so the switch stays pending and a request with
block_tx keeps the queues stopped.

Could we reject a template that cannot fit before committing to the
switch, or give up and stop the AP if the download keeps failing?

[ ... ]

> diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
> index 3029fbdb288a..c9ac2685437e 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c

[ ... ]

>  	if (changed & BSS_CHANGED_BEACON) {
>  		rtw_set_dtim_period(rtwdev, conf->dtim_period);
> -		rtw_fw_download_rsvd_page(rtwdev);
> +		ret = rtw_fw_download_rsvd_page(rtwdev);
>  		rtw_send_rsvd_page_h2c(rtwdev);

[ ... ]

> +		if (conf->csa_active)
> +			rtw_fw_csa_start(rtwdev, vif, !!ret);
> +		else
> +			rtw_fw_csa_stop(rtwdev, vif);

Could we retry the first beacon download after the switch too?
mac80211 has already changed the channel when it hands us that beacon.
If the page buffer allocation fails here, the old page still holds the
last CSA beacon. As far as I can see, the switch can be reported complete
while the new beacon is still waiting for another update.

[ ... ]

> +	} else {
> +		/* what a countdown may have held back */
> +		rtw_fw_download_rsvd_page(rtwdev);
> +		rtw_send_rsvd_page_h2c(rtwdev);
> +	}

There seems to be a similar case when the AP stops. If the station
associates during the countdown and the AP stops before the next step,
this is the first chance to install the station's new reserved page
contents. A failed allocation here can leave a PS Poll template with
the AID it had before the association, even though the station stays
connected.

Could we queue a retry for the station if this refresh fails?

Best regards,
Luka Gejak

  reply	other threads:[~2026-11-20 14:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 23:19 [PATCH rtw-next v13 0/3] wifi: rtw88: " Mehmet Fide
2026-11-18 23:19 ` [PATCH rtw-next v13 1/3] wifi: rtw88: download the beacon the reserved page was built with Mehmet Fide
2026-11-18 23:19 ` [PATCH rtw-next v13 2/3] wifi: rtw88: support channel switch in AP mode Mehmet Fide
2026-11-20 14:15   ` Luka Gejak [this message]
2026-11-18 23:19 ` [PATCH rtw-next v13 3/3] wifi: rtw88: time the countdown downloads from the TBTT Mehmet Fide
2026-11-20 14:15   ` Luka Gejak
2026-11-19  5:38 ` [PATCH rtw-next v13 0/3] wifi: rtw88: channel switch in AP mode Mehmet Fide

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=20261120141554.68116-1-luka.gejak@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mehmet.fide@gmail.com \
    --cc=mehmet.fide@screeningeagle.com \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    /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

all inboxes | Powered by JetHome®