From patchwork Thu Feb 12 06:34:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 5817131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0C312BF440 for ; Thu, 12 Feb 2015 06:37:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 428F72017D for ; Thu, 12 Feb 2015 06:37:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7270020173 for ; Thu, 12 Feb 2015 06:37:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLnNA-0007I5-NR; Thu, 12 Feb 2015 06:35:36 +0000 Received: from mail-pa0-f44.google.com ([209.85.220.44]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLnMx-0006C2-JS for linux-arm-kernel@lists.infradead.org; Thu, 12 Feb 2015 06:35:24 +0000 Received: by mail-pa0-f44.google.com with SMTP id kq14so9337995pab.3 for ; Wed, 11 Feb 2015 22:35:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IPjXWa+Zk79x4gwumwx2ZZArfhUWO/gjmYZ/J+CscyI=; b=Ge0YgVGuYu2edIdy2WQfiMKuSggg5rcsP9BSRc5Hg78XjaDU/DCnLbWJZx8UcpI4IH xtG/7WuHGgWoYD1ks5C5d9o58plEjOjE33vnlqEByFtoZEg0Ntk6eGWOp9H+8mTEkLfd 8YmPvP/wP7ZVmfUfC/LQYIzL1zxZSYJ5PYtqGQCK288ftjUiIcz97Xa+1M5iVA6/qYPo Lwfec6ExFGtaR/Xwv07YP8lQ4fa/bguLQXsX8Rs6hUY5yj/pw0t3kMNa1EYKB3QantV6 bQ4tXu+XTSZV0lT0oFoEFgBT12yvboOouuOXcgLff6IsmeGpeCWitMk617SzHXWHsMYA sLOg== X-Gm-Message-State: ALoCoQmcL43oclbrQlsahgiEBp9+MgNHCLHVQb1UJgEJEq0xqpq44hSz0PIJFaeuQqdyR/fW9gRw X-Received: by 10.68.68.165 with SMTP id x5mr3934420pbt.23.1423722902287; Wed, 11 Feb 2015 22:35:02 -0800 (PST) Received: from localhost.localdomain.localdomain ([210.177.145.249]) by mx.google.com with ESMTPSA id dx6sm2696149pab.14.2015.02.11.22.35.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 22:35:01 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] arm/xen: Correctly check if the event channel interrupt is present Date: Thu, 12 Feb 2015 06:34:57 +0000 Message-Id: <1423722898-16110-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423722898-16110-1-git-send-email-julien.grall@linaro.org> References: <1423722898-16110-1-git-send-email-julien.grall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150211_223523_709160_91AF0EB6 X-CRM114-Status: GOOD ( 12.68 ) X-Spam-Score: -0.7 (/) Cc: ard.biesheuvel@linaro.org, ian.campbell@citrix.com, Julien Grall , stefano.stabellini@eu.citrix.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function irq_of_parse_and_map returns 0 when the IRQ is not found. Furthermore xen_events_irq is only read when the CPU is bring up, so it's not necessary to use the attribute __read_mostly. Lastly, move the check before notifying the user that we are running on Xen. Signed-off-by: Julien Grall --- 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..90101c8 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 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();