r/linuxhardware • u/root-please • 7m ago
Guide I spent weeks investigating and fixing Realtek RTL8723DE Wi-Fi and Bluetooth problems on Linux
I've been working on fixing recurring Wi-Fi and Bluetooth problems with the Realtek RTL8723DE combo adapter (10ec:d723 Wi-Fi / 0bda:b009 Bluetooth).
This adapter has been particularly frustrating on Linux. The problems I investigated included:
Wi-Fi and Bluetooth becoming unavailable after a warm reboot.
Bluetooth USB initialization failures (-71).
Wi-Fi failing to initialize with -16 errors.
Wi-Fi degradation and potential coexistence-related problems.
Rather than relying on random workarounds, I decided to investigate what was actually happening inside the Linux kernel drivers.
I eventually developed two separate projects.
1. Driver-level patch (main project)
https://github.com/sudo-WearTherinG/linux-rtl8723de-driver-patch
This is the main project. It addresses driver shutdown and power-state handling rather than relying on userspace scripts.
The investigation went beyond ordinary troubleshooting. I traced execution paths through the Linux kernel's rtw88 Wi-Fi and btusb Bluetooth drivers, examined their shutdown and initialization sequences, and tracked how power-state transitions affect the shared hardware.
Some of the areas I investigated:
Code-path analysis: Tracing driver execution flow during initialization, shutdown, and reboot.
PCIe power management: Investigating Wi-Fi adapter power-state transitions, including PCI_D3hot.
USB runtime autosuspend: Examining Bluetooth USB power-management behavior.
Firmware and MAC state: Investigating whether the Wi-Fi MAC and firmware were properly shut down before reboot.
Bluetooth coexistence: Examining how Wi-Fi and Bluetooth coordinate through the shared hardware.
Register-level debugging: Investigating hardware register behavior, including REG_APS_FSMCO and initialization timeouts.
Reproducibility testing: Testing different Wi-Fi and Bluetooth power-state combinations across repeated reboot cycles.
I performed 200+ reboot tests on my HP 15-da0xxx laptop running Omarchy Linux.
The driver-level changes resolved the reboot-related failures in my testing.
Upstream kernel submission
I also submitted a Wi-Fi shutdown patch to the Linux kernel mailing list.
The patch received review feedback from Ping-Ke Shih, the rtw88 maintainer. He suggested using the existing rtw_enter_ips() function instead of manually handling the Wi-Fi power-off sequence.
I tested that approach, revised the patch accordingly, and submitted a v2:
[PATCH v2] wifi: rtw88: pci: Enter IPS before PCI_D3hot on shutdown
The revised patch is awaiting further upstream review. It has not yet been reviewed yet due to their work holiday.
2. Warm-reboot workaround
https://github.com/sudo-WearTherinG/rtl8723de_warm_reboot_fix
This was my first solution, before I identified the underlying driver-level problem.
It uses a systemd service to unload the Bluetooth and Wi-Fi modules before shutdown or reboot.
It is intended for users experiencing reboot-related problems who want a workaround without modifying or rebuilding kernel drivers.
Testing limitations
I only have one laptop with this particular adapter, so I cannot claim that the patches work across every RTL8723DE implementation or laptop.
The testing was extensive on my hardware, but broader testing from other users would be valuable.
Both repositories contain the investigation, patches, testing details, and instructions. The main repository also includes HTML documentation explaining the technical findings.
I'm sharing this because I suspect other Linux users have been dealing with these problems for years without knowing what causes them.
If you own an RTL8723DE-based laptop and have experienced similar issues, I'd be interested in hearing about your experience.
In total I found 4 ways to make this card behave.