Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757268Ab3FGWbn (ORCPT ); Fri, 7 Jun 2013 18:31:43 -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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1296 Lines: 39 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); -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/