From patchwork Fri Feb 8 19:28:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 2118221 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 2A03C3FD56 for ; Fri, 8 Feb 2013 19:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946873Ab3BHTgH (ORCPT ); Fri, 8 Feb 2013 14:36:07 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:26044 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946971Ab3BHT24 (ORCPT ); Fri, 8 Feb 2013 14:28:56 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r18JSccC031625 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Feb 2013 19:28:38 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r18JSbLq023690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Feb 2013 19:28:37 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r18JSaap006719; Fri, 8 Feb 2013 13:28:36 -0600 Received: from linux-siqj.site (/10.132.127.230) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 08 Feb 2013 11:28:36 -0800 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 v2 15/26] xen, irq: call irq_realloc_desc_at() at first Date: Fri, 8 Feb 2013 11:28:12 -0800 Message-Id: <1360351703-20571-16-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360351703-20571-1-git-send-email-yinghai@kernel.org> References: <1360351703-20571-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org We will pre-reserve irq for all gsi at first for x86, so we have to use realloc with it. 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);