ACPI / EC: Fix issues related to boot_ec
authorLv Zheng <lv.zheng@intel.com>
Wed, 7 Sep 2016 08:50:27 +0000 (16:50 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 10 Sep 2016 00:33:50 +0000 (02:33 +0200)
commit97cb159fd91d00f8d7d1adeb075503dc0d946bff
tree75952cf8e88ada30839ccca69337b14ef8346b6d
parent2a5708409e4e05446eb1a89ecb48641d6fd5d5a9
ACPI / EC: Fix issues related to boot_ec

There are issues related to the boot_ec:
1. If acpi_ec_remove() is invoked, boot_ec will also be freed, this is not
   expected as the boot_ec could be enumerated via ECDT.
2. Address space handler installation/unstallation lead to unexpected _REG
   evaluations.
This patch adds acpi_is_boot_ec() check to be used to fix the above issues.
However, since acpi_ec_remove() actually won't be invoked, this patch
doesn't handle the reference counting of "struct acpi_ec", it only ensures
the correctness of the boot_ec destruction during the boot.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=153511
Reported-and-tested-by: Jonh Henderson <jw.hendy@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/ec.c