[Bug 89269] Re: power.sh: wrong laptop_mode activation

Timothy R. Chavez timothy.chavez at canonical.com
Thu Apr 10 15:09:39 UTC 2014


The bug task for the somerville project has been removed by an automated
script.  This bug has been cloned on that project and is available here:
https://bugs.launchpad.net/bugs/1305976

** No longer affects: somerville

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to acpi-support in Ubuntu.
https://bugs.launchpad.net/bugs/89269

Title:
  power.sh: wrong laptop_mode activation

Status in “acpi-support” package in Ubuntu:
  Fix Released
Status in “acpi-support” source package in Hardy:
  Fix Released

Bug description:
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/89269/+subscriptions



More information about the foundations-bugs mailing list