Blade 15 mid-2021 (RZ09-0409) trackpad not working on resume

Discussion in 'The Linux Corner' started by awesomeImperialBlue706, Sep 12, 2021.

  1. Hey there

    Using ubuntu 21.04 on a Razer Blade 15 Mid-2021 (Intel 11th Gen, RTX3070, qHD display), the system goes to sleep and out of sleep just fine.

    However, after getting out of sleep, the trackpad goes funky and is completely unusable. The kernel log spams the following message:
    Sep 12 08:57:09 mana kernel: [ 571.107703] i2c_hid i2c-ELAN0406:00: i2c_hid_get_input: incomplete report (14/65535)
    Sep 12 08:57:09 mana kernel: [ 571.108429] i2c_hid i2c-ELAN0406:00: i2c_hid_get_input: incomplete report (14/65535)
    Sep 12 08:57:09 mana kernel: [ 571.109164] i2c_hid i2c-ELAN0406:00: i2c_hid_get_input: incomplete report (14/65535)
    Sep 12 08:57:09 mana kernel: [ 571.109889] i2c_hid i2c-ELAN0406:00: i2c_hid_get_input: incomplete report (14/65535)
    Sep 12 08:57:09 mana kernel: [ 571.110613] i2c_hid i2c-ELAN0406:00: i2c_hid_get_input: incomplete report (14/65535)
    Sep 12 08:57:09 mana kernel: [ 571.111337] i2c_hid i2c-ELAN0406:00: i2c_hid_get_input: incomplete report (14/65535)

    This has already been reported on other systems, and vendors updated the BIOS to disable the trackpad completely when the system goes to sleep, and reset it when the system wakes up.
    Is this something we can expect in a future BIOS update? Or any workaround? I tried multiple things such as resetting the i2c bus, to no avail. The only solution is a complete reboot.
     
  2. Pegoku

    Pegoku New Member

  3. Thanks, I was reluctant to post there since most comments were like "this is a vendor-side fix to make", but did anyway.
     
  4. Fezed12

    Fezed12 New Member

    I have been having the same problem with the same device. Can razer please check this. I can’t use Linux after sleeping I have to restart to get the trackpad working again
     
  5. Korvenwin-old

    Korvenwin-old New Member

    Does the problem occur on Linux Arch (ie Manjaro) too?
     
  6. Yes, this happened on all Linux distros I tried (Ubuntu, Arch, Mint, PopOS), and is still happening as of today.
     
  7. SPARTAROCKY59

    SPARTAROCKY59 New Member

    still not working with ubuntu 20.04.3 and kernel 5.11.0-46-generic
     
  8. dani7959

    dani7959 New Member

    Unfortunatelly Razer cut a lot of corners in terms of hardware, with things that do not show that much in spec sheets and reviews. Power management especially, at least in my 2017 model, is a complete mess.
    ASPM is not supported due to the crappy wifi card. Wifi powersave not working. I also had similar trackpad issues, the cause in my case being the usb autosuspend implementation for the trackpad, or rather the lack of it.

    No wonder there is no official linux support. The hardware is not complying to industry standards so YOU have to make it work, no distro will run out of the box without issues.

    One thing you can do is type `powercfg -energy` at the command prompt in Windows (I would appreciate if you could share the generated energy report). Any errors that show up there, you should most likely address in linux. For instance if ASPM shows up as disabled due to incompatible hardware, for sure you need to add pcie_aspm=off to your kernel parameters in grub.

    As for the trackpad, if indeed the usb autosuspend is the cause, the most elegant solution is to identify the Vid/Pid for your device and create an udev rule to disable autosuspend at boot for that specific device.

    A one time command to do that in ubuntu should be something like:
    $ echo 'SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="vvvv", ATTRS{idProduct}=="pppp", TEST=="power/autosuspend", ATTR{power/autosuspend}:="-1"' | sudo tee /etc/udev/rules.d/10-razer-blade-pm.rules
    replacing vvvv and pppp accordingly.

    Hope this cand give you some direction.
     
    Fezed12 likes this.
  9. Fezed12

    Fezed12 New Member

    Hi Dani,

    Thank you for your reply, I have the razer razer blade 15 2021 version with the same trackpad issue as OP. I ran powercfg -energy command and here is the result.

    Contents:
    Power Efficiency Diagnostics Report
    Scan Time 2022-03-15T03:26:19Z
    Scan Duration 60 seconds
    System Manufacturer Razer
    System Product Name Blade 15 Advanced Model (Mid 2021) - RZ09-0409
    BIOS Date 08/06/2021
    BIOS Version 1.10
    OS Build 22000
    Platform Role PlatformRoleMobile
    Plugged In false
    Process Count 369
    Thread Count 8280
    Report GUID {3d22d6d4-80d9-48cc-9ba4-7eee1e6a7736}
    Analysis Results
    Errors
    Power Policy:Display timeout disabled (On Battery)
    The display is not configured to turn off after a period of inactivity.
    Power Policy:Sleep timeout is disabled (On Battery)
    The computer is not configured to automatically sleep after a period of inactivity.
    Power Policy:Display timeout disabled (Plugged In)
    The display is not configured to turn off after a period of inactivity.
    Power Policy:Sleep timeout is disabled (Plugged In)
    The computer is not configured to automatically sleep after a period of inactivity.
    System Availability Requests:System Required Request
    The program has made a request to prevent the system from automatically entering sleep.
    Requesting Process \Device\HarddiskVolume3\Windows\System32\mstsc.exe
    System Availability Requests:Display Required Request
    The program has made a request to prevent the display from automatically entering a low-power mode.
    Requesting Process \Device\HarddiskVolume3\Windows\System32\mstsc.exe
    USB Suspend:USB Device not Entering Selective Suspend
    This device did not enter the USB Selective Suspend state. Processor power management may be prevented when this USB device is not in the Selective Suspend state. Note that this issue will not prevent the system from sleeping.
    Device Name USB Composite Device
    Host Controller ID PCI\VEN_8086&DEV_43ED
    Host Controller Location PCI bus 0, device 20, function 0
    Device ID USB\VID_1532&PID_0276
    Port Path 7
    CPU Utilization:stuck_out_tongue_winking_eye:rocessor utilization is high
    The average processor utilization during the trace was high. The system will consume less power when the average processor utilization is very low. Review processor utilization for individual processes to determine which applications and services contribute the most to total processor utilization.
    Average Utilization (%) 26.21
     
    Last edited: Mar 14, 2022
  10. Fezed12

    Fezed12 New Member

    Device id in that error matches with the trackpad ID in device manager
     

    Attached Files:

  11. Fezed12

    Fezed12 New Member

    I tried running the following command in pop os 20.10

    echo 'SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="1532", ATTRS{idProduct}=="0276", TEST=="power/autosuspend", ATTR{power/autosuspend}:="-1"' | sudo tee /etc/udev/rules.d/10-razer-blade-pm.rules

    It stopped the i2c_hid i2c flood messages but upon resume trackpad was very laggy and unable and laptop would randomly sleep. Any idea what I should try doing
     
  12. dani7959

    dani7959 New Member

    Well, since that didn't solve the problem, first cleanup and delete the file that you created: /etc/udev/rules.d/10-razer-blade-pm.rules

    Next thing to try:
    $ sudo -H gedit /etc/default/grub
    backup or at least take a picture before editing
    append "usbcore.autosuspend=-1 button.lid_init_state=open" to GRUB_CMDLINE_LINUX_DEFAULT; it should look something like:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1 button.lid_init_state=open"
    first parameter will disable autosuspend for all usb devices; second my help with the random suspend; if there are more parameters, leave them there
    then do
    $ sudo update-grub
    $ sudo reboot

    Let us know what happens.
    If it's not working, make sure you do again all the steps when reverting.
     
    Last edited: Mar 15, 2022
  13. Hello,

    I recently bought a razer blade 15 late 2021, and I have the same issue. I tried the fixes pointed out by @dani7959
    updating the grub command line did not solve the issue.

    the mouse does not stop working completely, the clicks still work and the mouse moves, but it movement is slow/choppy and unusable.

    Edit:

    I also tried this fix by removing the driver and adding it again. For some people it worked just fine, but for me it had no result.

    By the way, I am running Debian11 with the 5.16 kernel installed via backports.
     
    Last edited: Apr 15, 2022
  14. Ginosius

    Ginosius New Member

    Same here with my blade advance 2021 model.
    Non of the fixes worked and the mouse movement is very choppy after resume from standby.
    This doesn't happen on Windows.
     
  15. RocketdyneF1

    RocketdyneF1 New Member

  16. Ginosius

    Ginosius New Member

    Thanks for this!

    I just noticed there's a bios update available, version 2.02 :
    https://mysupport.razer.com/app/answers/detail/a_id/5589/kw/RZ09-0409
    Apparently it was released on the 5th of January, but they only updated the page on 14th of April.. 3 months later.
    It only mentions a fix for Wifi 6E though.

    I'm running Fedora 36 with:
    - kernel: 5.17.4-300.fc36.x86_64
    - NVIDIA driver: 510.60.02
    - Mesa from git: https://copr.fedorainfracloud.org/coprs/xxmitsu/mesa-git/
    - Gnome: 42.0 (on Xorg because NVIDIA doesn't properly support multi-monitor setups on GBM, see: https://gitlab.gnome.org/GNOME/mutter/-/issues/2166 a workaround was submitted and will hopefully land in 42.1)

    I've added the "button.lid_init_state=open" argument:
    Code:
    button.lid_init_state=open rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1
    My /etc/modprobe.d/nvidia-power-management.conf:
    Code:
    options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_DynamicPowerManagement=0x02
    I don't have any issues with swapped audio channels or the microphone, but Fedora uses pipewire and a very recent release of opensound firmware:
    - pipewire-0.3.50-1.fc36.x86_64
    - alsa-sof-firmware-2.0-3.fc36.noarch

    If I understand correctly you've switched to s2idle by doing:
    Code:
    "echo RP05 | sudo tee /proc/acpi/wakeup"
    And then add the following two parameters to my nvidia driver?
    Code:
    NVreg_EnableS0ixPowerManagement=1 NVreg_S0ixPowerManagementVideoMemoryThreshold=10000
     
  17. Ginosius

    Ginosius New Member

    I've tried your systemd service which seems to run without errors:
    Code:
    apr 25 12:43:51 razerblade15 systemd[1]: Starting acpi-wake-andy.service - ACPI Wake Service...
    apr 25 12:43:51 razerblade15 sh[85155]: RP05
    apr 25 12:43:51 razerblade15 systemd[1]: acpi-wake-andy.service: Deactivated successfully.
    apr 25 12:43:51 razerblade15 systemd[1]: Finished acpi-wake-andy.service - ACPI Wake Service.
    Furthermore I've updated my nvidia parameters to look like:
    Code:
    options nvidia NVreg_EnableS0ixPowerManagement=1 NVreg_S0ixPowerManagementVideoMemoryThreshold=10000 NVreg_TemporaryFilePath=/var/tmp
    And last but not least I've updated the bios to version 2.02.

    But the trackpad is still laggy and jumpy after resume from suspend.
    Any ideas?

    Here's some information regarding my system:
    Code:
    (after your systemd service has ran)
    # cat /proc/acpi/wakeup
    Device   S-state     Status   Sysfs node
    PEG1     S4   *enabled   pci:0000:00:01.0
    PEGP     S4   *disabled  pci:0000:01:00.0
    PEG2     S4   *enabled   pci:0000:00:01.1
    PEGP     S4   *disabled  pci:0000:02:00.0
    PEG3     S4   *disabled
    PEGP     S4   *disabled
    PEG0     S4   *enabled   pci:0000:00:06.0
    PEGP     S4   *disabled  pci:0000:03:00.0
    RP01     S4   *disabled
    PXSX     S4   *disabled
    RP02     S4   *disabled
    PXSX     S4   *disabled
    RP03     S4   *disabled
    PXSX     S4   *disabled
    RP04     S4   *disabled
    PXSX     S4   *disabled
    RP05     S4   *disabled
    PXSX     S4   *disabled
    RP06     S4   *disabled
    PXSX     S4   *disabled
    RP07     S4   *disabled
    PXSX     S4   *disabled
    RP08     S4   *disabled
    PXSX     S4   *disabled
    RP09     S4   *disabled
    PXSX     S4   *disabled
    RP10     S4   *disabled
    PXSX     S4   *disabled
    RP11     S4   *disabled
    PXSX     S4   *disabled
    RP12     S4   *disabled
    PXSX     S4   *disabled
    RP13     S4   *disabled
    PXSX     S4   *disabled
    RP14     S4   *disabled
    PXSX     S4   *disabled
    RP15     S4   *disabled
    PXSX     S4   *disabled
    RP16     S4   *disabled
    PXSX     S4   *disabled
    RP17     S4   *enabled   pci:0000:00:1b.0
    PXSX     S4   *disabled
    RP18     S4   *disabled
    PXSX     S4   *disabled
    RP19     S4   *enabled   pci:0000:00:1b.2
    PXSX     S4   *disabled  pci:0000:5b:00.0
           *disabled  platform:rtsx_pci_sdmmc.0
    RP20     S4   *enabled   pci:0000:00:1b.3
    PXSX     S4   *disabled  pci:0000:5c:00.0
    RP21     S4   *disabled
    PXSX     S4   *disabled
    RP22     S4   *disabled
    PXSX     S4   *disabled
    RP23     S4   *disabled
    PXSX     S4   *disabled
    RP24     S4   *disabled
    PXSX     S4   *disabled
    XHCI     S3   *enabled   pci:0000:00:14.0
    XDCI     S4   *disabled
    HDAS     S4   *disabled  pci:0000:00:1f.3
    CNVW     S4   *disabled
    TXHC     S4   *enabled   pci:0000:00:0d.0
    TDM0     S4   *enabled   pci:0000:00:0d.2
    TDM1     S4   *enabled   pci:0000:00:0d.3
    TRP0     S4   *enabled   pci:0000:00:07.0
    PXSX     S3   *disabled
    TRP1     S4   *disabled
    PXSX     S3   *disabled
    TRP2     S4   *enabled   pci:0000:00:07.2
    PXSX     S3   *disabled
    TRP3     S4   *disabled
    PXSX     S3   *disabled
    AWAC     S4   *enabled   platform:ACPI000E:00
    
    # cat /sys/power/state
    freeze mem
    
    # cat /sys/power/mem_sleep
    s2idle [deep]
     
  18. RocketdyneF1

    RocketdyneF1 New Member

    Sorry, that script disables a wakeup device, which was causing my machine (2022 version) to wake immediately from suspend. If you want to switch to s2idle from S3, you need to do something different.

    Note that I'm running slightly different hardware (2022 with Alder Lake), so I'm not exactly sure what you will have.

    You can check your settings here:

    $ cat /sys/power/mem_sleep
    [s2idle] deep


    As you can see, on my system both s2idle and "deep" aka S3 are supported. The brackets around s2idle indicate that is configured as my default.

    More info: https://www.kernel.org/doc/Documentation/power/states.txt

    You can test s2idle immediately by doing:

    # echo "freeze" > /sys/power/state

    If that works and you want to set it as the default, you can set the kernel parameter mem_sleep_default=s2idle in your grub config.

    https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html
     
  19. Ginosius

    Ginosius New Member

    Ah I get it, s2idle was already the default in Fedora for me.
    When issue: echo "freeze" > /sys/power/state it will suspend and indeed the trackpad works great on resume :)

    It only seems that when Gnome (or systemd?) puts it into sleep mode, it'll go into a deeper state, which causes the trackpad to become jumpy again.

    So I have to figure out how to change the default sleep to s2idle instead.

    EDIT: mem_sleep_default=s2idle seems to do the trick.
    It works now.

    Let's hope Razer will eventually push a proper bios update to solve it so we can enjoy deeper power states.
     
    Last edited: Apr 25, 2022
  20. RocketdyneF1

    RocketdyneF1 New Member

Sign In with Razer ID >


Don't have a Razer ID yet?
Get Razer ID >