From nobody Mon Feb 9 05:00:31 2026 Received: from mail.inka.de (quechua.inka.de [193.197.184.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D05A93FE52; Mon, 1 Apr 2024 14:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.197.184.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711980368; cv=none; b=n0Jl2n/RvXjIywVwjbbnkGFnz1aw9n9fHcws41d1ycD8kK4dGT8H49dNXe4L1yxRyvXGIR9n6YHm/0UXFzwuRe5Dkaa0YItK62az/W4D0kFS0U73LhgIEoxUvgf2QIQG8nq1TR48ip2dt84cRWGJzNbPECTkibZJoz7a5fuj6rE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711980368; c=relaxed/simple; bh=5Zt86hbg+IWRJfODskmP4KA6bw6Ujfy1jtcfs7KEcuQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rDjouLOy7Kr8HQDC8EKbUH6N+1U2XCaui0B/ozRRr4mlBDWZu2vc3ELT/JjvdSYcHjQpuNZtugGO3h9i6xRVnEe8ndakuk3FSLP4HE5wHLuFhUbqGxWgbStxCaWcuLWiWuKP4IezmcUVUgGeA1//duWsOSm6P0hiYVGaAm3xwHo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=inka.de; spf=pass smtp.mailfrom=inka.de; arc=none smtp.client-ip=193.197.184.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=inka.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inka.de Received: from mail.berkhan-weisser.de ([2a03:4000:54:b9a::4]) by mail.inka.de with esmtpsa id 1rrHsj-00Ap2r-85; Mon, 01 Apr 2024 15:39:25 +0200 Received: from 127.0.0.1 (helo=localhost.localdomain) by mail.berkhan-weisser.de with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1rrHsi-003vlF-3C; Mon, 01 Apr 2024 15:39:25 +0200 From: Enrik Berkhan To: Alex Hung Cc: Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Enrik Berkhan Subject: [PATCH] platform/x86/intel/hid: Ignore power button release in wakeup mode Date: Mon, 1 Apr 2024 15:39:19 +0200 Message-ID: <20240401133919.4304-1-Enrik.Berkhan@inka.de> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit 0c4cae1bc00d ("PM: hibernate: Avoid missing wakeup events during hibernation"), the return value of hibernation_platform_enter() is used. This will, for example, cancel every hibernation attempt if a wakeup event is registered during the (long) preparation time needed before entering platform hibernate mode. As reported in https://bugzilla.kernel.org/show_bug.cgi?id=3D218634 several notebooks will fail to hibernate since then, logging "PM: hibernation: Wakeup event detected during hibernation, rolling back." (Looks like mostly Dell systems are affected.) A little investigation has shown that at least one affected device's "Intel 5 button array" sends spurious "Power button release" events (0xCF) in this case. Most probably, this is completely independent from the hibernation_platform_enter() change above, and even with kernels before 6.8, the hibernation was probably not fully prepared before halting the system, i.e., hibernation_platform_enter() may have failed early and the failure has been ignored. It ist he spurious "Power button release" event that leads to a wakeup during the hibernation preparation. Therefore, ignore these events while the intel-hid driver is in "wakeup mode". "Power button press" will still be processed as before to not disturb the wakeup from S2Idle. Only tested on one Dell Inspiron 16 (7640) having BIOS 1.3.0, so far. Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D218634 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=3D218634 Signed-off-by: Enrik Berkhan --- drivers/platform/x86/intel/hid.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/= hid.c index 7457ca2b27a6..9df4a114334a 100644 --- a/drivers/platform/x86/intel/hid.c +++ b/drivers/platform/x86/intel/hid.c @@ -528,6 +528,13 @@ static void notify_handler(acpi_handle handle, u32 eve= nt, void *context) */ if (event =3D=3D 0xce) goto wakeup; + /* + * Other platforms may send spurious notifies for power button + * release while entering hibernation mode. Ignore these in + * wakeup mode. + */ + if (event =3D=3D 0xcf) + return; =20 /* * Some devices send (duplicate) tablet-mode events when moved --=20 2.44.0