All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Leonard Lausen <leonard@lausen.nl>, Ping-Ke Shih <pkshih@realtek.com>
Cc: leonard@lausen.nl, Shawn Lin <shawn.lin@rock-chips.com>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-wireless@vger.kernel.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH rtw-next v2 1/2] wifi: rtw88: 8822c: filter hardware-handled control frames on SDIO
Date: Mon, 16 Nov 2026 17:30:30 +0100	[thread overview]
Message-ID: <86B705FE-9271-4721-BF04-4777D8D130BC@linux.dev> (raw)
In-Reply-To: <20261116100804.425592-4-leonard@lausen.nl>

Hi Leonard,

Thanks for the update. One comment below.

On November 16, 2026 11:08:03 AM GMT+01:00, Leonard Lausen
<leonard@lausen.nl> wrote:

> @@ -2096,6 +2096,16 @@ static int rtw8822c_mac_init(struct rtw_dev *rtwdev)

[ ... ]

>       rtwdev->hal.rxfltmap1 = WLAN_RX_FILTER1;
> +     if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO) {
> +             /*
> +              * Hardware handles these frames; retain BAR and PS-Poll for
> +              * mac80211. FIF_CONTROL restores all subtypes for monitors.
> +              */
> +             rtwdev->hal.rxfltmap1 &= ~(BIT_RXFLTMAP1_BACK |
> +                                        BIT_RXFLTMAP1_RTS |
> +                                        BIT_RXFLTMAP1_CTS |
> +                                        BIT_RXFLTMAP1_ACK);
> +     }
>       rtw_write16(rtwdev, REG_RXFLTMAP1, rtwdev->hal.rxfltmap1);

[ ... ]

As far as I can see, later writes of this default can disable these frames
while a monitor still requests them.

For example, with an unassociated interface in IPS, bringing up a monitor
first calls ieee80211_configure_filter(). The following
ieee80211_recalc_idle() leaves IPS and runs rtw8822c_mac_init(), which
writes the reduced map again. A hardware restart or resume with an
existing monitor seems to have the same problem.

mac80211 keeps local->filter_flags, so FIF_CONTROL can still be set in
*new_flags but clear in changed_flags. Then rtw_ops_configure_filter()
skips restoring 0xffff.

There also seems to be a way to lose it while the radio stays on.
Associating a managed interface with an MU beamformer calls:

        rtw_bf_enable_bfee_mu()
                rtw_bf_cfg_sounding()

Both functions write hal.rxfltmap1 back to REG_RXFLTMAP1, replacing the
monitor's 0xffff with the reduced map. Before this patch those writes
left the four subtypes enabled.

Could we preserve the active FIF_CONTROL setting in the common filter
code and use it for MAC initialization and the writes in bf.c too?

Best regards,
Luka Gejak

WARNING: multiple messages have this Message-ID (diff)
From: Luka Gejak <luka.gejak@linux.dev>
To: Leonard Lausen <leonard@lausen.nl>, Ping-Ke Shih <pkshih@realtek.com>
Cc: leonard@lausen.nl, Shawn Lin <shawn.lin@rock-chips.com>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-wireless@vger.kernel.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH rtw-next v2 1/2] wifi: rtw88: 8822c: filter hardware-handled control frames on SDIO
Date: Mon, 16 Nov 2026 17:30:30 +0100	[thread overview]
Message-ID: <86B705FE-9271-4721-BF04-4777D8D130BC@linux.dev> (raw)
In-Reply-To: <20261116100804.425592-4-leonard@lausen.nl>

Hi Leonard,

Thanks for the update. One comment below.

On November 16, 2026 11:08:03 AM GMT+01:00, Leonard Lausen
<leonard@lausen.nl> wrote:

> @@ -2096,6 +2096,16 @@ static int rtw8822c_mac_init(struct rtw_dev *rtwdev)

[ ... ]

>       rtwdev->hal.rxfltmap1 = WLAN_RX_FILTER1;
> +     if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO) {
> +             /*
> +              * Hardware handles these frames; retain BAR and PS-Poll for
> +              * mac80211. FIF_CONTROL restores all subtypes for monitors.
> +              */
> +             rtwdev->hal.rxfltmap1 &= ~(BIT_RXFLTMAP1_BACK |
> +                                        BIT_RXFLTMAP1_RTS |
> +                                        BIT_RXFLTMAP1_CTS |
> +                                        BIT_RXFLTMAP1_ACK);
> +     }
>       rtw_write16(rtwdev, REG_RXFLTMAP1, rtwdev->hal.rxfltmap1);

[ ... ]

As far as I can see, later writes of this default can disable these frames
while a monitor still requests them.

For example, with an unassociated interface in IPS, bringing up a monitor
first calls ieee80211_configure_filter(). The following
ieee80211_recalc_idle() leaves IPS and runs rtw8822c_mac_init(), which
writes the reduced map again. A hardware restart or resume with an
existing monitor seems to have the same problem.

mac80211 keeps local->filter_flags, so FIF_CONTROL can still be set in
*new_flags but clear in changed_flags. Then rtw_ops_configure_filter()
skips restoring 0xffff.

There also seems to be a way to lose it while the radio stays on.
Associating a managed interface with an MU beamformer calls:

        rtw_bf_enable_bfee_mu()
                rtw_bf_cfg_sounding()

Both functions write hal.rxfltmap1 back to REG_RXFLTMAP1, replacing the
monitor's 0xffff with the reduced map. Before this patch those writes
left the four subtypes enabled.

Could we preserve the active FIF_CONTROL setting in the common filter
code and use it for MAC initialization and the writes in bf.c too?

Best regards,
Luka Gejak

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 10:08 [PATCH rtw-next v2 0/2] wifi: rtw88: reduce RTL8822CS SDIO request overhead Leonard Lausen
2026-11-16 10:08 ` Leonard Lausen
2026-11-16 10:08 ` [PATCH rtw-next v2 1/2] wifi: rtw88: 8822c: filter hardware-handled control frames on SDIO Leonard Lausen
2026-11-16 10:08   ` Leonard Lausen
2026-11-16 16:30   ` Luka Gejak [this message]
2026-11-16 16:30     ` Luka Gejak
2026-11-16 10:08 ` [PATCH rtw-next v2 2/2] wifi: rtw88: sdio: combine free TX page register reads Leonard Lausen
2026-11-16 10:08   ` Leonard Lausen

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=86B705FE-9271-4721-BF04-4777D8D130BC@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=heiko@sntech.de \
    --cc=leonard@lausen.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=shawn.lin@rock-chips.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.