Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#973733: RTW88_8821ce module fails to find firmware during install and must be reloaded

340 views
Skip to first unread message

Brandon Werner

unread,
Nov 3, 2020, 11:00:03 PM11/3/20
to
package: src:linux

Hi,
I downloaded one of the firmware netinstall builds of Debian from today (11/03/2020) to try installing on my netbook with the 8821ce wifi card since Debian now has the 5.9 kernel. During the text install with speech, I received an error that the network card could not be found. I opened a console and looking at dmesg showed the driver not finding the firmware with a -2 error, however, I noticed that the requested files had been unpacked to /lib/firmware. I unloaded rtw88_8821ce and reloaded it using modprobe and the firmware was found, after which the network interface was successfully brought up. I was able to continue through the rest of the install without issue. I am not sure what logs would help but would be happy to provide anything requested to diagnose this issue.

Brandon Werner

unread,
Nov 4, 2020, 1:20:02 AM11/4/20
to


On Tue, Nov 3, 2020, at 10:52 PM, Brandon Werner wrote:
> package: src:linux
>
> Hi,
> I downloaded one of the firmware netinstall builds of Debian from today
> (11/03/2020) to try installing on my netbook with the 8821ce wifi card
> since Debian now has the 5.9 kernel. During the text install with
> speech, I received an error that the network card could not be found. I
> opened a console and looking at dmesg showed the driver not finding the
> firmware with a -2 error, however, I noticed that the requested files
> had been unpacked to /lib/firmware. I unloaded rtw88_8821ce and
> reloaded it using modprobe and the firmware was found, after which the
> network interface was successfully brought up.
I took a look at the installer logs and found something that looks like it could be the likely problem.

Nov 3 22:09:17 check-missing-firmware: removing and loading kernel module rtw_8821ce

I think some substitution is going wrong in the installer because it seems like the module should be called rtw88_8821ce.

Brandon Werner

unread,
Nov 4, 2020, 9:30:05 AM11/4/20
to


On Wed, Nov 4, 2020, at 1:13 AM, Brandon Werner wrote:
>
>
> On Tue, Nov 3, 2020, at 10:52 PM, Brandon Werner wrote:
> > package: src:linux
> >
> > Hi,
> > I downloaded one of the firmware netinstall builds of Debian from today
> > (11/03/2020) to try installing on my netbook with the 8821ce wifi card
> > since Debian now has the 5.9 kernel. During the text install with
> > speech, I received an error that the network card could not be found. I
> > opened a console and looking at dmesg showed the driver not finding the
> > firmware with a -2 error, however, I noticed that the requested files
> > had been unpacked to /lib/firmware. I unloaded rtw88_8821ce and
> > reloaded it using modprobe and the firmware was found, after which the
> > network interface was successfully brought up.
> I took a look at the installer logs and found something that looks like
> it could be the likely problem.
>
> Nov 3 22:09:17 check-missing-firmware: removing and loading kernel
> module rtw_8821ce
>
> I think some substitution is going wrong in the installer because it
> seems like the module should be called rtw88_8821ce.
It looks like what is happening is that the driver prints its messages to dmesg with a different name than what the module is actually called. When it prints its messages about missing firmware, it uses rtl_8821ce. The installer matches on that when unloading and loading modules to get the missing firmware, which results in an incorrect module name being used. Is there a list of cases in the installer for this? It needs to use rtw88_8821ce when it unloads and reloads the module.

Ben Hutchings

unread,
Nov 4, 2020, 11:20:04 AM11/4/20
to
Control: reassign -1 hw-detect 1.141

