Kernel Bug Tracker – Bug 11679
MSI Wind U100 - /sys/class/power_supply/ADP1/online always contains 1
Last modified: 2008-10-17 14:32:04 UTC
Distribution: openSUSE 11.0
Hardware Environment: MSI Wind U100
Problem Description: If the "new" sysfs interface for the AC adapter is not compiled out, the AC adapter is always reported as present, even if it's been unplugged. The reason for this is apparently that the sysfs attribute /sys/class/power_supply/ADP1/online always contains a '1', even if the adapter is not present.
At the same time, /proc/acpi/ac_adapter/ADP1/state contains the right value if the AC adapter has been unplugged, so there seems to be a bug somewhere in the notification code.
Steps to reproduce: Unplug the AC adapter and look at kpowersave.
please provide acpidump output.
Created attachment 18124 [details]
update sysfs state on every access
This should help, but it is definitely interesting why there is no notify.
Created attachment 18127 [details]
Output of acpidump
(In reply to comment #2)
> This should help, but it is definitely interesting why there is no notify.
I'll test it later today, but I'm not sure if it's going to help, unless the userland polls the sysfs attribute.
Created attachment 18133 [details]
debug ac notify propagation
Rafael, please check with this patch,
there should be some more printouts for each AC state change.
With this applied I've got a single notification when the after unplugging the AC adapter. However, I haven't got any notification after replugging it (actually i tried to unplug/replug it several times in a row, but there only was one notification).
The relevant lines in dmesg are:
ACPI: EC: expect AC state update
ACPI: received notify of state change
The patch from http://bugzilla.kernel.org/show_bug.cgi?id=10724#c142 fixes the problem. Closing as a duplicate.
*** This bug has been marked as a duplicate of bug 10724 ***