Skip to contentSkip to conversation

hyper-v: Fix wakeup from suspend-to-idle

PATCH Superseded Vitaly Kuznetsov 4 participants 6 messages Sep 12, 2018 – Nov 6, 2018

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

PATCH 1/1 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)
---
 drivers/hid/hid-hyperv.c              | 2 +-
 drivers/input/serio/hyperv-keyboard.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-hyperv.c +1 -1
index b372854cf38d..704049e62d58 100644
@@ -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:
drivers/input/serio/hyperv-keyboard.c +1 -1
index 47a0e81a2989..a8b9be3e28db 100644
@@ -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;
 
Signature · 1 line
2.14.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Vitaly Kuznetsov

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)
Quoted 34 lines
---
 drivers/hid/hid-hyperv.c              | 2 +-
 drivers/input/serio/hyperv-keyboard.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-hyperv.c +1 -1
index b372854cf38d..704049e62d58 100644
@@ -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:
drivers/input/serio/hyperv-keyboard.c +1 -2
index 47a0e81a2989..a8b9be3e28db 100644
@@ -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

Acked-by
#2 lore raw
Quoted 24 lines

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

Quoted 3 lines · Vitaly Kuznetsov

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

Quoted 3 lines

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

Quoted 8 lines
Quoted 4 lines

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)

Quoted 1 line
Quoted 38 lines

drivers/hid/hid-hyperv.c static void mousevsc_on_receive(struct hv_device

Quoted 11 lines
---
 drivers/hid/hid-hyperv.c              | 2 +-
 drivers/input/serio/hyperv-keyboard.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-hyperv.c +0 -0
index b372854cf38d..704049e62d58 100644
@@ -309,7 +309,7 @@ static void mousevsc_on_receive(struct hv_device

*device,

Review

Quoted 9 lines
drivers/hid/hid-hyperv.c +1 -1
                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:
(quoted diff) +0 -0

b/drivers/input/serio/hyperv-keyboard.c

drivers/input/serio/hyperv-keyboard.c static void hv_kbd_on_receive(struct hv_device

Quoted 4 lines

index 47a0e81a2989..a8b9be3e28db 100644

drivers/input/serio/hyperv-keyboard.c +0 -0
@@ -177,7 +177,7 @@ static void hv_kbd_on_receive(struct hv_device

*hv_dev,

Quoted 11 lines
drivers/input/serio/hyperv-keyboard.c +1 -2
                 * 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

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Vitaly Kuznetsov
Quoted 8 lines · Vitaly Kuznetsov

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.

Quoted 4 lines
Fixes eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
---
 drivers/hid/hid-hyperv.c              | 2 +-

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

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw
Quoted 11 lines · Jiri Kosina
Quoted 8 lines · Vitaly Kuznetsov

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.

Quoted 8 lines
Quoted 4 lines
Fixes eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
---
 drivers/hid/hid-hyperv.c              | 2 +-

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

No problem with that if you prefer.

Cheers,
Rafael

#5 lore raw
Quoted 17 lines · Rafael J. Wysocki
Quoted 16 lines · Jiri Kosina
Quoted 12 lines · Vitaly Kuznetsov

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)
---
 drivers/hid/hid-hyperv.c              | 2 +-
Quoted 6 lines
Quoted 3 lines

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

Signature · 1 line
Vitaly