Debian 11 suspend problem


     I would like to share my experience of having a suspend problem after installing the new Debian 11 on my laptop (HP Envy x360 15 Ryzen 7 5700U). I am a software developer mainly focusing on mobile app development. I have been using Linux as my main OS for about 2 years. As a newbie, I don't want to mess with much instability in my daily used OS, therefore I used Debian. My previous laptop which has Intel CPU has no major problem with Debian 10 and then 11 on it. However, I started to notice a problem when I tried to install Debian 11 on my new laptop with AMD CPU & AMD integrated GPU.

    Debian 11 comes with Linux kernel 5.10.0-11. After successfully installing Debian on my laptop, I started to notice that it doesn't have a compatible driver for my network adapter pre-installed. Below is my network adapter listed by lspci command :

Network controller: Realtek Semiconductor Co., Ltd. Device 8852

I haven't found any driver included in any debian 11 stable apt sources but finally found a library called rtw89 in GitHub which solved the problem.

    The next thing I noticed is that nearly every time I suspend my laptop, the LED in the power button didn't blink nor turned off. At first, I thought it was only a power button LED error, but then I realize when I tried to wake it up by pressing any key, the screen didn't seem to respond at all. At this time, the keyboard backlight was working just fine. Searched for this problem on the internet and found a thread discussing it. It suggested to add init_on_alloc=0 to GRUB_CMDLINE_LINUX in /etc/default/grub. Unfortunately, it didn't solve the problem. The only workaround for me at that time is just simply to lock the laptop instead of suspending it to preserve more energy.

    After more search, I found several threads stating that it was related to linux kernel. Then, I started to find out about installing another version of kernel which led me to this tutorial. The first version I installed was 5.16.11 which was the latest stable at that time. It seemed to have solved the problem, my laptop could suspend properly and wake up from it properly. But then I realized another problem with this version which was ext-4 file system crash that occurred several times and that the touch screen & touchpad didn't work at all. 

    To solve this problem I tried to install version 5.15.25 which solved the file system crash but didn't solve the touch screen & touchpad problem. Then I tried version 5.10.103 but it was just the same so I uninstalled it. Back using version 5.15.25 I found that it has a major suspend problem indicated by abnormal heat at suspend. It might be because a component didn't suspend correctly. I thought this problem is even bigger than the first one because it can damage my laptop with heat while the fan didn't work at suspend. Desperated to fix the problem, I installed the default version again to work with it while searching for a new solution.

    In the next day, I installed version 5.15.26 after finding a solution to the touch screen & touchpad problem. It stated that the problem was that there is a new kernel configuration key that set I2C HID support by adding CONFIG_I2C_HID_ACPI=y to the .config file before building the kernel. Of course, for every new install, I copied .config file from the default version (5.10.0-11). It fixed the touch screen & touchpad problem but still has the suspend heat problem. Looking at journalctl, I found a line indicates that amdgpu failed to suspend which may be the cause of this problem. After more search about it, I came to a solution to add CONFIG_AMD_PMC=m to the kernel .config file which seemed to solve the problem. After that installation, I found an abnormal heat problem occurred once after several suspend tests (hopefully it could never happen again).

That's all I have done to solve this problem. If you have any questions or better solutions to this problem, let me know by writing them in the comment section below.



Comments