Bug 272145 - Bug when enabling RTW880 wireless during installation (skb tunable / firmware / loader.conf)
Summary: Bug when enabling RTW880 wireless during installation (skb tunable / firmware...
Status: Closed Feedback Timeout
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 13.2-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: Bjoern A. Zeeb
URL:
Keywords:
Depends on:
Blocks: 273621
  Show dependency treegraph
 
Reported: 2023-06-22 12:30 UTC by Maurício Nunes
Modified: 2025-11-12 18:47 UTC (History)
2 users (show)

See Also:


Attachments
It recognizes my wifi device (85.92 KB, image/jpeg)
2023-06-22 12:30 UTC, Maurício Nunes
no flags Details
when selecting the device (75.81 KB, image/jpeg)
2023-06-22 12:31 UTC, Maurício Nunes
no flags Details
show this messages (98.98 KB, image/jpeg)
2023-06-22 12:31 UTC, Maurício Nunes
no flags Details
pciconf (411.91 KB, image/jpeg)
2023-07-11 00:48 UTC, Maurício Nunes
no flags Details
ifconfig (89.92 KB, image/jpeg)
2023-07-14 12:54 UTC, Maurício Nunes
no flags Details
scan (96.43 KB, image/jpeg)
2023-07-14 12:55 UTC, Maurício Nunes
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maurício Nunes 2023-06-22 12:30:20 UTC
Created attachment 242933 [details]
It recognizes my wifi device

I've been trying to install a clean version of FreeBSD 13.2 from the USB stick, everything works fine, if I don't enable my wireless. I have an Asus M515DA notebook, and it is wireless only.

The symptom is the same both during the installation and after the installation, I activate the wireless.

It displays that WPA_SUPPLICANT was active but interface was not. I also tried with an iso that I generated from the Source of github, it gives the same error, but at the time it recognizes the wireless networks and when I put the network password, it gives a kernel panic.
Comment 1 Maurício Nunes 2023-06-22 12:31:17 UTC
Created attachment 242934 [details]
when selecting the device
Comment 2 Maurício Nunes 2023-06-22 12:31:49 UTC
Created attachment 242935 [details]
show this messages
Comment 3 Maurício Nunes 2023-06-22 12:51:15 UTC
rtw880: failed to write rsvd page data
rtw880: failed to write data to rsvd page
rtw880: failed to download rsvd page
rtw880: failed to download firmware
lkpi_ic_vap_create: failed to start hw: -16
Comment 4 Bjoern A. Zeeb freebsd_committer freebsd_triage 2023-07-07 00:39:48 UTC
Do you have the pciconf -l information for the wireless card so we know which chipset it is?
Comment 5 Maurício Nunes 2023-07-11 00:48:19 UTC
Created attachment 243334 [details]
pciconf

pciconf -l executed
Comment 6 Bjoern A. Zeeb freebsd_committer freebsd_triage 2023-07-11 01:21:46 UTC
(In reply to Maurício Nunes from comment #5)

Okay, so it's a RTL8821CE.

Just asking, do you have the loader.conf tunable set to the following?
compat.linuxkpi.skb.mem_limit=1
Comment 7 Maurício Nunes 2023-07-12 12:53:28 UTC
In fact, I didn't even touch the loader.conf because the error occurred during the installation. With that I install without network, adjust the loader.conf and then try to install the wi-fi?
Comment 8 Bjoern A. Zeeb freebsd_committer freebsd_triage 2023-07-12 20:18:32 UTC
(In reply to Maurício Nunes from comment #7)

Oh, nice flaw.  I should ensure that the installer does the right thing when I do more of that hopefully later this month.

You can also stop the loader when booting to the installer, manually type in

set compat.linuxkpi.skb.mem_limit=1
boot -v

and see if that helps.  Otherwise, yes, install without wifi, boot, set it in loader, configure wifi, reboot and see what happens then.
Comment 9 Maurício Nunes 2023-07-14 12:52:04 UTC
Let's go to the report:

I made 2 attempts, the first one changing the installation boot.
This recognized the card, all right, but when scanning the networks, it did not show any.

The 2nd attempt: I continued the installation without a network, and when logging into freebsd, I changed the loader.conf and restarted again.

I changed /etc/rc.conf
wlans_rtw880="YES"
ifconfig_wlan0="WPA SYNCDHCP"

I ran the:
service netif restart

wlan0 correctly appeared with my card data.
after configuring wpa_supplicant and starting netif, wlan0 disappeared and only came back after restarting the PC

After that I restarted several times and wlan0 already appears UP and with the IP of my network.

and the ifconfig wlan0 scan worked correctly
Comment 10 Maurício Nunes 2023-07-14 12:54:52 UTC
Created attachment 243386 [details]
ifconfig
Comment 11 Maurício Nunes 2023-07-14 12:55:07 UTC
Created attachment 243387 [details]
scan
Comment 12 Anton Shepelev 2024-07-06 15:46:42 UTC
I have exactly the same problem with:

  Machine: HP laptop, model 15-bw0xx
  FreeBSD: 14.1 stable
  Device : RTL8723DE 802.11b/g/n PCIe Adapter
  Driver : rtw880

After setting:

  compat.linuxkpi.skb.mem_limit=1

in /boot/loader.conf and rebooting, the problem disappeared.
Shall I file submit this bug for 14.1 as well?
Comment 13 Bjoern A. Zeeb freebsd_committer freebsd_triage 2024-07-06 16:14:50 UTC
(In reply to Anton Shepelev from comment #12)

I think there'll be (hopefully) no need for that.  Knowingly I try to keep the versions of FreeBSD the same.

rtw88 and the installer and the tunable and the firmware together are a known problem currently;  I hope the tunable will soon go away entirely and sort that part of the problem.
Comment 14 Graham Perrin 2024-11-24 17:13:43 UTC
Reproducible with yesterday's 14.2-RC1?
Comment 15 Anton Shepelev 2024-11-24 20:44:27 UTC
(In reply to Graham Perrin from comment #14)

Will let you know when I manage to upgrade my system.
Comment 16 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-01-28 23:41:01 UTC
(In reply to Anton Shepelev from comment #15)

Did you do your upgrade and did the problem still show?
Comment 17 Anton Shepelev 2025-01-29 09:20:43 UTC
(In reply to Bjoern A. Zeeb from comment #16)

No, I have not upgraded yet.
Comment 18 commit-hook freebsd_committer freebsd_triage 2025-11-10 19:55:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b568711f8ef1afd7c86ea2d8bd2f94f399f54dc1

commit b568711f8ef1afd7c86ea2d8bd2f94f399f54dc1
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-11-10 19:41:08 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-11-10 19:41:08 +0000

    LinuxKPI: 802.11: clear CONF_IDLE earlier

    When starting to scan and ending a scan we clear/set the hardware to
    idle.  Similarly we set the hw to idle when we remove the channel
    context but when starting we only set it to non-idle when we went from
    assoc to run.  This apparently was not a problem most of the time
    as the switch from a failed hardware scan to a software scan was
    racing against net80211.  ad4ddc83ebf8 fixed that specifically for
    rtw88 and while we were more consistently scanning, this broke
    authentication as the setting of idle at the end of the scan was
    now happening reliably.  Move the unsetting of idle from assoc_to_run
    to scan_to_auth for when we  create the chanctx to keep it
    symmetrical.  This makes authentication work again for rtw88.

    This likely also fixes the problems in the listed PRs.

    iwlwifi(4) mvm and mld driver parts do not use this information at
    all and were never affected.

    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Reported by:    Oleg Nauman (oleg.nauman gmail.com)
    PR:             290850, 288186, 281979
    PR:             272145 (the non skb-mem-limit parts)

 sys/compat/linuxkpi/common/src/linux_80211.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Comment 19 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-11-10 20:02:29 UTC
I am closing this now.

It seems the SKB memory limit as set by the firmware package along with the malloc fixes which happened along with the very latest fix for IDLE should cover all issues reported here.

If you still have problems on a modern FreeBSD (main or 15.0-R) or stable/14 | 14.4-R (once out next year) or later please re-open.
Comment 20 Anton Shepelev 2025-11-10 21:26:11 UTC
Many thanks for closing the issue, folks!
(If thank-you posts are allowed here)
Comment 21 commit-hook freebsd_committer freebsd_triage 2025-11-12 15:42:52 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a77abd53e83c4357ad8a8006a6e89759e65e3a5b

commit a77abd53e83c4357ad8a8006a6e89759e65e3a5b
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-11-10 19:41:08 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-11-12 15:41:24 +0000

    LinuxKPI: 802.11: clear CONF_IDLE earlier

    When starting to scan and ending a scan we clear/set the hardware to
    idle.  Similarly we set the hw to idle when we remove the channel
    context but when starting we only set it to non-idle when we went from
    assoc to run.  This apparently was not a problem most of the time
    as the switch from a failed hardware scan to a software scan was
    racing against net80211.  ad4ddc83ebf8 fixed that specifically for
    rtw88 and while we were more consistently scanning, this broke
    authentication as the setting of idle at the end of the scan was
    now happening reliably.  Move the unsetting of idle from assoc_to_run
    to scan_to_auth for when we  create the chanctx to keep it
    symmetrical.  This makes authentication work again for rtw88 (though
    not for everyone due to other possible problems with net80211).

    This likely also fixes the problems in the listed PRs.

    iwlwifi(4) mvm and mld driver parts do not use this information at
    all and were never affected.

    Sponsored by:   The FreeBSD Foundation
    PR:             290850, 288186, 281979
    PR:             272145 (the non skb-mem-limit parts)

    (cherry picked from commit b568711f8ef1afd7c86ea2d8bd2f94f399f54dc1)

 sys/compat/linuxkpi/common/src/linux_80211.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Comment 22 commit-hook freebsd_committer freebsd_triage 2025-11-12 18:47:37 UTC
A commit in branch releng/15.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f490eae83f7f90de8be5d1dea593227dbfb98f36

commit f490eae83f7f90de8be5d1dea593227dbfb98f36
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-11-10 19:41:08 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-11-12 18:46:14 +0000

    LinuxKPI: 802.11: clear CONF_IDLE earlier

    When starting to scan and ending a scan we clear/set the hardware to
    idle.  Similarly we set the hw to idle when we remove the channel
    context but when starting we only set it to non-idle when we went from
    assoc to run.  This apparently was not a problem most of the time
    as the switch from a failed hardware scan to a software scan was
    racing against net80211.  ad4ddc83ebf8 fixed that specifically for
    rtw88 and while we were more consistently scanning, this broke
    authentication as the setting of idle at the end of the scan was
    now happening reliably.  Move the unsetting of idle from assoc_to_run
    to scan_to_auth for when we  create the chanctx to keep it
    symmetrical.  This makes authentication work again for rtw88 (though
    not for everyone due to other possible problems with net80211).

    This likely also fixes the problems in the listed PRs.

    iwlwifi(4) mvm and mld driver parts do not use this information at
    all and were never affected.

    Approved by:    re (cperciva)
    Sponsored by:   The FreeBSD Foundation
    PR:             290850, 288186, 281979
    PR:             272145 (the non skb-mem-limit parts)

    (cherry picked from commit b568711f8ef1afd7c86ea2d8bd2f94f399f54dc1)
    (cherry picked from commit a77abd53e83c4357ad8a8006a6e89759e65e3a5b)

 sys/compat/linuxkpi/common/src/linux_80211.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)