aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-31 14:37:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-31 14:37:43 -0400
commitf66d95d69db3a329354bf29ebe5fc73862d2c60a (patch)
treedc67a40dc794ce2bdfb035776bcbb2f3ec29320c /drivers/xen
parent878d2cd6738f65907da0136325e4060b2d2ece14 (diff)
parent741ddbcfd26f192b0677961385b599aa785f8119 (diff)
Merge tag 'stable/for-linus-3.11-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull Xen fixes from Konrad Rzeszutek Wilk: - Three fixes for ARM/ARM64 to either compile or not certain generic drivers - Fix for avoiding a potential deadlock when an user space event channel is destroyed. - Fix a workqueue resuming multiple times. * tag 'stable/for-linus-3.11-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/tmem: do not allow XEN_TMEM on ARM64 xen/evtchn: avoid a deadlock when unbinding an event channel xen/arm: enable PV control for ARM xen/arm64: Don't compile cpu hotplug xenbus: frontend resume cleanup
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/Kconfig2
-rw-r--r--drivers/xen/Makefile5
-rw-r--r--drivers/xen/evtchn.c21
-rw-r--r--drivers/xen/xenbus/xenbus_probe_frontend.c19
4 files changed, 21 insertions, 26 deletions
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 9e02d60a364b..23eae5cb69c2 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -145,7 +145,7 @@ config SWIOTLB_XEN
145 145
146config XEN_TMEM 146config XEN_TMEM
147 tristate 147 tristate
148 depends on !ARM 148 depends on !ARM && !ARM64
149 default m if (CLEANCACHE || FRONTSWAP) 149 default m if (CLEANCACHE || FRONTSWAP)
150 help 150 help
151 Shim to interface in-kernel Transcendent Memory hooks 151 Shim to interface in-kernel Transcendent Memory hooks
diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
index eabd0ee1c2bc..14fe79d8634a 100644
--- a/drivers/xen/Makefile
+++ b/drivers/xen/Makefile
@@ -1,9 +1,8 @@
1ifneq ($(CONFIG_ARM),y) 1ifeq ($(filter y, $(CONFIG_ARM) $(CONFIG_ARM64)),)
2obj-y += manage.o
3obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o 2obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
4endif 3endif
5obj-$(CONFIG_X86) += fallback.o 4obj-$(CONFIG_X86) += fallback.o
6obj-y += grant-table.o features.o events.o balloon.o 5obj-y += grant-table.o features.o events.o balloon.o manage.o
7obj-y += xenbus/ 6obj-y += xenbus/
8 7
9nostackp := $(call cc-option, -fno-stack-protector) 8nostackp := $(call cc-option, -fno-stack-protector)
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index 8feecf01d55c..b6165e047f48 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -379,18 +379,12 @@ static long evtchn_ioctl(struct file *file,
379 if (unbind.port >= NR_EVENT_CHANNELS) 379 if (unbind.port >= NR_EVENT_CHANNELS)
380 break; 380 break;
381 381
382 spin_lock_irq(&port_user_lock);
383
384 rc = -ENOTCONN; 382 rc = -ENOTCONN;
385 if (get_port_user(unbind.port) != u) { 383 if (get_port_user(unbind.port) != u)
386 spin_unlock_irq(&port_user_lock);
387 break; 384 break;
388 }
389 385
390 disable_irq(irq_from_evtchn(unbind.port)); 386 disable_irq(irq_from_evtchn(unbind.port));
391 387
392 spin_unlock_irq(&port_user_lock);
393
394 evtchn_unbind_from_user(u, unbind.port); 388 evtchn_unbind_from_user(u, unbind.port);
395 389
396 rc = 0; 390 rc = 0;
@@ -490,26 +484,15 @@ static int evtchn_release(struct inode *inode, struct file *filp)
490 int i; 484 int i;
491 struct per_user_data *u = filp->private_data; 485 struct per_user_data *u = filp->private_data;
492 486
493 spin_lock_irq(&port_user_lock);
494
495 free_page((unsigned long)u->ring);
496
497 for (i = 0; i < NR_EVENT_CHANNELS; i++) { 487 for (i = 0; i < NR_EVENT_CHANNELS; i++) {
498 if (get_port_user(i) != u) 488 if (get_port_user(i) != u)
499 continue; 489 continue;
500 490
501 disable_irq(irq_from_evtchn(i)); 491 disable_irq(irq_from_evtchn(i));
502 }
503
504 spin_unlock_irq(&port_user_lock);
505
506 for (i = 0; i < NR_EVENT_CHANNELS; i++) {
507 if (get_port_user(i) != u)
508 continue;
509
510 evtchn_unbind_from_user(get_port_user(i), i); 492 evtchn_unbind_from_user(get_port_user(i), i);
511 } 493 }
512 494
495 free_page((unsigned long)u->ring);
513 kfree(u->name); 496 kfree(u->name);
514 kfree(u); 497 kfree(u);
515 498
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}