Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1457752lqz; Mon, 1 Apr 2024 07:06:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVw/dTUVVd1x6G3OG0vmQTK0BdVgO6+brcGP8MnBFDu42ooHWZcKPGtXzeEIO52CEsccU2lbmU3Tzq42el7l1ZJeijrUQOr2R512hf5YA== X-Google-Smtp-Source: AGHT+IFA05o2z8m4deRZ4FTxcnP3UljUviXuNBkvAUPDOKBk6uBartTs1XpbMxvDxXvl/IqUm9Lo X-Received: by 2002:a05:6808:2387:b0:3c3:bf97:ca2f with SMTP id bp7-20020a056808238700b003c3bf97ca2fmr10285491oib.6.1711980374893; Mon, 01 Apr 2024 07:06:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711980374; cv=pass; d=google.com; s=arc-20160816; b=PTWottCXj7UyfWsZWUUuGBRgXhwJqq5wmMwJxZwKXzCTkY/MUiioqI86/iShn0F4t3 xAUhulgYxBNOgGRGbuBKZ9Q2xDxBXE2mpMOYd516DSXwkIw6CFo9dUpz4nWAjzhWd1Lo NcPLnzBniAjHApr4dYfcEozSXAzi71fON7XUrpfMbzgIjQc7/gC2o1dGl15KCeP4zqtW YIidsqXoTK/s6xPHq+ftZJIJFkyE7ECxDaBZXTJdipTc0c5l4IIQG7uaIMXS4dau9ys2 HKb2NHkemWDWI3Gurdspfb+4G0lOg31NE8APqsm/+Ru48q8LHAUIClOfNEAcFHjeJoO+ 8Ecw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=3DetZ6BrlN0Ae614BWKZJbUbcJPxVq+pQ+j+zNdJ99c=; fh=SNRUjv2j5lhOy5GqZso7eDh/3Mw5UxRVo4aSIp7AqKQ=; b=w1AdbUVv2rovNEtXLjqAtO6jflY4KmVERVMniaMaiytQpU4oRutQjNfz0rURnZBLrI /Ma8it9YaEKTy+gxB//AOrl8urjkyN9cS5wSViZksJGDuR8s6hw1Y7qwI3wxSwO3j8do JtSFVQy6aO4uIIMl+IDzQ634xqFKyDVEsitFev7LV5o0Wfde4cGQo4tLu1qZhob6k8v0 LLBMHzShkIyHLrZG1Y+35hCvBm3TJQiuFQ3ZM2j9Zbx1mz+2GlSe0B9V/0ziHPqCHjpH UKccSH+pYtXMe7kCUycw1w4+vOVkC231ZueFHiJa5biyeNGP/aRnBbhzoveo+xo/64AD DrEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=inka.de); spf=pass (google.com: domain of linux-kernel+bounces-126698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126698-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q14-20020a67f04e000000b004784f954b29si962159vsm.398.2024.04.01.07.06.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 07:06:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=inka.de); spf=pass (google.com: domain of linux-kernel+bounces-126698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126698-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 94B541C21436 for ; Mon, 1 Apr 2024 14:06:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71085405EC; Mon, 1 Apr 2024 14:06:08 +0000 (UTC) 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: 8bit 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=218634 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=218634 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218634 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 event, void *context) */ if (event == 0xce) goto wakeup; + /* + * Other platforms may send spurious notifies for power button + * release while entering hibernation mode. Ignore these in + * wakeup mode. + */ + if (event == 0xcf) + return; /* * Some devices send (duplicate) tablet-mode events when moved -- 2.44.0