Skip to contentSkip to conversation

HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested

PATCH Applied Thomas Weißschuh 3 participants 3 messages Nov 30, 2021 – Dec 3, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested

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")
---
 drivers/hid/intel-ish-hid/ipc/pci-ish.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hid/intel-ish-hid/ipc/pci-ish.c +4 -2
index 1c5039081db2..8e9d9450cb83 100644
@@ -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

Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Thomas Weißschuh

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.

Quoted 7 lines

Reports on the Lenovo forums indicate that Lenovo ThinkPad X1 Yoga Gen6
is also affected.

Fixes ae02e5d40d5f ("HID: intel-ish-hid: ipc layer")
Quoted 33 lines

---
 drivers/hid/intel-ish-hid/ipc/pci-ish.c | 6 ++++--

 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hid/intel-ish-hid/ipc/pci-ish.c +0 -0
index 1c5039081db2..8e9d9450cb83 100644
@@ -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);

drivers/hid/intel-ish-hid/ipc/pci-ish.c +0 -0
@@ -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 lore raw
Quoted 14 lines · Srinivas Pandruvada
Quoted 12 lines · Thomas Weißschuh

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.

Quoted 8 lines
Quoted 7 lines

Reports on the Lenovo forums indicate that Lenovo ThinkPad X1 Yoga Gen6
is also affected.

Fixes ae02e5d40d5f ("HID: intel-ish-hid: ipc layer")

Applied to for-5.16/upstream-fixes in hid.git

thanks

Cheers,
Benjamin

Quoted 36 lines
Quoted 34 lines
---
 drivers/hid/intel-ish-hid/ipc/pci-ish.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hid/intel-ish-hid/ipc/pci-ish.c +4 -2
index 1c5039081db2..8e9d9450cb83 100644
@@ -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