All of lore.kernel.org
 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 v11 2/3] wifi: rtw88: support channel switch in AP mode
Date: Mon, 16 Nov 2026 15:24:45 +0100	[thread overview]
Message-ID: <59C03074-784F-41CE-A27D-EF3F30773D77@linux.dev> (raw)
In-Reply-To: <20261116071952.1142013-3-mehmet.fide@gmail.com>

Hi Mehmet,

Thanks for the v11. Three comments below.

On November 16, 2026 8:19:51 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

[ ... ]

> +     if (!ieee80211_beacon_cntdwn_is_complete(vif, 0)) {
> +             ieee80211_beacon_update_cntdwn(vif, 0);
> +             rtw_fw_download_rsvd_page(rtwdev);
> +             rtw_send_rsvd_page_h2c(rtwdev);
> +             rtw_fw_csa_queue(rtwdev, vif);
> +     } else {
> +             ieee80211_csa_finish(vif, 0);
> +     }

As far as I can see, the template fetch writes the new count into
mac80211's beacon before the transfer can fail. If the allocation in
rtw_tx_write_data_rsvd_page_get() fails at count 1, the next work still
finds the countdown complete. With patch 3 and count 2, this can finish
the switch without any CSA beacon going out.

Could a failed download keep that count pending for a retry before
allowing completion?

[ ... ]

> diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c

[ ... ]

> +     csa = rtw_fw_csa_stop(rtwdev, vif);

[ ... ]

> +     } else if (csa) {
> +             /* what the countdown held back */
> +             rtw_fw_download_rsvd_page(rtwdev);
> +             rtw_send_rsvd_page_h2c(rtwdev);
> +     }

I think ieee80211_stop_ap() can clear csa_active and the countdown work
can then clear csa_vif before stop_ap gets the driver mutex.
rtw_fw_csa_stop() returns false, so this refresh is skipped even with a
station left running. Any deferred station PG backup or association
download is then lost.

Maybe the refresh should not depend on csa_vif still being set? The
wiphy lock does not exclude the countdown work.

[ ... ]

> +     else
> +             rtw_iterate_vifs(rtwdev, rtw_ops_csa_resume_iter, rtwdev);

rtw_iterate_vifs() silently skips a vif if its GFP_ATOMIC entry
allocation fails. With an AP counting down next to an associated station
on the 8822C, skipping the AP leaves csa_active set and the work
cancelled. Resume returns 0, so mac80211 sends no beacon replay and the
countdown stays stuck. TIM downloads fetch a template and do not advance
it either.

Could the AP be found without allocating an entry?

Best regards,
Luka Gejak

  reply	other threads:[~2026-11-16 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  7:19 [PATCH rtw-next v11 0/3] wifi: rtw88: channel switch in AP mode Mehmet Fide
2026-11-16  7:19 ` [PATCH rtw-next v11 1/3] wifi: rtw88: download the beacon the reserved page was built with Mehmet Fide
2026-11-16  7:19 ` [PATCH rtw-next v11 2/3] wifi: rtw88: support channel switch in AP mode Mehmet Fide
2026-11-16 14:24   ` Luka Gejak [this message]
2026-11-16 21:49     ` Mehmet Fide
2026-11-16  7:19 ` [PATCH rtw-next v11 3/3] wifi: rtw88: time the countdown downloads from the TBTT Mehmet Fide
2026-11-16 14:26   ` Luka Gejak
2026-11-16 21:49     ` 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=59C03074-784F-41CE-A27D-EF3F30773D77@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.