4

I have a Dell Latitude 7390 2-in-1 touchscreen laptop. I have installed PopOS 22.04 on it (based on Ubuntu 22.04 but with a higher kernel: 5.19.0). Now, whenever I put the laptop on suspend (say if I close the lid), then it randomly comes out of the suspend state and keeps consuming power.

To tackle this, I tried disabling all the wakeup devices (except the power button), using this:

for x in $(grep enabled /proc/acpi/wakeup | cut -f1 | grep -v PBTN)
do
  echo $x | sudo tee /proc/acpi/wakeup
done

However, it has no effect. The laptop still comes out of the sleep/suspend state using a keyboard or by opening the lid. I want to enforce that it comes out of the sleep state ONLY using the power button.

UPDATE: Even when disabling all wakeup devices, it wakes up!

Even when I disable every wakeup device in /proc/acpi/wakeup, the laptop still wakes up by pressing the keyboard key (even though it doesn't wake up when I open the lid or press the power button).

UPDATE: How to disable the accelerometer?

I noticed that if I shake the laptop, then also it wakes up! That is what's been happening a lot when I put it inside my backpack. This must be happening because of accelerometer wake-up. So, if I disable the accelerometer itself, then this problem should go away.

So, I pose an alternative question: How do I disable the accelerometer?

I should be able to unload the kernel modules for the relevant sensors using modprobe -r module_name, however I am stuck in a Catch-22 situation. They each seem to have a dependency on each other, and some have unlisted dependencies. Here are a list of important sensors:

$ lsmod | grep sensor

Module                  Size  Used by
hid_sensor_accel_3d    20480  1
hid_sensor_gyro_3d     20480  0
hid_sensor_magn_3d     20480  1
hid_sensor_custom_intel_hinge    16384  0
hid_sensor_rotation    20480  0
hid_sensor_incl_3d     20480  0
hid_sensor_trigger     20480  12 hid_sensor_gyro_3d,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation
industrialio_triggered_buffer    16384  1 hid_sensor_trigger
hid_sensor_iio_common    24576  7 hid_sensor_gyro_3d,hid_sensor_trigger,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation
industrialio          102400  11 industrialio_triggered_buffer,hid_sensor_gyro_3d,hid_sensor_trigger,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,kfifo_buf,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation
hid_sensor_custom      28672  0
hid_sensor_hub         28672  9 hid_sensor_gyro_3d,hid_sensor_trigger,hid_sensor_iio_common,hid_sensor_custom_intel_hinge,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_rotation,hid_sensor_custom
hid                   155648  7 i2c_hid,wacom,usbhid,hid_multitouch,hid_sensor_hub,intel_ishtp_hid,hid_generic

Some of the sensors have listed a number in the "Used By" column (but not specifically which module is using them). Hence, unloading them fails. One such sensor is hid_sensor_accel_3d which I wish to unload. But can't do it!

5
  • You wrote "…but with a kernel >=5.19.0". Do you mean this was not a problem under lower kernel versions ?
    – MC68020
    Commented Oct 9, 2022 at 13:34
  • No, this is a problem in both Ubuntu 22.04 (which uses kernel 5.15.0) and PopOS 22.04 (which uses kernel 5.19.0). I used "but" because PopOS essentially is based on Ubuntu and follows its release cycle, except the fact that they use more updated kernel versions.
    – shivams
    Commented Oct 10, 2022 at 2:18
  • If you disable waking up in BIOS? What happens?
    – tukan
    Commented Oct 11, 2022 at 8:15
  • @tukan : In BIOS, there was some USB-C wakeup. I disabled that and still no effect. All other wake-ups were disabled already (like WLAN wakeup).
    – shivams
    Commented Oct 11, 2022 at 19:03
  • I see. That depends how good the BIOS. You should have option to disable the accel module. To see what module is dependent modinfo -F depends hid_sensor_accel_3d
    – tukan
    Commented Oct 12, 2022 at 6:50

1 Answer 1

2
+150

The question now stands on "how to disable a kernel module" I'll answer it:

  • You will write into file - /etc/modprobe.d/blacklist.conf

First option:

  • type on separate line blacklist hid_sensor_accel_3d

Second option:

If the blacklisted module still remains after the reboot then you need to do a "fake" install of the module. You can check it with lsmod.

  • type on separate line install hid_sensor_accel_3d /bin/true

Next for both options do:

  • regenerate initramfs - update-initramfs -u
  • reboot
4
  • Thank you. I was successfully able to blacklist the kernel modules. However, the issue still remains. The laptop still wakes up if I shake it. Maybe I need to disable some more modules. I will continue my investigation. Meanwhile, I will award the bounty to this answer if I do not receive a better answer (which completely resolves the issue).
    – shivams
    Commented Oct 14, 2022 at 19:27
  • @shivams are you sure it is due to shaking? Does it start when you shake it in hands?
    – tukan
    Commented Oct 16, 2022 at 14:58
  • Yes, it wakes up when I shake it in hands, or when I put it inside my backpack. But it may be because of change in the orientation. Not sure what is waking it up. I am just randomly trying to disable the kernel modules now, and see what works.
    – shivams
    Commented Oct 16, 2022 at 23:02
  • @shivams weird, I would check for any lose contac or ask how to disable such functionality directly the manufacturer.
    – tukan
    Commented Oct 17, 2022 at 8:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .