You are not logged in.

#1 2012-09-15 06:24:53

gh403
Member
Registered: 2012-09-15
Posts: 23

[laptop-mode-tools] not detecting power unplug

Laptop Mode Tools is configured to set my SATA link power management to "min_power".  Essentially, it does

# echo "min_power" > /sys/class/scsi_host/host0/link_power_management_policy

when I unplug, and

# echo "max_performance" > /sys/class/scsi_host/host0/link_power_management_policy

when I plug in the laptop.  I can check the value with

$ cat /sys/class/scsi_host/host0/link_power_management_policy

Setting max_performance when plugging works great.  Unfortunately, when I unplug, it stays stuck at max_performance.  Restarting the LMT daemon fixes this temporarily, until I unplug again.

Is this a bug?  Or am I missing something?  I'm on a Dell Inspiron 7520, about 3 months old, and so far, Arch doesn't seem to like the more esoteric features of the laptop, like the switchable graphics card.

Thanks for any help!

Last edited by gh403 (2012-09-15 06:29:24)

Offline

#2 2012-09-15 12:09:30

lspci
Member
From: Virginia, USA
Registered: 2012-06-09
Posts: 242

Re: [laptop-mode-tools] not detecting power unplug

gh403 wrote:

Laptop Mode Tools is configured to set my SATA link power management to "min_power".  Essentially, it does

# echo "min_power" > /sys/class/scsi_host/host0/link_power_management_policy

when I unplug, and

# echo "max_performance" > /sys/class/scsi_host/host0/link_power_management_policy

when I plug in the laptop.  I can check the value with

$ cat /sys/class/scsi_host/host0/link_power_management_policy

Setting max_performance when plugging works great.  Unfortunately, when I unplug, it stays stuck at max_performance.  Restarting the LMT daemon fixes this temporarily, until I unplug again.

Is this a bug?  Or am I missing something?  I'm on a Dell Inspiron 7520, about 3 months old, and so far, Arch doesn't seem to like the more esoteric features of the laptop, like the switchable graphics card.

Thanks for any help!

Have you searched the all-powerful google or the Arch wiki, friend?

Oh, and welcome to Arch Linux since this appears to be your first post!  smile Hope that you like it here and enjoy your stay!

Also, I don't know anything about the Laptop Mode Tools, since I don't use them even though I have a laptop, perhaps I should take a look into them for my own benefit as well.

Last edited by lspci (2012-09-15 12:12:02)


Please don't be a help vampire. | Bitbucket

Give a little more for a little less today.  smile

Offline

#3 2012-09-15 16:06:42

gh403
Member
Registered: 2012-09-15
Posts: 23

Re: [laptop-mode-tools] not detecting power unplug

I have done quite a bit of Googling, and unfortunately information on LMT seems kind of sparse.  I did read the Arch wiki page; the only relevant thing it suggested was that pm-utils is conflicting with LMT (which would make a lot of sense...).  But the offered solution, blacklisting the pm-utils module, didn't help.  https://wiki.archlinux.org/index.php/La … leshooting

pm-utils seems to have a script that does the same thing as I want LMT to do (/usr/lib/pm-utils/power.d/sata_aplm), but when I disable LMT completely, nothing happens when I plug/unplug.

Thanks for the welcome!

Offline

#4 2012-09-15 16:14:54

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [laptop-mode-tools] not detecting power unplug

If your question is how to make stuff happen when you plug/unplug, maybe a udev rule or acpid... isn't acpid an optional depend of laptop mode tools. I don't use them, but someone I was discussing things with, mentioned that.  It would seem that if acpid is indeed an optional depend, I would think that if you do not use it, laptop mode tools simply starts and thats it.  While acpid would be the necessary mechanism to change settings depending on plug or unplug.

If this info is what you were looking for, you could skip acpid altogether and simply write a udev rule, then avoiding an additional daemon/service.  I also think that there is something else that has this function too... upower maybe.

Offline

#5 2012-09-15 17:11:28

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: [laptop-mode-tools] not detecting power unplug

Does laptop mode tools still do other stuff it's supposed to when un/plugging?

If not, try acpi_listen in a terminal and then plug and unplug your laptop to see if acpi is seeing the events.

Offline

#6 2012-09-15 17:19:44

gh403
Member
Registered: 2012-09-15
Posts: 23

Re: [laptop-mode-tools] not detecting power unplug

WonderWoofy wrote:

isn't acpid an optional depend of laptop mode tools. I don't use them, but someone I was discussing things with, mentioned that.  It would seem that if acpid is indeed an optional depend, I would think that if you do not use it, laptop mode tools simply starts and thats it.  While acpid would be the necessary mechanism to change settings depending on plug or unplug.

This is exactly the issue I think.  I had disabled acpid because of its very irritating response to a power button event... shutdown the system.  The wiki has a solution for that which works dandily.  acpid has a bunch of scripts in /etc/acpi labelled lm_battery.sh, lm_adapter.sh, etc.  These seem to be what was missing!  I just assumed laptop mode knew how to detect those kind of events!  I don't have my power adapter with me, so I can't be for certain right away, but it looks like this is all that is needed.  Thanks a ton!

Last edited by gh403 (2012-09-15 17:19:59)

Offline

#7 2012-09-15 23:09:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [laptop-mode-tools] not detecting power unplug

Edit the handler script and comment out "poweroff" in the first few lines where it reacts to power button calls.  Either that, or if you don't use anything included in the handler script, [re]move it.

If it is solved, please mark your thread title accordingly.

Offline

Board footer

Powered by FluxBB