]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/acpi/ec.c
Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu...
[mirror_ubuntu-bionic-kernel.git] / drivers / acpi / ec.c
index ba2cebf1bb2f98d3467b99b41f2360fcea1e1673..da176c95aa2cb3a4fd89e7d0b100d0ff7d161405 100644 (file)
@@ -486,8 +486,11 @@ static inline void __acpi_ec_enable_event(struct acpi_ec *ec)
 {
        if (!test_and_set_bit(EC_FLAGS_QUERY_ENABLED, &ec->flags))
                ec_log_drv("event unblocked");
-       if (!test_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
-               advance_transaction(ec);
+       /*
+        * Unconditionally invoke this once after enabling the event
+        * handling mechanism to detect the pending events.
+        */
+       advance_transaction(ec);
 }
 
 static inline void __acpi_ec_disable_event(struct acpi_ec *ec)
@@ -1456,11 +1459,10 @@ static int ec_install_handlers(struct acpi_ec *ec, bool handle_events)
                        if (test_bit(EC_FLAGS_STARTED, &ec->flags) &&
                            ec->reference_count >= 1)
                                acpi_ec_enable_gpe(ec, true);
-
-                       /* EC is fully operational, allow queries */
-                       acpi_ec_enable_event(ec);
                }
        }
+       /* EC is fully operational, allow queries */
+       acpi_ec_enable_event(ec);
 
        return 0;
 }