Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2012-03-23 10:36:41 +0100
committerJan Beulich <jbeulich@novell.com>2012-03-23 10:36:41 +0100
commit2b75e1f11ec6fb9bb0d00a29d8ab05b91b91a8f7 (patch)
tree75800a3d5a6e98efbd7874c11c954832c513628d
parent056312cab77dbec96379f065a737e3fff18115e0 (diff)
- Update Xen patches to 3.3 final and c/s 1165.
-rw-r--r--drivers/watchdog/xen_wdt.c18
-rw-r--r--drivers/xen/blkback/blkback.c30
-rw-r--r--drivers/xen/blkback/common.h14
-rw-r--r--drivers/xen/blkback/xenbus.c120
-rw-r--r--drivers/xen/console/console.c11
-rw-r--r--drivers/xen/console/xencons.h12
-rw-r--r--drivers/xen/console/xencons_ring.c48
-rw-r--r--drivers/xen/core/smpboot.c32
-rw-r--r--drivers/xen/netfront/netfront.c4
-rw-r--r--drivers/xen/xenbus/xenbus_probe.c10
-rw-r--r--drivers/xen/xenbus/xenbus_probe_backend.c26
-rw-r--r--drivers/xen/xenbus/xenbus_xs.c12
-rw-r--r--include/xen/xencons.h9
13 files changed, 162 insertions, 184 deletions
diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c
index 0c619dd6d81e..3c6b8d647a34 100644
--- a/drivers/watchdog/xen_wdt.c
+++ b/drivers/watchdog/xen_wdt.c
@@ -2,6 +2,7 @@
* Xen Watchdog Driver
*
* (c) Copyright 2010,2011 Novell, Inc.
+ * (c) Copyright 2011,2012 SuSE
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -133,15 +134,17 @@ static int xen_wdt_open(struct inode *inode, struct file *file)
static int xen_wdt_release(struct inode *inode, struct file *file)
{
+ int err = 0;
+
if (expect_release)
- xen_wdt_stop();
+ err = xen_wdt_stop();
else {
pr_crit("unexpected close, not stopping watchdog!\n");
xen_wdt_kick();
}
- is_active = false;
+ is_active = err;
expect_release = false;
- return 0;
+ return err;
}
static ssize_t xen_wdt_write(struct file *file, const char __user *data,
@@ -297,11 +300,18 @@ static void xen_wdt_shutdown(struct platform_device *dev)
static int xen_wdt_suspend(struct platform_device *dev, pm_message_t state)
{
- return xen_wdt_stop();
+ typeof(wdt.id) id = wdt.id;
+ int rc = xen_wdt_stop();
+
+ wdt.id = id;
+ return rc;
}
static int xen_wdt_resume(struct platform_device *dev)
{
+ if (!wdt.id)
+ return 0;
+ wdt.id = 0;
return xen_wdt_start();
}
diff --git a/drivers/xen/blkback/blkback.c b/drivers/xen/blkback/blkback.c
index c4f5656e6392..4ed8696c4f4b 100644
--- a/drivers/xen/blkback/blkback.c
+++ b/drivers/xen/blkback/blkback.c
@@ -258,26 +258,24 @@ int blkif_schedule(void *arg)
static void do_discard(blkif_t *blkif, struct blkif_request_discard *req)
{
- int err = -EOPNOTSUPP;
int status = BLKIF_RSP_OKAY;
- struct block_device *bdev = blkif->vbd.bdev;
-
- if (blkif->blk_backend_type == BLKIF_BACKEND_PHY ||
- blkif->blk_backend_type == BLKIF_BACKEND_FILE) {
- unsigned long secure = (blkif->vbd.discard_secure &&
- (req->flag & BLKIF_DISCARD_SECURE)) ?
- BLKDEV_DISCARD_SECURE : 0;
-
- err = blkdev_issue_discard(bdev, req->sector_number,
- req->nr_sectors, GFP_KERNEL,
- secure);
- }
-
- if (err == -EOPNOTSUPP) {
+ unsigned long secure = (blkif->vbd.discard_secure &&
+ (req->flag & BLKIF_DISCARD_SECURE)) ?
+ BLKDEV_DISCARD_SECURE : 0;
+
+ switch (blkdev_issue_discard(blkif->vbd.bdev, req->sector_number,
+ req->nr_sectors, GFP_KERNEL, secure))
+ {
+ case 0:
+ break;
+ case -EOPNOTSUPP:
DPRINTK("discard op failed, not supported\n");
status = BLKIF_RSP_EOPNOTSUPP;
- } else if (err)
+ break;
+ default:
status = BLKIF_RSP_ERROR;
+ break;
+ }
make_response(blkif, req->id, req->operation, status);
}
diff --git a/drivers/xen/blkback/common.h b/drivers/xen/blkback/common.h
index 11467704b2d4..0b49cbcc341c 100644
--- a/drivers/xen/blkback/common.h
+++ b/drivers/xen/blkback/common.h
@@ -42,11 +42,6 @@
pr_debug("(file=%s, line=%d) " _f, \
__FILE__ , __LINE__ , ## _a )
-enum blkif_backend_type {
- BLKIF_BACKEND_PHY = 1,
- BLKIF_BACKEND_FILE = 2,
-};
-
struct vbd {
blkif_vdev_t handle; /* what the domain refers to this vbd as */
fmode_t mode; /* FMODE_xxx */
@@ -68,7 +63,6 @@ typedef struct blkif_st {
unsigned int irq;
/* Comms information. */
enum blkif_protocol blk_protocol;
- enum blkif_backend_type blk_backend_type;
blkif_back_rings_t blk_rings;
struct vm_struct *blk_ring_area;
/* The VBD attached to this interface. */
@@ -150,10 +144,10 @@ void blkif_xenbus_init(void);
irqreturn_t blkif_be_int(int irq, void *dev_id);
int blkif_schedule(void *arg);
-int blkback_barrier(struct xenbus_transaction xbt,
- struct backend_info *be, int state);
-int blkback_flush_diskcache(struct xenbus_transaction,
- struct backend_info *, int state);
+void blkback_barrier(struct xenbus_transaction, struct backend_info *,
+ int state);
+void blkback_flush_diskcache(struct xenbus_transaction,
+ struct backend_info *, int state);
/* cdrom media change */
void cdrom_add_media_watch(struct backend_info *be);
diff --git a/drivers/xen/blkback/xenbus.c b/drivers/xen/blkback/xenbus.c
index 8bcde7a7c503..a348d1db9520 100644
--- a/drivers/xen/blkback/xenbus.c
+++ b/drivers/xen/blkback/xenbus.c
@@ -213,97 +213,65 @@ static int blkback_remove(struct xenbus_device *dev)
return 0;
}
-int blkback_barrier(struct xenbus_transaction xbt,
- struct backend_info *be, int state)
+void blkback_barrier(struct xenbus_transaction xbt,
+ struct backend_info *be, int state)
{
struct xenbus_device *dev = be->dev;
- int err;
+ int err = xenbus_printf(xbt, dev->nodename, "feature-barrier",
+ "%d", state);
- err = xenbus_printf(xbt, dev->nodename, "feature-barrier",
- "%d", state);
if (err)
- xenbus_dev_fatal(dev, err, "writing feature-barrier");
-
- return err;
+ xenbus_dev_error(dev, err, "writing feature-barrier");
}
-int blkback_flush_diskcache(struct xenbus_transaction xbt,
- struct backend_info *be, int state)
+void blkback_flush_diskcache(struct xenbus_transaction xbt,
+ struct backend_info *be, int state)
{
struct xenbus_device *dev = be->dev;
- int err;
+ int err = xenbus_printf(xbt, dev->nodename, "feature-flush-cache",
+ "%d", state);
- err = xenbus_printf(xbt, dev->nodename, "feature-flush-cache",
- "%d", state);
if (err)
- xenbus_dev_fatal(dev, err, "writing feature-flush-cache");
-
- return err;
+ xenbus_dev_error(dev, err, "writing feature-flush-cache");
}
-static int xen_blkbk_discard(struct xenbus_transaction xbt,
- struct backend_info *be)
+static void blkback_discard(struct xenbus_transaction xbt,
+ struct backend_info *be)
{
struct xenbus_device *dev = be->dev;
- blkif_t *blkif = be->blkif;
- char *type;
- int err;
- int state = 0;
-
- type = xenbus_read(XBT_NIL, dev->nodename, "type", NULL);
- if (!IS_ERR(type)) {
- if (strncmp(type, "file", 4) == 0) {
+ struct vbd *vbd = &be->blkif->vbd;
+ struct request_queue *q = bdev_get_queue(vbd->bdev);
+ int err, state = 0;
+
+ if (blk_queue_discard(q)) {
+ err = xenbus_printf(xbt, dev->nodename, "discard-granularity",
+ "%u", q->limits.discard_granularity);
+ if (!err)
state = 1;
- blkif->blk_backend_type = BLKIF_BACKEND_FILE;
- }
- if (strncmp(type, "phy", 3) == 0) {
- struct request_queue *q;
-
- q = bdev_get_queue(blkif->vbd.bdev);
- if (blk_queue_discard(q)) {
- err = xenbus_printf(xbt, dev->nodename,
- "discard-granularity", "%u",
- q->limits.discard_granularity);
- if (err) {
- xenbus_dev_fatal(dev, err,
- "writing discard-granularity");
- goto kfree;
- }
- err = xenbus_printf(xbt, dev->nodename,
- "discard-alignment", "%u",
- q->limits.discard_alignment);
- if (err) {
- xenbus_dev_fatal(dev, err,
- "writing discard-alignment");
- goto kfree;
- }
- state = 1;
- blkif->blk_backend_type = BLKIF_BACKEND_PHY;
- }
- /* Optional. */
- err = xenbus_printf(xbt, dev->nodename,
- "discard-secure", "%d",
- blkif->vbd.discard_secure);
- if (err) {
- xenbus_dev_fatal(dev, err,
- "writing discard-secure");
- goto kfree;
- }
+ else
+ xenbus_dev_error(dev, err,
+ "writing discard-granularity");
+ err = xenbus_printf(xbt, dev->nodename, "discard-alignment",
+ "%u", q->limits.discard_alignment);
+ if (err) {
+ xenbus_dev_error(dev, err,
+ "writing discard-alignment");
+ state = 0;
}
- } else {
- err = PTR_ERR(type);
- xenbus_dev_fatal(dev, err, "reading type");
- goto out;
+ }
+
+ /* Optional. */
+ if (state) {
+ err = xenbus_printf(xbt, dev->nodename, "discard-secure",
+ "%d", vbd->discard_secure);
+ if (err)
+ xenbus_dev_error(dev, err, "writing discard-secure");
}
err = xenbus_printf(xbt, dev->nodename, "feature-discard",
"%d", state);
if (err)
- xenbus_dev_fatal(dev, err, "writing feature-discard");
-kfree:
- kfree(type);
-out:
- return err;
+ xenbus_dev_error(dev, err, "writing feature-discard");
}
/**
@@ -535,15 +503,9 @@ again:
return;
}
- err = blkback_flush_diskcache(xbt, be, be->blkif->vbd.flush_support);
- if (err)
- goto abort;
-
- err = blkback_barrier(xbt, be, be->blkif->vbd.flush_support);
- if (err)
- goto abort;
-
- err = xen_blkbk_discard(xbt, be);
+ blkback_flush_diskcache(xbt, be, be->blkif->vbd.flush_support);
+ blkback_barrier(xbt, be, be->blkif->vbd.flush_support);
+ blkback_discard(xbt, be);
err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu",
vbd_size(&be->blkif->vbd));
diff --git a/drivers/xen/console/console.c b/drivers/xen/console/console.c
index 7f6ec016ef11..aef55bb44f75 100644
--- a/drivers/xen/console/console.c
+++ b/drivers/xen/console/console.c
@@ -39,7 +39,6 @@
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/major.h>
-#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/mm.h>
#include <linux/slab.h>
@@ -47,15 +46,9 @@
#include <linux/console.h>
#include <linux/sysrq.h>
#include <linux/vt.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/uaccess.h>
#include <xen/interface/xen.h>
#include <xen/interface/event_channel.h>
-#include <asm/hypervisor.h>
-#include <xen/evtchn.h>
-#include <xen/xenbus.h>
-#include <xen/xencons.h>
+#include "xencons.h"
/*
* Modes:
@@ -244,7 +237,7 @@ console_initcall(xen_console_init);
#ifdef CONFIG_XEN_PRIVILEGED_GUEST
/*** Useful function for console debugging -- goes straight to Xen. ***/
-asmlinkage int xprintk(const char *fmt, ...)
+int xprintk(const char *fmt, ...)
{
va_list args;
int printk_len;
diff --git a/drivers/xen/console/xencons.h b/drivers/xen/console/xencons.h
new file mode 100644
index 000000000000..1b2ee66a7929
--- /dev/null
+++ b/drivers/xen/console/xencons.h
@@ -0,0 +1,12 @@
+#include <xen/evtchn.h>
+#include <xen/xencons.h>
+
+void xencons_force_flush(void);
+
+/* Interrupt work hooks. Receive data, or kick data out. */
+struct pt_regs;
+void xencons_rx(char *buf, unsigned len);
+void xencons_tx(void);
+
+int xencons_ring_init(void);
+int xencons_ring_send(const char *data, unsigned len);
diff --git a/drivers/xen/console/xencons_ring.c b/drivers/xen/console/xencons_ring.c
index 988a31b385e2..01651e34e0f5 100644
--- a/drivers/xen/console/xencons_ring.c
+++ b/drivers/xen/console/xencons_ring.c
@@ -25,26 +25,9 @@
*/
#include <linux/errno.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
#include <linux/interrupt.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/serial.h>
-#include <linux/major.h>
-#include <linux/ptrace.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-
-#include <asm/hypervisor.h>
-#include <xen/evtchn.h>
-#include <xen/xencons.h>
-#include <linux/wait.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/err.h>
#include <xen/interface/io/console.h>
+#include "xencons.h"
static int xencons_irq;
@@ -106,17 +89,15 @@ static irqreturn_t handle_input(int irq, void *unused)
return IRQ_HANDLED;
}
-int xencons_ring_init(void)
+int
+#ifndef CONFIG_PM_SLEEP
+__init
+#endif
+xencons_ring_init(void)
{
int irq;
- if (xencons_irq)
- unbind_from_irqhandler(xencons_irq, NULL);
- xencons_irq = 0;
-
- if (!is_running_on_xen() ||
- is_initial_xendomain() ||
- !xen_start_info->console.domU.evtchn)
+ if (!xen_start_info->console.domU.evtchn)
return -ENODEV;
irq = bind_caller_port_to_irqhandler(
@@ -129,13 +110,20 @@ int xencons_ring_init(void)
xencons_irq = irq;
- /* In case we have in-flight data after save/restore... */
- notify_daemon();
-
return 0;
}
+#ifdef CONFIG_PM_SLEEP
void xencons_resume(void)
{
- (void)xencons_ring_init();
+ if (xencons_irq)
+ unbind_from_irqhandler(xencons_irq, NULL);
+ xencons_irq = 0;
+
+ if (is_running_on_xen() && !is_initial_xendomain())
+ xencons_ring_init();
+
+ /* In case we have in-flight data after save/restore... */
+ notify_daemon();
}
+#endif
diff --git a/drivers/xen/core/smpboot.c b/drivers/xen/core/smpboot.c
index 099401b8985f..b6e53037ed83 100644
--- a/drivers/xen/core/smpboot.c
+++ b/drivers/xen/core/smpboot.c
@@ -128,7 +128,6 @@ static int __cpuinit xen_smp_intr_init(unsigned int cpu)
return rc;
}
-#ifdef CONFIG_HOTPLUG_CPU
static void __cpuinit xen_smp_intr_exit(unsigned int cpu)
{
if (cpu != 0)
@@ -137,16 +136,21 @@ static void __cpuinit xen_smp_intr_exit(unsigned int cpu)
unbind_from_per_cpu_irq(ipi_irq, cpu, NULL);
xen_spinlock_cleanup(cpu);
}
-#endif
static void __cpuinit cpu_bringup(void)
{
+ unsigned int cpu;
+
cpu_init();
identify_secondary_cpu(__this_cpu_ptr(&cpu_info));
touch_softlockup_watchdog();
preempt_disable();
xen_setup_cpu_clockevents();
- local_irq_enable();
+ cpu = smp_processor_id();
+ notify_cpu_starting(cpu);
+ ipi_call_lock_irq();
+ set_cpu_online(cpu, true);
+ ipi_call_unlock_irq();
}
static void __cpuinit cpu_bringup_and_idle(void)
@@ -363,12 +367,26 @@ int __cpuinit __cpu_up(unsigned int cpu)
if (rc)
return rc;
- set_cpu_online(cpu, true);
-
rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
- BUG_ON(rc);
+ if (!rc) {
+ /* Wait 5s total for a response. */
+ unsigned long timeout = jiffies + 5 * HZ;
+
+ while (!cpu_online(cpu) && time_before_eq(jiffies, timeout))
+ HYPERVISOR_yield();
+ if (!cpu_online(cpu)) {
+ VOID(HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL));
+ rc = -ETIMEDOUT;
+ }
+ }
- return 0;
+ if (rc) {
+ xen_smp_intr_exit(cpu);
+ if (num_online_cpus() == 1)
+ alternatives_smp_switch(0);
+ }
+
+ return rc;
}
void __ref play_dead(void)
diff --git a/drivers/xen/netfront/netfront.c b/drivers/xen/netfront/netfront.c
index fa7656efc2a9..e9a4fc221cc0 100644
--- a/drivers/xen/netfront/netfront.c
+++ b/drivers/xen/netfront/netfront.c
@@ -248,8 +248,8 @@ static void __devinit netfront_enable_arp_notify(struct netfront_info *info)
IN_DEV_CONF_SET(in_dev, ARP_NOTIFY, 1);
rtnl_unlock();
if (!in_dev)
- printk(KERN_WARNING "Cannot enable ARP notification on %s\n",
- info->xbdev->nodename);
+ pr_warn("Cannot enable ARP notification on %s\n",
+ info->xbdev->nodename);
#endif
}
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index c37b511c874f..ceeece98e15d 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -794,7 +794,7 @@ static struct xenbus_watch fe_watch = {
.callback = frontend_changed,
};
-static int suspend_dev(struct device *dev, void *data)
+static int __maybe_unused suspend_dev(struct device *dev, void *data)
#else
int xenbus_dev_suspend(struct device *dev)
#endif
@@ -819,7 +819,7 @@ int xenbus_dev_suspend(struct device *dev)
PARAVIRT_EXPORT_SYMBOL(xenbus_dev_suspend);
#if defined(CONFIG_XEN) || defined(MODULE)
-static int suspend_cancel_dev(struct device *dev, void *data)
+static int __maybe_unused suspend_cancel_dev(struct device *dev, void *data)
{
int err = 0;
struct xenbus_driver *drv;
@@ -839,7 +839,7 @@ static int suspend_cancel_dev(struct device *dev, void *data)
return 0;
}
-static int resume_dev(struct device *dev, void *data)
+static int __maybe_unused resume_dev(struct device *dev, void *data)
#else
int xenbus_dev_resume(struct device *dev)
#endif
@@ -891,7 +891,7 @@ int xenbus_dev_cancel(struct device *dev)
return 0;
}
PARAVIRT_EXPORT_SYMBOL(xenbus_dev_cancel);
-#else
+#elif defined(CONFIG_PM_SLEEP) || defined(MODULE)
void xenbus_suspend(void)
{
DPRINTK("");
@@ -918,7 +918,7 @@ void xenbus_suspend_cancel(void)
bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, suspend_cancel_dev);
xenbus_backend_resume(suspend_cancel_dev);
}
-#endif
+#endif /* CONFIG_PM_SLEEP || MODULE */
/* A flag to determine if xenstored is 'ready' (i.e. has started) */
atomic_t xenbus_xsd_state = ATOMIC_INIT(XENBUS_XSD_UNCOMMITTED);
diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c
index 51de88f27366..e601e275916d 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -48,12 +48,12 @@
#include <asm/page.h>
#include <asm/pgtable.h>
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifndef CONFIG_XEN
#include <asm/xen/hypervisor.h>
#endif
#include <asm/hypervisor.h>
#include <xen/xenbus.h>
-#if defined(CONFIG_XEN) || defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifdef CONFIG_XEN
#include <xen/xen_proc.h>
#include <xen/evtchn.h>
#endif
@@ -191,7 +191,7 @@ static int xenbus_probe_backend(struct xen_bus_type *bus, const char *type,
return err;
}
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifndef CONFIG_XEN
static void frontend_changed(struct xenbus_watch *watch,
const char **vec, unsigned int len)
{
@@ -204,7 +204,7 @@ static struct xen_bus_type xenbus_backend = {
.levels = 3, /* backend/type/<frontend>/<id> */
.get_bus_id = backend_bus_id,
.probe = xenbus_probe_backend,
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifndef CONFIG_XEN
.otherend_changed = frontend_changed,
#else
.dev = {
@@ -218,7 +218,7 @@ static struct xen_bus_type xenbus_backend = {
.uevent = xenbus_uevent_backend,
.probe = xenbus_dev_probe,
.remove = xenbus_dev_remove,
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifdef CONFIG_XEN
.shutdown = xenbus_dev_shutdown,
#endif
.dev_attrs = xenbus_dev_attrs,
@@ -243,7 +243,7 @@ static int read_frontend_details(struct xenbus_device *xendev)
return xenbus_read_otherend_details(xendev, "frontend-id", "frontend");
}
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifndef CONFIG_XEN
int xenbus_dev_is_online(struct xenbus_device *dev)
{
int rc, val;
@@ -265,8 +265,7 @@ int xenbus_register_backend(struct xenbus_driver *drv)
}
EXPORT_SYMBOL_GPL(xenbus_register_backend);
-#if defined(CONFIG_XEN) || defined(HAVE_XEN_PLATFORM_COMPAT_H)
-
+#if defined(CONFIG_XEN) && defined(CONFIG_PM_SLEEP)
void xenbus_backend_suspend(int (*fn)(struct device *, void *))
{
DPRINTK("");
@@ -280,10 +279,9 @@ void xenbus_backend_resume(int (*fn)(struct device *, void *))
if (!xenbus_backend.error)
bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, fn);
}
-
#endif
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifndef CONFIG_XEN
static int backend_probe_and_watch(struct notifier_block *notifier,
unsigned long event,
void *data)
@@ -295,12 +293,12 @@ void xenbus_backend_probe_and_watch(void)
xenbus_probe_devices(&xenbus_backend);
register_xenbus_watch(&be_watch);
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifndef CONFIG_XEN
return NOTIFY_DONE;
#endif
}
-#if !defined(CONFIG_XEN) && !defined(HAVE_XEN_PLATFORM_COMPAT_H)
+#ifndef CONFIG_XEN
static int __init xenbus_probe_backend_init(void)
{
@@ -324,7 +322,7 @@ subsys_initcall(xenbus_probe_backend_init);
#else
-void xenbus_backend_bus_register(void)
+void __init xenbus_backend_bus_register(void)
{
xenbus_backend.error = bus_register(&xenbus_backend.bus);
if (xenbus_backend.error)
@@ -332,7 +330,7 @@ void xenbus_backend_bus_register(void)
xenbus_backend.error);
}
-void xenbus_backend_device_register(void)
+void __init xenbus_backend_device_register(void)
{
if (xenbus_backend.error)
return;
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index 320bdc1d4967..a1f7b81e9c62 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -188,6 +188,7 @@ static void transaction_end(void)
wake_up(&xs_state.transaction_wq);
}
+#if !defined(CONFIG_XEN) || defined(CONFIG_PM_SLEEP)
static void transaction_suspend(void)
{
mutex_lock(&xs_state.transaction_mutex);
@@ -199,6 +200,7 @@ static void transaction_resume(void)
{
mutex_unlock(&xs_state.transaction_mutex);
}
+#endif
void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
{
@@ -721,6 +723,7 @@ void unregister_xenbus_watch(struct xenbus_watch *watch)
}
EXPORT_SYMBOL_GPL(unregister_xenbus_watch);
+#if !defined(CONFIG_XEN) || defined(CONFIG_PM_SLEEP)
void xs_suspend(void)
{
transaction_suspend();
@@ -758,6 +761,7 @@ void xs_suspend_cancel(void)
up_write(&xs_state.watch_mutex);
mutex_unlock(&xs_state.transaction_mutex);
}
+#endif
#if defined(CONFIG_XEN) || defined(MODULE)
static int xenwatch_handle_callback(void *data)
@@ -945,7 +949,13 @@ static int xenbus_thread(void *unused)
return 0;
}
-int xs_init(void)
+int
+#ifndef MODULE
+__init
+#else
+__devinit
+#endif
+xs_init(void)
{
struct task_struct *task;
diff --git a/include/xen/xencons.h b/include/xen/xencons.h
index c5a55d60df02..f0215161599a 100644
--- a/include/xen/xencons.h
+++ b/include/xen/xencons.h
@@ -1,17 +1,12 @@
#ifndef __ASM_XENCONS_H__
#define __ASM_XENCONS_H__
+int xprintk(const char *, ...) __attribute__ ((__format__(__printf__, 1, 2)));
+
struct dom0_vga_console_info;
void dom0_init_screen_info(const struct dom0_vga_console_info *, size_t);
void xencons_force_flush(void);
void xencons_resume(void);
-/* Interrupt work hooks. Receive data, or kick data out. */
-void xencons_rx(char *buf, unsigned len);
-void xencons_tx(void);
-
-int xencons_ring_init(void);
-int xencons_ring_send(const char *data, unsigned len);
-
#endif /* __ASM_XENCONS_H__ */