On Wed, 2020-11-04 at 09:19 -0500, Brandon Werner wrote:
>
> On Wed, Nov 4, 2020, at 1:13 AM, Brandon Werner wrote:
> >
> > On Tue, Nov 3, 2020, at 10:52 PM, Brandon Werner wrote:
> > > package: src:linux
> > >
> > > Hi,
> > > I downloaded one of the firmware netinstall builds of Debian from today
> > > (11/03/2020) to try installing on my netbook with the 8821ce wifi card
> > > since Debian now has the 5.9 kernel. During the text install with
> > > speech, I received an error that the network card could not be found. I
> > > opened a console and looking at dmesg showed the driver not finding the
> > > firmware with a -2 error, however, I noticed that the requested files
> > > had been unpacked to /lib/firmware. I unloaded rtw88_8821ce and
> > > reloaded it using modprobe and the firmware was found, after which the
> > > network interface was successfully brought up.
> > I took a look at the installer logs and found something that looks like
> > it could be the likely problem.
> >
> > Nov 3 22:09:17 check-missing-firmware: removing and loading kernel
> > module rtw_8821ce
> >
> > I think some substitution is going wrong in the installer because it
> > seems like the module should be called rtw88_8821ce.
> It looks like what is happening is that the driver prints its
> messages to dmesg with a different name than what the module is
> actually called.

There is no rule in Linux that a driver has to have the same name as
the module that contains it. (In fact, a single module can contain
multiple drivers, in which cae they cannot all use the same name as the
module.)

> When it prints its messages about missing firmware, it uses
> rtl_8821ce. The installer matches on that when unloading and loading
> modules to get the missing firmware, which results in an incorrect
> module name being used. Is there a list of cases in the installer for
> this? It needs to use rtw88_8821ce when it unloads and reloads the
> module.

I don't know this part of the installer. But I think it would be a
mistake to use a mapping table; instead the installer should look at
metadata provided by the kernel. All drivers in a loaded module should
be listed under /sys/module/<module-name>/drivers, and the installer
could use that to map a driver name to its module name.

Ben.

> > > I was able to continue through the rest of the install without issue. I am not sure what logs
> > > would help but would be happy to provide anything requested to diagnose
> > > this issue.
--
Ben Hutchings
If the facts do not conform to your theory, they must be disposed of.


signature.asc

Ben Hutchings

unread,
Nov 5, 2020, 5:20:05 PM11/5/20
to
On Wed, 2020-11-04 at 15:34 +0000, Ben Hutchings wrote:
[...]
> I don't know this part of the installer. But I think it would be a
> mistake to use a mapping table; instead the installer should look at
> metadata provided by the kernel. All drivers in a loaded module should
> be listed under /sys/module/<module-name>/drivers, and the installer
> could use that to map a driver name to its module name.

Alternately:

module="$(basename "$(readlink /sys/bus/*/drivers/$driver/module)")"

Some error-checking would be needed.

Ben.

--
Ben Hutchings
Humans are not rational beings; they are rationalising beings.

signature.asc

Daniel Lewart

unread,
Jun 24, 2021, 9:40:03 AM6/24/21
to
Tags: patch

Debian Installer Team,

On Nov 5, 2020, Ben Hutchings wrote:

> Alternately:
> module="$(basename "$(readlink /sys/bus/*/drivers/$driver/module)")"
> Some error-checking would be needed.

Attached is a patch based on this approach.

Good news:
* removed and loaded rtw88_8821ce
* created wlp4s0 interface
* lists wireless networks

Bad news:
* "Failure of key exchange and association"
* "purge skb(s) not reported by firmware"

Please advise how I can further troubleshoot this.

Thank you!
Daniel Lewart
Urbana, Illinois
check-missing-firmware.patch

Cyril Brulebois

unread,
Jun 24, 2021, 2:50:04 PM6/24/21
to
Hi Daniel,

Daniel Lewart <lew...@gmail.com> (2021-06-24):
Thanks for the prospective patch. I've got a system affected by this
(and have yet to document all my findings), and I seem to remember what
I found out was: unloading two modules instead of one does the trick,
and allows me to connect to my home WPA2 network, and perform the rest
of the install. Maybe, compared to your approach, I did the
unloading/reloading in a different order? Most likely, I manually
“modprobe -r”'d both modules and then loaded the relevant one again.

Feel free to try and verify that manually, and maybe try reloading in
the other order, and/or unload both first, and reload afterwards.

Thanks for your help.


