]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/chrome: cros_ec_lpc: Only check for events on MKBP notifies
authorRob Barnes <robbarnes@google.com>
Wed, 18 Dec 2024 01:57:59 +0000 (01:57 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 30 Dec 2024 01:31:05 +0000 (01:31 +0000)
Only check EC for MKBP events when the ACPI notify value indicates the
notify is due to an MKBP host event. This reduces unnecessary queries to
the EC.

Notify value 0x80 is reserved for devices specific notifies. It is used
by many devices to indicate various events. It's only used by cros_ec
for MKBP events.

Signed-off-by: Rob Barnes <robbarnes@google.com>
Link: https://lore.kernel.org/r/20241218015759.3558830-1-robbarnes@google.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec_lpc.c
include/linux/platform_data/cros_ec_proto.h

index 17c2578bbc5891ad68bccd75bd19a39d5162bf86..69801ace0496dd9ed31bc3d408c43b96ccb71186 100644 (file)
@@ -419,7 +419,7 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
                return;
        }
 
-       if (ec_dev->mkbp_event_supported)
+       if (value == ACPI_NOTIFY_CROS_EC_MKBP && ec_dev->mkbp_event_supported)
                do {
                        ret = cros_ec_get_next_event(ec_dev, NULL,
                                                     &ec_has_more_events);
index 701389c16fa7eeb4ead2de614600b10f299bc1ae..3ec24f445c29cdf0ebfb3139d7eff807b27b3d72 100644 (file)
 #define EC_MAX_REQUEST_OVERHEAD                1
 #define EC_MAX_RESPONSE_OVERHEAD       32
 
+/*
+ * ACPI notify value for MKBP host event.
+ */
+#define ACPI_NOTIFY_CROS_EC_MKBP 0x80
+
 /*
  * EC panic is not covered by the standard (0-F) ACPI notify values.
  * Arbitrarily choosing B0 to notify ec panic, which is in the 84-BF