https://bugzilla.novell.com/show_bug.cgi?id=753589
https://bugzilla.novell.com/show_bug.cgi?id=753589#c15
--- Comment #15 from Vojta Dziewięcki 2012-06-04 18:12:41 UTC ---
Created an attachment (id=493527)
--> (http://bugzilla.novell.com/attachment.cgi?id=493527)
Proposed fix
Ok this might work:
We remove the "crazy big hammer", but we also remove the "state_exists
laptop_mode_default" test, which prevented the user-defined values from being
saved most of the times and caused this bug.
Now with this line removed, the script will save the values correctly upon
unplugging the adapter and restore them upon plugging.
Now the problem is that the powersave hooks run not only upon pugging or
unplugging the ac adapter, but also on suspend and resume, and it causes
trouble in this case (tested on my laptop):
1. Unplug the laptop adapter and plug it in again, the values get saved and
restored correctly.
2. Change some value affected by laptop-mode hook (vm.dirty_bytes for example)
3. Suspend and wake, the values are never saved, but they are restored again to
the values that had been saved before (upon unplugging the adapter).
This is unwanted behaviour, since user-defined sysctl settings can be lost this
way, so I propose adding on_ac_power tests upon suspend/resume, as seen in the
attached patch.
This way, the saved values would never be restored two times (Again, tested on
my laptop - the value remained the same before and after suspend).
There is no need to run "pm-powersave false" hook if the laptop is already
running on ac-power, so IMO this shouldn't have any side-effects.
So what do you guys think? Would this be an acceptable solution?
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.