From nobody Thu Dec 18 08:14:00 2025 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23AFF3D3B3 for ; Wed, 18 Dec 2024 01:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734487097; cv=none; b=AbbruR89MP7sEggExnmxmi5p2+NvoQPIXIHcS2X6dWVU4GpXpZCxhvEkmJU2lsQh8UTNBLgMNKUQVcJEbbO5u0CnMpmLJRjtcDuHmVodEajD/vBJ5BNbK8qco7ZBQ0Vayo4RgDa+pkKHGKOHEgHrr7sjDO0E/N50sZGXPjOECd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734487097; c=relaxed/simple; bh=BENOydFBcsvElpsve8XNmKaW1hEgQWwrmiaAlYXCQuw=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=SdLqyWjbXxOSyZtikydU4OKmKLmmAVCRxKz8w/VAT3M3dc56rPa9wVNlwSqdlGyEneTXOhKpOjzWCHXasqxnqfykUY9f/A1H6cudd4MeSQPm5+EnLFQOBhu4vgoMXlNJbvbZYQYQ2pBMf6r7Fcb+cGeylBbiX5ULg+ZqJ38h+p4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--robbarnes.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=de2/z9e/; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--robbarnes.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="de2/z9e/" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-725e87a142dso7769174b3a.2 for ; Tue, 17 Dec 2024 17:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734487094; x=1735091894; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=1QUWFEMVgJcNYDWFP2lpTlp76cDDudW+fhyyQmylIMw=; b=de2/z9e/Nr6sterQC+5SCHjK5URKqUXb83aq7OqSkKE1tiRVKcc1JXyHI9iQvel0ed GbfaHnqm8uy64o+lXASDRI3eJYwjf1O87L5H25ANGThmdT0fw9i3/d5zw6Uw7OJ06hB2 oXLvHaGidEJRwZJezjzkLazSdh8UmKu+OsF9fIb+R0HeQUCuQHepW0tR0usmcnQQBErR wfcgVzreRAJxffGOFhqENBwxZMZi55vcLYzPIfw2RhAS7WZ9SvC2GjHSVxVWY2YVQqAy IGWSMQsRkN/L6HvL29NHp5GDekh//d31z7z+ryMqYkRjfDsnm+ovQVGEvmYXKpM3+8dL caRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734487094; x=1735091894; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1QUWFEMVgJcNYDWFP2lpTlp76cDDudW+fhyyQmylIMw=; b=IdSOJFf5o0iYgRTcH/i5NzQkaU1MoN8K/mYdnJ0/MpU/oyNmeVkT08TvZOy63FB49g oh+LR8LqS8O0JLEhfS1EBRlku6yKnhuwC1wlmAzKZ2ePO1s9aZISufkumo+Iecyqgdxf F28lq+0s98F3YI1sU0ZqmlB9ckKzNNz1MUgjNHOm0PVAfGdyqlwA2i0wifNFwY2V2I6S A6Unrc00Ckrw/InJeiB3490N4IhvF+cmBBTJRyjXwu8hvxj9LeEP0IW3Hc7XAhhv70YJ YJFOPVWnaVP2uLDkcfERHrUzF2vSjYrSilAKDvE/hCqxKxH6spldpiZx6n0T9oJn4++d V5/g== X-Forwarded-Encrypted: i=1; AJvYcCVfCCyFnOWrvHa/3LhACHSggafHdlAYxcCAnfE/goX30TYxOdpZSMeJlVjgOTSCUjUVQt2gbnVScouQOX4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0ytgxOlQwT982mEVYOH5FMxFucd6jalq4ssoOHNwX9kKUuvs5 3VVh7Br8KVcbLc5ieNz5BCGFdiEkZ4B+6STZisjGQh3/+UJmsFtYPmvWvOu2S15E1m4a4FesMaw gKVtNI8Hs574xPw== X-Google-Smtp-Source: AGHT+IHFeeowND6LmGF2oVcLp4eMKmIWd77UcaNbjhbW5nDWoyJeA8jXH+pR1K02sQZwcqZqcgusw/9Wyr1BATQ= X-Received: from pfnc17.prod.google.com ([2002:aa7:81d1:0:b0:725:dd0a:6e99]) (user=robbarnes job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3cd0:b0:728:e182:a8b with SMTP id d2e1a72fcca58-72a8d226adbmr2022308b3a.9.1734487094452; Tue, 17 Dec 2024 17:58:14 -0800 (PST) Date: Wed, 18 Dec 2024 01:57:59 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241218015759.3558830-1-robbarnes@google.com> Subject: [PATCH] platform/chrome: cros_ec_lpc: Only check for events on MKBP notifies From: Rob Barnes To: Benson Leung , Tzung-Bi Shih , Guenter Roeck , Daisuke Nojiri Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Rob Barnes Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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/chrom= e/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; } =20 - if (ec_dev->mkbp_event_supported) + if (value =3D=3D ACPI_NOTIFY_CROS_EC_MKBP && ec_dev->mkbp_event_supported) do { ret =3D 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/pl= atform_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 =20 +/* + * 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. */ --=20 2.47.1.613.gc27f4b7a9f-goog