]> Git Repo - linux.git/commitdiff
xen: don't hang when resuming PCI device
authorJakub Kądziołka <[email protected]>
Wed, 23 Mar 2022 01:21:03 +0000 (02:21 +0100)
committerBoris Ostrovsky <[email protected]>
Fri, 25 Mar 2022 19:22:15 +0000 (14:22 -0500)
If a xen domain with at least two VCPUs has a PCI device attached which
enters the D3hot state during suspend, the kernel may hang while
resuming, depending on the core on which an async resume task gets
scheduled.

The bug occurs because xen's do_suspend calls dpm_resume_start while
only the timer of the boot CPU has been resumed (when xen_suspend called
syscore_resume), before calling xen_arch_suspend to resume the timers of
the other CPUs. This breaks pci_dev_d3_sleep.

Thus this patch moves the call to xen_arch_resume before the call to
dpm_resume_start, eliminating the hangs and restoring the stack-like
structure of the suspend/restore procedure.

Signed-off-by: Jakub Kądziołka <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Boris Ostrovsky <[email protected]>
drivers/xen/manage.c

index 374d36de7f5a45b698e39e506afa9ea6cd03be13..3d5a384d65f7627e3fa9e7f7459ace5ff14cd63b 100644 (file)
@@ -141,6 +141,8 @@ static void do_suspend(void)
 
        raw_notifier_call_chain(&xen_resume_notifier, 0, NULL);
 
+       xen_arch_resume();
+
        dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
 
        if (err) {
@@ -148,8 +150,6 @@ static void do_suspend(void)
                si.cancelled = 1;
        }
 
-       xen_arch_resume();
-
 out_resume:
        if (!si.cancelled)
                xs_resume();
This page took 0.060709 seconds and 4 git commands to generate.