[ltp] tp_smapi resume behavior

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Sat, 13 Dec 2008 13:07:05 -0200


Shem,

Would it be possible to differentiate resume from STR from resume from
STD on tp_smapi, and drop the SMAPI calls to restore battery charge
thresholds when resuming from STR?

The reason I ask for this is that, at least on the T4x, SMAPI battery
calls disturb the EC, and it pauses an ongoing charge for ~2s only to
immediately resume it.  That is not very optimal for the battery.

Besides, we *KNOW* the EC will retain all relevant data over STR
anyway, and the less SMAPI calls we do in the resume path, the better
(as they cause SMIs, and SMIs are ALWAYS a bad idea when clocks are
being recalibrated, devices are being reset, etc).

The current behaviour of restoring all thresholds when resuming would
have to be reatained when resuming from STD, though.

BTW, maybe it would be a good idea to schedule work and reapply the
SMAPI thresholds a few seconds after the resume hook is called,
instead of when the resume hook is called?  Just in case there is
indeed a dangerous window for SMIs during device setup for something
else in the resume path...

Also, any plans to add sysfs power_supply class support to tp_smapi?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh