aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/xenbus/xenbus_probe_frontend.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 6ed8a9df4472..34b20bfa4e8c 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -115,7 +115,6 @@ static int xenbus_frontend_dev_resume(struct device *dev)
115 return -EFAULT; 115 return -EFAULT;
116 } 116 }
117 117
118 INIT_WORK(&xdev->work, xenbus_frontend_delayed_resume);
119 queue_work(xenbus_frontend_wq, &xdev->work); 118 queue_work(xenbus_frontend_wq, &xdev->work);
120 119
121 return 0; 120 return 0;
@@ -124,6 +123,16 @@ static int xenbus_frontend_dev_resume(struct device *dev)
124 return xenbus_dev_resume(dev); 123 return xenbus_dev_resume(dev);
125} 124}
126 125
126static int xenbus_frontend_dev_probe(struct device *dev)
127{
128 if (xen_store_domain_type == XS_LOCAL) {
129 struct xenbus_device *xdev = to_xenbus_device(dev);
130 INIT_WORK(&xdev->work, xenbus_frontend_delayed_resume);
131 }
132
133 return xenbus_dev_probe(dev);
134}
135
127static const struct dev_pm_ops xenbus_pm_ops = { 136static const struct dev_pm_ops xenbus_pm_ops = {
128 .suspend = xenbus_dev_suspend, 137 .suspend = xenbus_dev_suspend,
129 .resume = xenbus_frontend_dev_resume, 138 .resume = xenbus_frontend_dev_resume,
@@ -142,7 +151,7 @@ static struct xen_bus_type xenbus_frontend = {
142 .name = "xen", 151 .name = "xen",
143 .match = xenbus_match, 152 .match = xenbus_match,
144 .uevent = xenbus_uevent_frontend, 153 .uevent = xenbus_uevent_frontend,
145 .probe = xenbus_dev_probe, 154 .probe = xenbus_frontend_dev_probe,
146 .remove = xenbus_dev_remove, 155 .remove = xenbus_dev_remove,
147 .shutdown = xenbus_dev_shutdown, 156 .shutdown = xenbus_dev_shutdown,
148 .dev_attrs = xenbus_dev_attrs, 157 .dev_attrs = xenbus_dev_attrs,
@@ -474,7 +483,11 @@ static int __init xenbus_probe_frontend_init(void)
474 483
475 register_xenstore_notifier(&xenstore_notifier); 484 register_xenstore_notifier(&xenstore_notifier);
476 485
477 xenbus_frontend_wq = create_workqueue("xenbus_frontend"); 486 if (xen_store_domain_type == XS_LOCAL) {
487 xenbus_frontend_wq = create_workqueue("xenbus_frontend");
488 if (!xenbus_frontend_wq)
489 pr_warn("create xenbus frontend workqueue failed, S3 resume is likely to fail\n");
490 }
478 491
479 return 0; 492 return 0;
480} 493}