Skip to content
/ linux Public

Commit 7fb2e1f

Browse files
jandryukSasha Levin
authored andcommitted
xenbus: Use .freeze/.thaw to handle xenbus devices
[ Upstream commit e08dd1e ] The goal is to fix s2idle and S3 for Xen PV devices. A domain resuming from s3 or s2idle disconnects its PV devices during resume. The backends are not expecting this and do not reconnect. b3e96c0 ("xen: use freeze/restore/thaw PM events for suspend/ resume/chkpt") changed xen_suspend()/do_suspend() from PMSG_SUSPEND/PMSG_RESUME to PMSG_FREEZE/PMSG_THAW/PMSG_RESTORE, but the suspend/resume callbacks remained. .freeze/restore are used with hiberation where Linux restarts in a new place in the future. .suspend/resume are useful for runtime power management for the duration of a boot. The current behavior of the callbacks works for an xl save/restore or live migration where the domain is restored/migrated to a new location and connecting to a not-already-connected backend. Change xenbus_pm_ops to use .freeze/thaw/restore and drop the .suspend/resume hook. This matches the use in drivers/xen/manage.c for save/restore and live migration. With .suspend/resume empty, PV devices are left connected during s2idle and s3, so PV devices are not changed and work after resume. Signed-off-by: Jason Andryuk <jason.andryuk@amd.com> Acked-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> Message-ID: <20251119224731.61497-2-jason.andryuk@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6ac7d51 commit 7fb2e1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/xen/xenbus/xenbus_probe_frontend.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,9 @@ static void xenbus_frontend_dev_shutdown(struct device *_dev)
148148
}
149149

150150
static const struct dev_pm_ops xenbus_pm_ops = {
151-
.suspend = xenbus_dev_suspend,
152-
.resume = xenbus_frontend_dev_resume,
153151
.freeze = xenbus_dev_suspend,
154152
.thaw = xenbus_dev_cancel,
155-
.restore = xenbus_dev_resume,
153+
.restore = xenbus_frontend_dev_resume,
156154
};
157155

158156
static struct xen_bus_type xenbus_frontend = {

0 commit comments

Comments
 (0)