From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751859Ab3CHToq (ORCPT ); Fri, 8 Mar 2013 14:44:46 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:25898 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851Ab3CHToo (ORCPT ); Fri, 8 Mar 2013 14:44:44 -0500 Date: Fri, 8 Mar 2013 14:43:57 -0500 From: Konrad Rzeszutek Wilk To: Yinghai Lu Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Bjorn Helgaas , "Rafael J. Wysocki" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com Subject: Re: [PATCH v2 15/26] xen, irq: call irq_realloc_desc_at() at first Message-ID: <20130308194357.GA6622@phenom.dumpdata.com> References: <1360351703-20571-1-git-send-email-yinghai@kernel.org> <1360351703-20571-16-git-send-email-yinghai@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1360351703-20571-16-git-send-email-yinghai@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 08, 2013 at 11:28:12AM -0800, Yinghai Lu wrote: > We will pre-reserve irq for all gsi at first for x86, so we have to > use realloc with it. Where are the GSI's pre-allocated? > > 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 0be4df3..dda38db 100644 > --- a/drivers/xen/events.c > +++ b/drivers/xen/events.c > @@ -482,8 +482,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.7.10.4 >