From: Aurelien Chartier <aurelien.chartier@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Aurelien Chartier <aurelien.chartier@citrix.com>,
stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com,
JBeulich@suse.com, konrad.wilk@oracle.com
Subject: [PATCH 2/2] xenbus: bypass xenbus frontend resume if xenstored is not running
Date: Wed, 1 May 2013 13:57:22 +0100 [thread overview]
Message-ID: <1367413042-13987-3-git-send-email-aurelien.chartier@citrix.com> (raw)
In-Reply-To: <1367413042-13987-1-git-send-email-aurelien.chartier@citrix.com>
If the xenbus frontend is running in a domain running xenstored or in dom0,
the device resume is hanging because it is happening before the process
resume. This patch adds extra logic to the resume code to check if we are
the domain running xenstored or dom0.
The frontend will be reconnected later, when the backend resumes from S3.
This logic is working when xenstored is running in dom0, but has not been
tested with a xenstore stub domain.
---
drivers/xen/xenbus/xenbus_probe_frontend.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 3159a37..8583afe 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -89,9 +89,22 @@ static void backend_changed(struct xenbus_watch *watch,
xenbus_otherend_changed(watch, vec, len, 1);
}
+static int xenbus_frontend_dev_resume(struct device *dev)
+{
+ /*
+ * If xenstored is running in that domain, we cannot access the backend
+ * state at the moment. If we are running in dom0, the domain running
+ * xenstored is still suspended at that point
+ */
+ if (xen_initial_domain() || (xen_store_domain == XS_LOCAL))
+ return 0;
+
+ return xenbus_dev_resume(dev);
+}
+
static const struct dev_pm_ops xenbus_pm_ops = {
.suspend = xenbus_dev_suspend,
- .resume = xenbus_dev_resume,
+ .resume = xenbus_frontend_dev_resume,
.freeze = xenbus_dev_suspend,
.thaw = xenbus_dev_cancel,
.restore = xenbus_dev_resume,
next prev parent reply other threads:[~2013-05-01 12:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 12:57 [PATCH 0/2] xenbus: Fix S3 frontend resume when xenstored is not running Aurelien Chartier
2013-05-01 12:57 ` [PATCH 1/2] xenbus: save xenstore local status for later use Aurelien Chartier
2013-05-01 12:57 ` Aurelien Chartier [this message]
2013-05-02 8:24 ` [PATCH 2/2] xenbus: bypass xenbus frontend resume if xenstored is not running Ian Campbell
2013-05-02 9:21 ` Jan Beulich
2013-05-02 9:24 ` Ian Campbell
2013-05-02 10:10 ` Aurélien Chartier
2013-05-02 10:30 ` Ian Campbell
2013-05-02 12:32 ` Aurelien Chartier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367413042-13987-3-git-send-email-aurelien.chartier@citrix.com \
--to=aurelien.chartier@citrix.com \
--cc=JBeulich@suse.com \
--cc=ian.campbell@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.