Skip to content

Commit ff32baa

Browse files
meithecatteBoris Ostrovsky
authored andcommitted
xen: don't hang when resuming PCI device
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]>
1 parent 309b517 commit ff32baa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/xen/manage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ static void do_suspend(void)
141141

142142
raw_notifier_call_chain(&xen_resume_notifier, 0, NULL);
143143

144+
xen_arch_resume();
145+
144146
dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
145147

146148
if (err) {
147149
pr_err("failed to start xen_suspend: %d\n", err);
148150
si.cancelled = 1;
149151
}
150152

151-
xen_arch_resume();
152-
153153
out_resume:
154154
if (!si.cancelled)
155155
xs_resume();

0 commit comments

Comments
 (0)