2018-09-12 16:13:15

by Vitaly Kuznetsov

[permalink] [raw]
Subject: [PATCH] hyper-v: Fix wakeup from suspend-to-idle

It makes little sense but still possible to put Hyper-V guests into
suspend-to-idle state. To wake them up two wakeup sources were registered
in the past: hyperv-keyboard and hid-hyperv. However, since
commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
to pm_wakeup_hard_event() API as these devices are actually the only
possible way to wakeup Hyper-V guests.

Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
Signed-off-by: Vitaly Kuznetsov <[email protected]>
---
drivers/hid/hid-hyperv.c | 2 +-
drivers/input/serio/hyperv-keyboard.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
index b372854cf38d..704049e62d58 100644
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -309,7 +309,7 @@ static void mousevsc_on_receive(struct hv_device *device,
hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
input_dev->input_buf, len, 1);

- pm_wakeup_event(&input_dev->device->device, 0);
+ pm_wakeup_hard_event(&input_dev->device->device);

break;
default:
diff --git a/drivers/input/serio/hyperv-keyboard.c b/drivers/input/serio/hyperv-keyboard.c
index 47a0e81a2989..a8b9be3e28db 100644
--- a/drivers/input/serio/hyperv-keyboard.c
+++ b/drivers/input/serio/hyperv-keyboard.c
@@ -177,7 +177,7 @@ static void hv_kbd_on_receive(struct hv_device *hv_dev,
* state because the Enter-UP can trigger a wakeup at once.
*/
if (!(info & IS_BREAK))
- pm_wakeup_event(&hv_dev->device, 0);
+ pm_wakeup_hard_event(&hv_dev->device);

break;

--
2.14.4



2018-09-13 06:57:20

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] hyper-v: Fix wakeup from suspend-to-idle

On Wed, Sep 12, 2018 at 6:11 PM Vitaly Kuznetsov <[email protected]> wrote:
>
> It makes little sense but still possible to put Hyper-V guests into
> suspend-to-idle state. To wake them up two wakeup sources were registered
> in the past: hyperv-keyboard and hid-hyperv. However, since
> commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
> suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
> to pm_wakeup_hard_event() API as these devices are actually the only
> possible way to wakeup Hyper-V guests.
>
> Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
> Signed-off-by: Vitaly Kuznetsov <[email protected]>

Reviewed-by: Rafael J. Wysocki <[email protected]>

> ---
> drivers/hid/hid-hyperv.c | 2 +-
> drivers/input/serio/hyperv-keyboard.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
> index b372854cf38d..704049e62d58 100644
> --- a/drivers/hid/hid-hyperv.c
> +++ b/drivers/hid/hid-hyperv.c
> @@ -309,7 +309,7 @@ static void mousevsc_on_receive(struct hv_device *device,
> hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
> input_dev->input_buf, len, 1);
>
> - pm_wakeup_event(&input_dev->device->device, 0);
> + pm_wakeup_hard_event(&input_dev->device->device);
>
> break;
> default:
> diff --git a/drivers/input/serio/hyperv-keyboard.c b/drivers/input/serio/hyperv-keyboard.c
> index 47a0e81a2989..a8b9be3e28db 100644
> --- a/drivers/input/serio/hyperv-keyboard.c
> +++ b/drivers/input/serio/hyperv-keyboard.c
> @@ -177,7 +177,7 @@ static void hv_kbd_on_receive(struct hv_device *hv_dev,
> * state because the Enter-UP can trigger a wakeup at once.
> */
> if (!(info & IS_BREAK))
> - pm_wakeup_event(&hv_dev->device, 0);
> + pm_wakeup_hard_event(&hv_dev->device);
>
> break;
>
> --
> 2.14.4
>

2018-09-13 12:59:09

by KY Srinivasan

[permalink] [raw]
Subject: RE: [PATCH] hyper-v: Fix wakeup from suspend-to-idle



> -----Original Message-----
> From: Rafael J. Wysocki <[email protected]>
> Sent: Wednesday, September 12, 2018 11:55 PM
> To: vkuznets <[email protected]>
> Cc: Linux PM <[email protected]>; Rafael J. Wysocki
> <[email protected]>; KY Srinivasan <[email protected]>; Haiyang Zhang
> <[email protected]>; Stephen Hemminger
> <[email protected]>; Jiri Kosina <[email protected]>; Dmitry
> Torokhov <[email protected]>; [email protected];
> Linux Kernel Mailing List <[email protected]>
> Subject: Re: [PATCH] hyper-v: Fix wakeup from suspend-to-idle
>
> On Wed, Sep 12, 2018 at 6:11 PM Vitaly Kuznetsov <[email protected]>
> wrote:
> >
> > It makes little sense but still possible to put Hyper-V guests into
> > suspend-to-idle state. To wake them up two wakeup sources were
> registered
> > in the past: hyperv-keyboard and hid-hyperv. However, since
> > commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
> > suspend-to-idle") pm_wakeup_event() from these devices is ignored.
> Switch
> > to pm_wakeup_hard_event() API as these devices are actually the only
> > possible way to wakeup Hyper-V guests.
> >
> > Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from
> suspend-to-idle)
> > Signed-off-by: Vitaly Kuznetsov <[email protected]>
>
> Reviewed-by: Rafael J. Wysocki <[email protected]>
Acked-by: K. Y. Srinivasan <[email protected]>

