From patchwork Fri Jun 7 22:31:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 2690891 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id BD45B3FC23 for ; Fri, 7 Jun 2013 22:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755822Ab3FGWbm (ORCPT ); Fri, 7 Jun 2013 18:31:42 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:51339 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932104Ab3FGWbl (ORCPT ); Fri, 7 Jun 2013 18:31:41 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r57MVH4B018058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 Jun 2013 22:31:18 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r57MVIwj019421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Jun 2013 22:31:18 GMT Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r57MVIP4006621; Fri, 7 Jun 2013 22:31:18 GMT Received: from linux-siqj.site (/10.132.126.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 07 Jun 2013 15:31:17 -0700 From: Yinghai Lu To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Bjorn Helgaas , "Rafael J. Wysocki" Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu , Konrad Rzeszutek Wilk , xen-devel@lists.xensource.com Subject: [PATCH v3 14/27] xen, irq: call irq_realloc_desc_at() at first Date: Fri, 7 Jun 2013 15:31:00 -0700 Message-Id: <1370644273-10495-15-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1370644273-10495-1-git-send-email-yinghai@kernel.org> References: <1370644273-10495-1-git-send-email-yinghai@kernel.org> X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org To make x86 irq allocation to be same with booting path and ioapic hot add path, We will pre-reserve irq for all gsi at first. We have to use realloc here, otherwise irq_alloc_desc_at will fail because bit is already get marked for pre-reserved in irq bitmaps. Signed-off-by: Yinghai Lu Cc: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xensource.com --- drivers/xen/events.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 6a6bbe4..b0caa4e 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -505,8 +505,12 @@ static int __must_check xen_allocate_irq_gsi(unsigned gsi) /* Legacy IRQ descriptors are already allocated by the arch. */ if (gsi < NR_IRQS_LEGACY) irq = gsi; - else - irq = irq_alloc_desc_at(gsi, -1); + else { + /* for x86, irq already get reserved for gsi */ + irq = irq_realloc_desc_at(gsi, -1); + if (irq < 0) + irq = irq_alloc_desc_at(gsi, -1); + } xen_irq_init(irq);