From patchwork Wed Feb 18 13:51:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 44772 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7EA8A21544 for ; Wed, 18 Feb 2015 13:54:14 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id d17sf1347965eek.2 for ; Wed, 18 Feb 2015 05:54:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=uhiMa5wyL8pdbMiwPmZ2y2QfIcXOUOQv01YJkpmBYy8=; b=koO9VBomzc+ay+c+hNodNiAuQ1kgKCaBDJo/fXPTKzI8+yEIvmYkLusMVw7Nsdbf7V 04bTMDVthWrlhTjAVrDKbt8lyd9Ny3GN3c0M/2HNeNakX0T/yiuDw2CqaOpOwC+AQd3u Q46eOSCnt3799KtPfes9naxCxHl7NyvWDsX6IzxcVj3iAARrZKmERzxdyJVjP9AHwP3G uqKIDfdv9QsX9/ydzLndkcAuHa4T6Cte6zYNiy7OHlXB6NUFzlUEYqM6fRy1v2VEOcoZ TtOJg2rQJ37mDKYs3N49AvJYm/aPtPyDyh8coA5sj0vNiASe7WXdoBxZdmaBcIltAQaI OyWQ== X-Gm-Message-State: ALoCoQkIiCDW6cUnM6RUphJR8UFkXi1fCNnFyZzGID6Z13s7F2FTtj3pIaAL/961BkKigd212HJq X-Received: by 10.112.35.135 with SMTP id h7mr4269168lbj.23.1424267653662; Wed, 18 Feb 2015 05:54:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.195 with SMTP id 3ls19002lao.47.gmail; Wed, 18 Feb 2015 05:54:13 -0800 (PST) X-Received: by 10.152.3.70 with SMTP id a6mr33264389laa.71.1424267653518; Wed, 18 Feb 2015 05:54:13 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id c3si13323083lac.118.2015.02.18.05.54.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 05:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbiw7 with SMTP id w7so1160136lbi.10 for ; Wed, 18 Feb 2015 05:54:13 -0800 (PST) X-Received: by 10.112.26.110 with SMTP id k14mr33323726lbg.29.1424267653086; Wed, 18 Feb 2015 05:54:13 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2863008lbj; Wed, 18 Feb 2015 05:54:12 -0800 (PST) X-Received: by 10.236.66.33 with SMTP id g21mr3653399yhd.72.1424267651478; Wed, 18 Feb 2015 05:54:11 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id h2si21263510qaz.82.2015.02.18.05.54.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Feb 2015 05:54:11 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YO53P-0005ta-Ts; Wed, 18 Feb 2015 13:52:39 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YO53O-0005sp-Pb for xen-devel@lists.xenproject.org; Wed, 18 Feb 2015 13:52:38 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 44/9C-02997-52994E45; Wed, 18 Feb 2015 13:52:37 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-15.tower-31.messagelabs.com!1424267556!12369775!1 X-Originating-IP: [74.125.82.179] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 319 invoked from network); 18 Feb 2015 13:52:37 -0000 Received: from mail-we0-f179.google.com (HELO mail-we0-f179.google.com) (74.125.82.179) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 18 Feb 2015 13:52:37 -0000 Received: by wevm14 with SMTP id m14so1257004wev.8 for ; Wed, 18 Feb 2015 05:52:36 -0800 (PST) X-Received: by 10.194.85.129 with SMTP id h1mr37889360wjz.147.1424267555298; Wed, 18 Feb 2015 05:52:35 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id fo15sm29568440wic.19.2015.02.18.05.52.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Feb 2015 05:52:34 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com Date: Wed, 18 Feb 2015 13:51:51 +0000 Message-Id: <1424267513-15836-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424267513-15836-1-git-send-email-julien.grall@linaro.org> References: <1424267513-15836-1-git-send-email-julien.grall@linaro.org> Cc: Julien Grall , tim@xen.org, ian.campbell@citrix.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Subject: [Xen-devel] [PATCH v2 1/3] arm/xen: Correctly check if the event channel interrupt is present X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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 Acked-by: Ian Campbell --- 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();