From: julien.grall@linaro.org (Julien Grall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] arm/xen: Correctly check if the event channel interrupt is present
Date: Wed, 18 Feb 2015 13:51:51 +0000 [thread overview]
Message-ID: <1424267513-15836-2-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1424267513-15836-1-git-send-email-julien.grall@linaro.org>
The function irq_of_parse_and_map returns 0 when the IRQ is not found.
Futhermore, move the check before notifying the user that we are running on
Xen.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
Changes in v2:
- Add Ian's ack
- Re-add __read_mostly
---
arch/arm/xen/enlighten.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 263a204..c8d3a17 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callback);
int xen_platform_pci_unplug = XEN_UNPLUG_ALL;
EXPORT_SYMBOL_GPL(xen_platform_pci_unplug);
-static __read_mostly int xen_events_irq = -1;
+static __read_mostly unsigned int xen_events_irq;
/* map fgmfn of domid to lpfn in the current domain */
static int map_foreign_page(unsigned long lpfn, unsigned long fgmfn,
@@ -251,12 +251,14 @@ static int __init xen_guest_init(void)
return 0;
grant_frames = res.start;
xen_events_irq = irq_of_parse_and_map(node, 0);
+ if (!xen_events_irq) {
+ pr_debug("Xen event channel interrupt not found\n");
+ return -ENODEV;
+ }
+
pr_info("Xen %s support found, events_irq=%d gnttab_frame=%pa\n",
version, xen_events_irq, &grant_frames);
- if (xen_events_irq < 0)
- return -ENODEV;
-
xen_domain_type = XEN_HVM_DOMAIN;
xen_setup_features();
--
2.1.4
next prev parent reply other threads:[~2015-02-18 13:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 13:51 [PATCH v2 0/3] arm/arm64: Detect Xen support earlier Julien Grall
2015-02-18 13:51 ` Julien Grall [this message]
2015-02-26 18:08 ` [PATCH v2 1/3] arm/xen: Correctly check if the event channel interrupt is present Stefano Stabellini
2015-02-18 13:51 ` [PATCH v2 2/3] arm,arm64/xen: move Xen initialization earlier Julien Grall
2015-04-07 17:26 ` Stefano Stabellini
2015-05-06 14:04 ` Stefano Stabellini
2015-02-18 13:51 ` [PATCH v2 3/3] xen/arm: allow console=hvc0 to be omitted for guests Julien Grall
2015-02-18 15:25 ` Ian Campbell
2015-02-18 15:50 ` Rob Herring
2015-02-18 16:03 ` Ian Campbell
2015-02-26 18:22 ` Stefano Stabellini
2015-02-27 9:34 ` Ian Campbell
2015-02-27 9:47 ` Stefano Stabellini
2015-02-25 16:22 ` [PATCH v2 0/3] arm/arm64: Detect Xen support earlier Julien Grall
2015-02-25 16:34 ` Will Deacon
2015-02-25 16:38 ` Julien Grall
2015-02-25 16:40 ` [Xen-devel] " Ian Campbell
2015-02-25 18:01 ` Will Deacon
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=1424267513-15836-2-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).