Everytime I had problems with AC adapter notifications on my laptop. However, before 3.13 there was a workaround - let acpid call "acpi -a" when battery starts charging/discharging. After that, adapter's state updates. Today I built 3.13-rc5, and this workaround doesn't help anymore. "acpi -a" tells that adapter is offline, but acpi_listen doesn't show "ac_adapter" event, and UPower (and hence KDE's PowerDevil) thinks that adapter is still online (i've checked UPower using qdbus). On kernel 3.12.6 the workaround does its job. Also, isn't it possible to do something like my workaround in the kernel?
With this patch things, at least, become as they were before 3.13 diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 8711e37..3c2e4aa 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -207,7 +207,7 @@ static int acpi_ac_probe(struct platform_device *pdev) goto end; result = acpi_install_notify_handler(ACPI_HANDLE(&pdev->dev), - ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler, ac); + ACPI_ALL_NOTIFY, acpi_ac_notify_handler, ac); if (result) { power_supply_unregister(&ac->charger); goto end; @@ -255,7 +255,7 @@ static int acpi_ac_remove(struct platform_device *pdev) return -EINVAL; acpi_remove_notify_handler(ACPI_HANDLE(&pdev->dev), - ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler); + ACPI_ALL_NOTIFY, acpi_ac_notify_handler); ac = platform_get_drvdata(pdev); if (ac->charger.dev)
Please provide the output of acpidump.
Created attachment 120291 [details] acpidump output
From the acpidump, aml code notifies AC driver with zero event which is a system event. So ACPI_DEVICE_NOTIFY is not enough. Please send the patch in the comment 1 to acpi mallist.
The fix patch has been merged into linux-pm tree. http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=50a2bc5429f07ec4d53df2d287b03bdbceb281bb