1

I'm LUbuntu 22.04.2 LTS user. When I insert ERGO LTE USB Wi-Fi router WO2-CRC9, the laptop (HP Probook) stays very-very hot independently on the current load, the fan runs continuously, and the battery will discharge during 1...2 h instead of 5 h, even if the Wi-Fi function of the router is switched off.

The systemd-udevd process consumes near to 100% of the processor. The fragment of the "TOP" output is:

PID  КОР.      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND    
**** root      **   0  154488 136432   4664 R  99,7   0,2  70:54.78 systemd-udevd                                                                                                         
**** root      **   0   25060   4840   2272 S  22,3   0,0  15:36.65 systemd-udevd
        ...

The solution from https://unix.stackexchange.com/questions/233247/why-is-systemd-udev-pegging-my-cpu by editing /lib/udev/rules.d/69-libmtp.rules isn't helpful.

udevadm monitor
UDEV  [104.881828] change   /devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb1/1-2/1-2:1.5/host0/target0:0:0/0:0:0:0/block/sr0 (block)
KERNEL[104.890895] change   /devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb1/1-2/1-2:1.5/host0/target0:0:0/0:0:0:0/block/sr0 (block)
KERNEL[104.898884] change   /devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb1/1-2/1-2:1.5/host0/target0:0:0/0:0:0:0/block/sr0 (block)
KERNEL[104.914578] change   /devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb1/1-2/1-2:1.5/host0/target0:0:0/0:0:0:0/block/sr0 (block)
#(infinite loop)

It appears that after disconnecting virtual CD-ROM with Windows drivers, UDEV tries to find it causing infinite loop.

The workaround is using the macro (After upgrade from Ubuntu 16 to 18.04, systemd-udevd uses 100% CPU) after each insertion of the modem, not at each system start:

#!/bin/sh
sudo systemctl stop systemd-udevd systemd-udevd-kernel.socket systemd-udevd-control.socket
sleep 5
sudo systemctl start systemd-udevd systemd-udevd-kernel.socket systemd-udevd-control.socket

This also allows remove and insert the modem without restarting. But the macro should be repeated. How to avoid the additional manual operations?

With best regards. Viktor.

1 Answer 1

0

WARNING: THIS SOLUTION LEADS TO INCORRECT OPERATION OF ALL DEVICES, CONNECTED AFTER THE MODEM!!! SORRY!

To solve the problem, it's necessary to create a UDEV rule. But here is a problem:

udevadm info --attribute-walk  --path=/devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb1/1-2/1-2:1.5/host0/target0:0:0/0:0:0:0/block/sr0

displays no unique attributes. The only useful attribute was found for the parent device: ATTRS{model}=="Mobile CMCC CD " But after binding it, there are a lot of events before the device starts functioning. If during the process we'll restart UDEV, this complex device will not operate. Thus, we should give enough time to perform all functions.

The solution.

  1. Create a macro named restart-udev-from-rule.sh, make it executable and put it to /usr/bin (can't format the following line as a code for an unknown reason):

    #!/bin/sh

    sleep 5

    systemctl stop systemd-udevd systemd-udevd-kernel.socket systemd-udevd-control.socket

    sleep 5

    systemctl start systemd-udevd systemd-udevd-kernel.socket systemd-udevd-control.socket

  2. Create a file 80-local.rules and put it to /etc/udev/rules.d :

    SUBSYSTEM=="scsi", ATTRS{model}=="Mobile CMCC CD ", ACTION=="add", RUN+="/usr/bin/restart-udev-from-rule.sh"

  3. Restart.

  4. To test the effect, run udevadm monitor after inserting the modem.

Known limitations:

After inserting the modem don't insert/remove a device for 10 seconds, because UDEV will not operate. The rule can be activated for any other modem, even if it isn't necessary. It is because no unique identifier.

You must log in to answer this question.

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