RTL8723DE causes freeze on boot on Linux 6.1

(The original article was written on 2023-02-24 in plain text.)

I have an HP Laptop 14-ck0100ng with an internal Realtek RTL8723DE wifi card.

I've had problems with that card on Ubuntu a few years ago already.

I switched to Arch Linux on 2021-04-24, which had been running fine until 2023-01.

But then, the wifi card casued me some trouble again.

The story

On 2023-01-11, I upgraded the "linux" package from 6.0.12.arch1-1 to 6.1.4.arch1-1 during a system upgrade (pacman -Syu).

After a reboot, the system froze during the login prompt.

I could see the cursor blinking a few times, but then the screen stayed the same and the system didn't react to any input, so I had to switch the power off manually.

(The behavior is much like the one in the following video.)

=> https://www.reddit.com/10d135d/

This persisted over multiple attempts.

I then tried to boot from the Arch ISO from 2023-01-01, but that failed too.

Everything froze after the line

[  OK  ] Reached target Login Prompts.

had appeared.

I then booted successfully from the old Arch ISO from 2021-04-01.

I decrypted and mounted the disk, chrooted into it, and reverted the problematic upgrade.

(All pacman transactions are logged to /var/log/pacman.log, along with all version numbers involved.

You can use this information to downgrade a package by calling "pacman -U" along with the file name of the old version of the package.

Old packages are stored in /var/cache/pacman/pkg/.

With some sed magic, you can easily downgrade all packages of an upgrade at once.)

I could then boot again.

But in order to be able to do system upgrades, I installed the LTS kernel ("linux-lts", which was still at version 5.15) and configured my boot loader to boot from it.

This worked fine until 2023-02-22, when I upgraded the "linux-lts" package from 5.15.94-1 to 6.1.12-1 during a system upgrade, and the login freeze returned.

As a temporary solution, I booted from the Arch ISO from 2021-04-01 once more and reverted the upgrade so that I could boot again.

I then looked for a permanent solution that would let me run system upgrades again.

Apparently, the problem is caused by the kernel module responsible for the RTL8723DE card (as suggested in the following post).

=> https://www.reddit.com/119mj06/

The suggestion is to blacklist the rtw88_8723de kernel module during boot and load it manually after login.

I first configured my boot loader to pass the kernel parameter "module_blacklist=rtw88_8723de", but then I couldn't load the module manually after login.

So instead, I put a *.conf file containing "blacklist rtw88_8723de" into /etc/modprobe.d/.

I could then load the module manually with "sudo modprobe rtw88_8723de", but I could only connect to the internet after I had disabled NetworkManager.service, rebooted, loaded the module, and started NetworkManager.service manually too.

So I placed 2 lines into my ~/.bash_profile (which is executed after login) that would load the kernel module and start NetworkManager.service before "startx" is executed.

I ran a system upgrade and rebooted.

Then the login freeze returned.

Apparently, the problem occurs whenever NetworkManager.service is started before the rtw88_8723de kernel module is fully loaded (which seems to take about 2 seconds, as suggested in the following post), so I put "sleep 3" between the 2 lines in my ~/.bash_profile, and everything worked fine again.

=> https://bbs.archlinux.org/viewtopic.php?pid=2083382#p2083382

I had also tried "sleep 1", which was too short (the freeze set in while "startx" was being executed), and "sleep 2", which worked fine, but I added an extra second to be safe.

The solution in short

I assume that

(a) you have a running system (e.g. by reverting a problematic upgrade as described above),

(b) you use the "networkmanager" package as your network manager,

(c) you also have the RTL8723DE wifi card, and

(d) you start your window manager or desktop environment in ~/.bash_profile (instead of with a display manager).

  1. Disable NetworkManager.service by running "sudo systemctl disable NetworkManager.service".

  1. Blacklist the rtw88_8723de kernel module by placing a file with the ending ".conf" (e.g. "rtw88_8723de.conf") containing the line

blacklist rtw88_8723

into /etc/modprobe.d/.

  1. Place the following lines into your ~/.bash_profile, before the lines that start your window manager or desktop environment:

echo 'Running "sudo modprobe rtw88_8723de"...'
sudo modprobe rtw88_8723de
echo 'Sleeping for 3 seconds...'
sleep 3
echo 'Running "sudo systemctl start NetworkManager.service"...'
sudo systemctl start NetworkManager.service

You are then safe to upgrade again.

EOF

Proxy Information
Original URL
gemini://dkalak.de/tech/rtl8723.gmi
Status Code
Success (20)
Meta
text/gemini; lang=en
Capsule Response Time
123.979719 milliseconds
Gemini-to-HTML Time
0.875898 milliseconds

This content has been proxied by September (ba2dc).