>
> > ---
> > drivers/hid/hid-hyperv.c | 2 +-
> > drivers/input/serio/hyperv-keyboard.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
> > index b372854cf38d..704049e62d58 100644
> > --- a/drivers/hid/hid-hyperv.c
> > +++ b/drivers/hid/hid-hyperv.c
> > @@ -309,7 +309,7 @@ static void mousevsc_on_receive(struct hv_device
> *device,
> > hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
> > input_dev->input_buf, len, 1);
> >
> > - pm_wakeup_event(&input_dev->device->device, 0);
> > + pm_wakeup_hard_event(&input_dev->device->device);
> >
> > break;
> > default:
> > diff --git a/drivers/input/serio/hyperv-keyboard.c
> b/drivers/input/serio/hyperv-keyboard.c
> > index 47a0e81a2989..a8b9be3e28db 100644
> > --- a/drivers/input/serio/hyperv-keyboard.c
> > +++ b/drivers/input/serio/hyperv-keyboard.c
> > @@ -177,7 +177,7 @@ static void hv_kbd_on_receive(struct hv_device
> *hv_dev,
> > * state because the Enter-UP can trigger a wakeup at once.
> > */
> > if (!(info & IS_BREAK))
> > - pm_wakeup_event(&hv_dev->device, 0);
> > + pm_wakeup_hard_event(&hv_dev->device);
> >
> > break;
> >
> > --
> > 2.14.4
> >

2018-09-24 09:26:24

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] hyper-v: Fix wakeup from suspend-to-idle

On Wed, 12 Sep 2018, Vitaly Kuznetsov wrote:

> It makes little sense but still possible to put Hyper-V guests into
> suspend-to-idle state. To wake them up two wakeup sources were registered
> in the past: hyperv-keyboard and hid-hyperv. However, since
> commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
> suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
> to pm_wakeup_hard_event() API as these devices are actually the only
> possible way to wakeup Hyper-V guests.
>
> Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
> Signed-off-by: Vitaly Kuznetsov <[email protected]>
> ---
> drivers/hid/hid-hyperv.c | 2 +-

Acked-by: Jiri Kosina <[email protected]>

for the above. I guess this'd better go through ACPI tree?

Thanks,

--
Jiri Kosina
SUSE Labs


2018-09-24 22:51:25

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] hyper-v: Fix wakeup from suspend-to-idle

On Mon, Sep 24, 2018 at 11:24 AM Jiri Kosina <[email protected]> wrote:
>
> On Wed, 12 Sep 2018, Vitaly Kuznetsov wrote:
>
> > It makes little sense but still possible to put Hyper-V guests into
> > suspend-to-idle state. To wake them up two wakeup sources were registered
> > in the past: hyperv-keyboard and hid-hyperv. However, since
> > commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
> > suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
> > to pm_wakeup_hard_event() API as these devices are actually the only
> > possible way to wakeup Hyper-V guests.
> >
> > Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
> > Signed-off-by: Vitaly Kuznetsov <[email protected]>
> > ---
> > drivers/hid/hid-hyperv.c | 2 +-
>
> Acked-by: Jiri Kosina <[email protected]>
>
> for the above. I guess this'd better go through ACPI tree?

No problem with that if you prefer.

Cheers,
Rafael

2018-11-06 17:08:29

by Vitaly Kuznetsov

[permalink] [raw]
Subject: Re: [PATCH] hyper-v: Fix wakeup from suspend-to-idle

"Rafael J. Wysocki" <[email protected]> writes:

> On Mon, Sep 24, 2018 at 11:24 AM Jiri Kosina <[email protected]> wrote:
>>
>> On Wed, 12 Sep 2018, Vitaly Kuznetsov wrote:
>>
>> > It makes little sense but still possible to put Hyper-V guests into
>> > suspend-to-idle state. To wake them up two wakeup sources were registered
>> > in the past: hyperv-keyboard and hid-hyperv. However, since
>> > commit eed4d47efe95 ("ACPI / sleep: Ignore spurious SCI wakeups from
>> > suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
>> > to pm_wakeup_hard_event() API as these devices are actually the only
>> > possible way to wakeup Hyper-V guests.
>> >
>> > Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
>> > Signed-off-by: Vitaly Kuznetsov <[email protected]>
>> > ---
>> > drivers/hid/hid-hyperv.c | 2 +-
>>
>> Acked-by: Jiri Kosina <[email protected]>
>>
>> for the above. I guess this'd better go through ACPI tree?
>
> No problem with that if you prefer.
>

It seems this patch got lost somewhere :-(

--
Vitaly