Cheers,
--
Cyril Brulebois (ki...@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
signature.asc

Daniel Lewart

unread,
Jun 25, 2021, 1:10:04 AM6/25/21
to
Cyril, et al,

> Feel free to try and verify that manually, and maybe try reloading in
> the other order, and/or unload both first, and reload afterwards.

Thank you for your advice! Although I did not follow it ...

"modprobe (-r) rtw88_8821ce" (removes) adds the following eight modules:
* cfg80211
* libarc4
* mac80211
* rfkill
* rtw88_8821c
* rtw88_8821ce
* rtw88_core
* rtw88_pci
The only secondary modules I can think of to experiment with would be
Bluetooth-related, but none were loaded in the first place.

Instead, I tried the Bullseye RC 2 release of the installer
(with firmware) three more times, all successfully:
firmware-bullseye-DI-rc2-amd64-netinst.iso

What was different about the failed first effort?
* It took me more than three minutes to enter the WPA2 passphrase
* "INFO: buf = wpa_state=INTERFACE_DISABLED" in syslog every 5s

These are possible causes of general RTL8192CE problems,
which I rank from most likely to least likely:
1) RTL8821CE driver quality
2) Active State Power Management (disable_aspm?)
2) Message Signalled Interrupts (disable_msi?)
3) 2.4 vs 5 GHz conflict
4) Bluetooth vs Wireless conflict
5) Phase of the moon

Here are my conclusions:
1) My patch will help in cases where the module name is
different than the driver name (mostly Realtek)
2) The RTL8821CE driver is flaky
3) Network configuration problems are unrelated to hw-detect
and could be addressed in netcfg, perhaps by restarting WPA

I hope some people experiencing the original problem can test my patch.

Daniel Lewart

unread,
Jun 26, 2021, 6:50:03 AM6/26/21
to
Attached is a better patch which:
1) Logs modprobe error messages
2) Only reloads modules that do not have a network
cmf2.patch

Cyril Brulebois

unread,
Jul 26, 2021, 12:40:03 AM7/26/21
to
Hi Daniel,

[ and the submitter, Brandon, back in cc. ]

Daniel Lewart <lew...@gmail.com> (2021-06-25):
> Thank you for your advice! Although I did not follow it ...

:)
I haven't seen many problems here (admittedly with custom built images,
see #989863 for the full story), WPA2 connection is established quite
quickly and I haven't seen anything strange in my syslog. Grepping for
wpa_state in two full installation syslogs, I'm seeing only this, once
in each:

[…] wpa_state=SCANNING […]
[…] wpa_state=COMPLETED […]

> Here are my conclusions:
> 1) My patch will help in cases where the module name is
> different than the driver name (mostly Realtek)
> 2) The RTL8821CE driver is flaky
> 3) Network configuration problems are unrelated to hw-detect
> and could be addressed in netcfg, perhaps by restarting WPA
>
> I hope some people experiencing the original problem can test my patch.

Many thanks for the inspiration, it helped a lot! (I must confess my
first idea was to just hardcode reloading a different module if that
particular one was seen.)

I've kept reloading the module determined initially, even if it could
probably be skipped if the actual module name is different: it's likely
to generate two modprobe errors (once for unloading, once for loading)
but oh well… I could also have good for the `modprobe -q` option but
better keep all logs, just in case something strange happens…

You can check the code here:
https://salsa.debian.org/installer-team/hw-detect/-/blob/master/check-missing-firmware.sh#L290-303

(A variation would be to move the first modprobe dance below the loop,
and its execution depend on whether actual_module was ever set.)


The relevant part of syslog with that patch in place:

Jul 26 03:09:20 check-missing-firmware: looking for firmware file rtw88/rtw8821c_fw.bin requested by rtw_8821ce
Jul 26 03:09:20 check-missing-firmware: missing firmware files (rtw88/rtw8821c_fw.bin) for rtw_8821ce
Jul 26 03:09:26 check-missing-firmware: installing firmware package /firmware/firmware-realtek_20210315-2_all.deb
Jul 26 03:09:31 check-missing-firmware: removing and loading kernel module rtw_8821ce
Jul 26 03:09:31 check-missing-firmware: modprobe: FATAL: Module rtw_8821ce not found.
Jul 26 03:09:31 check-missing-firmware: modprobe: FATAL: Module rtw_8821ce not found in directory /lib/modules/5.10.0-8-amd64
Jul 26 03:09:31 check-missing-firmware: removing and loading kernel module rtw88_8821ce as well (actual module for rtw_8821ce)


This should land in D-I Bullseye RC 3, in a few days.
signature.asc
0 new messages