OLIMEX / DIY-LAPTOP

Do It Yourself Open Source Hardware and Software Modular Hacker's Friendly Laptop
Apache License 2.0
497 stars 90 forks source link

teres1-ledctrl consumes 100% cpu #10

Closed khumarahn closed 6 years ago

khumarahn commented 6 years ago

I have another issue to submit.

Occasionally, teres1-ledctrl starts to consume 100% of the cpu (one core), and the leds do not work. I observed it on both the original ubuntu, and on my gentoo, where I compiled it myself.

This happens rarely, I have no idea what triggers it.

A screenshot: screenshot-20171108 001606

khumarahn commented 6 years ago

upd: turning the keyboard on and off as in #8 does trigger this. However, I do not remember how it happened with the stock ubuntu - I wasn't experimenting with anything this low level.

d3v1c3nv11 commented 6 years ago

This service is temporary workaround that will fix the issue for now:

[Unit]
Description=teres1-ledctrl service stop before sleep
Before=sleep.target

[Service]
Type=oneshot
ExecStart=-/usr/bin/pkill -9 teres1-ledctrl

[Install]
WantedBy=sleep.target

create it with

sudo nano /etc/systemd/system/teres1-ledctrlkill.service
sudo systemctl enable teres1-ledctrlkill.service
sudo systemctl start teres1-ledctrlkill.service
hehopmajieh commented 6 years ago

I think this is a workaround , not fix. @d3v1c3nv11 take a look
here This will die in horrible pain, if file descriptor is missing or already opened. Simple file check will do the trick. But it needs additional debug

khumarahn commented 6 years ago

Yeap, it is not the right fix. I have a script (in #8) which unbinds the keyboard device when the lid is closed. There I also had to add a restart of the led control service.

Also, I do not use systemd. I would happily use it, but it requires a recent kernel. Our 3.10 is just too old, while older versions of systemd require to many patches to compile. Luckily for me, gentoo comes with openrc. It is a very good init system, but it does not manage suspend.

khumarahn commented 6 years ago

13

d3v1c3nv11 commented 6 years ago

Merged.

khumarahn commented 6 years ago

ok, thank you. It seems, this is done.