Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23E3BC433F5 for ; Tue, 30 Nov 2021 06:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238490AbhK3GFN (ORCPT ); Tue, 30 Nov 2021 01:05:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbhK3GFL (ORCPT ); Tue, 30 Nov 2021 01:05:11 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27D29C061574; Mon, 29 Nov 2021 22:01:53 -0800 (PST) From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1638252109; bh=Qk3UF/uT3yT+QseoftmiYS+rUkxTHhdGBX/lFxVPHIA=; h=From:To:Cc:Subject:Date:From; b=G0z8AOjQQfQ1bIpEdvis9bwKDqsThGw0/lTy3RagC8dmQWANwfi72wdjrTWijQcSx 3OItOVrkZyQlK8gd1lNb31H62otscQXoj1vnVYp6IWc3R/f7bQ1VTmVqOxI4zFdgJ8 Lp03cZ/Jj/ZHyQv3iDdqcv9hCb1SUFUsQTuPH+/4= To: Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org, Mark Pearson , Daniel Drubin Subject: [PATCH] HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested Date: Tue, 30 Nov 2021 07:01:17 +0100 Message-Id: <20211130060117.3026-1-linux@weissschuh.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=ed25519-sha256; t=1638252074; l=1579; s=20211113; h=from:subject; bh=Qk3UF/uT3yT+QseoftmiYS+rUkxTHhdGBX/lFxVPHIA=; b=Yf7YtdbKFmv3gtnUhIDD/WhJvQwZ+qp9v8+rQdClHhIO2OPAlEm6vMXkR1asxiIhJKgNoa4KX0py YMk5Qi9rAs2SsyvXTxGd5gJtIq4BpK8cnzKCb6iPJzVd/+U+2qGn X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=9LP6KM4vD/8CwHW7nouRBhWLyQLcK1MkP6aTZbzUlj4= Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes spurious wakeups from s0ix on Lenovo ThinkPad X1 Cargon Gen 9 on lid close. These wakeups are generated by interrupts from the ISH on changes to the lid status. By disabling the wake IRQ from the ISH we inhibit these spurious wakeups while keeping the resume from LID open through the ACPI interrupt. Reports on the Lenovo forums indicate that Lenovo ThinkPad X1 Yoga Gen6 is also affected. Fixes: ae02e5d40d5f ("HID: intel-ish-hid: ipc layer") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214855 Signed-off-by: Thomas Weißschuh --- drivers/hid/intel-ish-hid/ipc/pci-ish.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c index 1c5039081db2..8e9d9450cb83 100644 --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c @@ -266,7 +266,8 @@ static void __maybe_unused ish_resume_handler(struct work_struct *work) if (ish_should_leave_d0i3(pdev) && !dev->suspend_flag && IPC_IS_ISH_ILUP(fwsts)) { - disable_irq_wake(pdev->irq); + if (device_may_wakeup(&pdev->dev)) + disable_irq_wake(pdev->irq); ish_set_host_ready(dev); @@ -337,7 +338,8 @@ static int __maybe_unused ish_suspend(struct device *device) */ pci_save_state(pdev); - enable_irq_wake(pdev->irq); + if (device_may_wakeup(&pdev->dev)) + enable_irq_wake(pdev->irq); } } else { /* base-commit: d58071a8a76d779eedab38033ae4c821c30295a5 -- 2.34.1