From: Rob Barnes <robbarnes@google.com>
To: Benson Leung <bleung@chromium.org>,
Tzung-Bi Shih <tzungbi@kernel.org>,
Guenter Roeck <groeck@chromium.org>,
Daisuke Nojiri <dnojiri@chromium.org>
Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org,
Rob Barnes <robbarnes@google.com>
Subject: [PATCH] platform/chrome: cros_ec_lpc: Only check for events on MKBP notifies
Date: Wed, 18 Dec 2024 01:57:59 +0000 [thread overview]
Message-ID: <20241218015759.3558830-1-robbarnes@google.com> (raw)
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>
---
drivers/platform/chrome/cros_ec_lpc.c | 2 +-
include/linux/platform_data/cros_ec_proto.h | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index c784119ab5dc0..5405762ea5558 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -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);
diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h
index b34ed0cc1f8dc..7d5b8a6bba3cc 100644
--- a/include/linux/platform_data/cros_ec_proto.h
+++ b/include/linux/platform_data/cros_ec_proto.h
@@ -48,6 +48,11 @@
*/
#define ACPI_NOTIFY_CROS_EC_PANIC 0xB0
+/*
+ * ACPI notify value for MKBP host event.
+ */
+#define ACPI_NOTIFY_CROS_EC_MKBP 0x80
+
/*
* Command interface between EC and AP, for LPC, I2C and SPI interfaces.
*/
--
2.47.1.613.gc27f4b7a9f-goog
next reply other threads:[~2024-12-18 1:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 1:57 Rob Barnes [this message]
2024-12-20 4:15 ` [PATCH] platform/chrome: cros_ec_lpc: Only check for events on MKBP notifies Tzung-Bi Shih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241218015759.3558830-1-robbarnes@google.com \
--to=robbarnes@google.com \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=dnojiri@chromium.org \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tzungbi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox