Public bug reported:

Binary package hint: acpi-support

I have divided this report into five parts, the first one is a real bug
which prevent correct functionality, the other are good things that
could be achieved with little effort.

power.sh should be really reworked, here is why:
-------------ONE------------
in power.sh laptop mode is enabled in this way:
function laptop_mode_enable {
    $LAPTOP_MODE start
    
    for x in /sys/bus/ide/devices/*/block; do 
        drive=$(basename $(readlink $x));
        $HDPARM -S 12 /dev/$drive 2>/dev/null
        $HDPARM -B 1 /dev/$drive 2>/dev/null
    done
    
    for x in /sys/bus/scsi/devices/*/block; do 
        drive=$(basename $(readlink $x));
        $HDPARM -S 12 /dev/$drive 2>/dev/null
        $HDPARM -B 1 /dev/$drive 2>/dev/null
    done
}
and disabled with a similar function.

now, I don't know about IDE devices, but on my Dell d620, (sata, intel ich7) 
the hard disk and the dvd show as
"/sys/bus/scsi/devices/0:0:0:0/block:sda" and 
"/sys/bus/scsi/devices/1:0:0:0/block:sr0".

So I think the script should be "for x in /sys/bus/scsi/devices/*/block*;"
This has fixed the problem on my laptop. 
This seems to affect both Edgy and Feisty.
------------TWO-------------
Let laptop mode handle the disks or handle those directly?
As of now laptop mode provides a config file to many things that are done by 
acpi-support, for example controlling hd with hdparm.
I suggest that all those functionalities are disabled and hidden, leaving 
laptop mode to care only for sysctl and mount options.
For example as of now the user can have laptop_mode to set his hd spin down 
timeout to 10 seconds, but just after laptop mode power.sh sets the hd 
parameters itself, with a value that the uset can not customize.
Should be enough to cut some stuff away from the laptop_mode script and config 
files.
------------THREE-----------
Following from point two, hd parameters should be tunable by the user, and 
power.sh should not use "magic values". I suggest to put those somewhere else, 
maybe in /etc/default/acpi-support.
I know those aren't strictly related to acpi, but all powersaving is already 
being done by acpi-support. 
-----------FOUR------------
When setting an hd aggressive power saving we should also set a longer 
readahead (hdparm -a 1024 or more)
------------FIVE-------------
It would also be interesting to set laptop_mode and disk powersaving when the 
lid is closed or let the user use the functions laptop_mode_enable and  
laptop_mode_disable in some custom scripts.
For this I suggest to move those function in 
/usr/share/acpi-support/power-funcs once everything else has been taken care of.

I am at disposal for anything you should need. Thanks for reading my
report.

** Affects: acpi-support (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
power.sh: wrong laptop_mode activation
https://launchpad.net/bugs/89269

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to