There are two devices under /sys/class/power_supply ls /sys/class/power_supply/ ADP1 BAT1 With following command: udevadm monitor -p -s power_supply When pluging/unpluging the power, I can only observe event related to BAT1, but nothing related to ADP1. But if I execute "cat /sys/class/power_supply/ADP1/online" manually, the returned value indeed reflects the actualy state of power adaptor.
*** Bug 111001 has been marked as a duplicate of this bug. ***
According to your description, it seems like the adapter driver does not report netlink event to upper level. And I've made a double-check on Surface Pro 3, there are BAT0 and AC0 under power_supply, both of them issue udev events to udevadm when plug/unplug the adapter, can you please provide: ls -l /sys/class/power_supply and the acpidump file?
Created attachment 203681 [details] acpidump $ LANG=C ls -l /sys/class/power_supply/ total 0 lrwxrwxrwx 1 root root 0 Feb 14 10:13 ADP1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/ACPI0003:00/power_supply/ADP1 lrwxrwxrwx 1 root root 0 Feb 14 10:13 BAT1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/PNP0C09:00/PNP0C0A:00/power_supply/BAT1
On sp4, BIOS did not provide any notification mechanism on AC(no Notify(ADP1)), so although AC driver provide udev/netlink transaction in acpi_ac_notify, no one is willing to cover this path due to BIOS implementation, and the AC status is maintained directly by EC, so it is correct.
Ah, thank you. It seems that I can patch the dsdt file and add related Notify(ADP1, 0x81) to after following lines: ADBG ("Adapter plug inserted") ADBG ("Adapter plug removed") With patched dsdt now I can receive related infomation via udevadm. So I guess this is a bug in firmware instead of kernel?
I think so, it looks like BIOS does not think it is necessary to inform the OS of the AC status.
I'm closing this thread as this is due to firmware implementation.