Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/chrome: cros_ec_lpc: Only check for events on MKBP notifies

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>

authored by

Rob Barnes and committed by
Tzung-Bi Shih
fb1e4934 6fcbc55a

+6 -1
+1 -1
drivers/platform/chrome/cros_ec_lpc.c
··· 419 419 return; 420 420 } 421 421 422 - if (ec_dev->mkbp_event_supported) 422 + if (value == ACPI_NOTIFY_CROS_EC_MKBP && ec_dev->mkbp_event_supported) 423 423 do { 424 424 ret = cros_ec_get_next_event(ec_dev, NULL, 425 425 &ec_has_more_events);
+5
include/linux/platform_data/cros_ec_proto.h
··· 42 42 #define EC_MAX_RESPONSE_OVERHEAD 32 43 43 44 44 /* 45 + * ACPI notify value for MKBP host event. 46 + */ 47 + #define ACPI_NOTIFY_CROS_EC_MKBP 0x80 48 + 49 + /* 45 50 * EC panic is not covered by the standard (0-F) ACPI notify values. 46 51 * Arbitrarily choosing B0 to notify ec panic, which is in the 84-BF 47 52 * device specific ACPI notify range.