linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested
@ 2021-11-30  6:01 Thomas Weißschuh
  2021-12-01 13:34 ` Srinivas Pandruvada
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Weißschuh @ 2021-11-30  6:01 UTC (permalink / raw)
  To: Srinivas Pandruvada, Jiri Kosina, Benjamin Tissoires, linux-input
  Cc: Thomas Weißschuh, linux-kernel, Mark Pearson, Daniel Drubin

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 <linux@weissschuh.net>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested
  2021-11-30  6:01 [PATCH] HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested Thomas Weißschuh
@ 2021-12-01 13:34 ` Srinivas Pandruvada
  2021-12-03  8:45   ` Benjamin Tissoires
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivas Pandruvada @ 2021-12-01 13:34 UTC (permalink / raw)
  To: Thomas Weißschuh, Jiri Kosina, Benjamin Tissoires, linux-input
  Cc: linux-kernel, Mark Pearson, Daniel Drubin

On Tue, 2021-11-30 at 07:01 +0100, Thomas Weißschuh wrote:
> 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 <linux@weissschuh.net>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested
  2021-12-01 13:34 ` Srinivas Pandruvada
@ 2021-12-03  8:45   ` Benjamin Tissoires
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Tissoires @ 2021-12-03  8:45 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: Thomas Weißschuh, Jiri Kosina, open list:HID CORE LAYER,
	lkml, Mark Pearson, Daniel Drubin

On Wed, Dec 1, 2021 at 2:35 PM Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
>
> On Tue, 2021-11-30 at 07:01 +0100, Thomas Weißschuh wrote:
> > 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 <linux@weissschuh.net>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

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

thanks

Cheers,
Benjamin

>
> > ---
> >  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
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-03  8:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30  6:01 [PATCH] HID: intel-ish-hid: ipc: only enable IRQ wakeup when requested Thomas Weißschuh
2021-12-01 13:34 ` Srinivas Pandruvada
2021-12-03  8:45   ` Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).