Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933369AbbDXPpl (ORCPT ); Fri, 24 Apr 2015 11:45:41 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43670 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754876AbbDXPpV (ORCPT ); Fri, 24 Apr 2015 11:45:21 -0400 Date: Fri, 24 Apr 2015 08:44:22 -0700 From: tip-bot for Jiang Liu Message-ID: Cc: bhelgaas@google.com, rjw@rjwysocki.net, benh@kernel.crashing.org, david.a.cohen@linux.intel.com, tglx@linutronix.de, jiang.liu@linux.intel.com, konrad.wilk@oracle.com, rdunlap@infradead.org, yinghai@kernel.org, joro@8bytes.org, linux-kernel@vger.kernel.org, david.vrabel@citrix.com, sivanich@sgi.com, gregkh@linuxfoundation.org, tony.luck@intel.com, linux@eikelenboom.it, mingo@kernel.org, bp@alien8.de, hpa@zytor.com Reply-To: hpa@zytor.com, bp@alien8.de, mingo@kernel.org, tony.luck@intel.com, gregkh@linuxfoundation.org, linux@eikelenboom.it, david.vrabel@citrix.com, sivanich@sgi.com, linux-kernel@vger.kernel.org, yinghai@kernel.org, joro@8bytes.org, rdunlap@infradead.org, konrad.wilk@oracle.com, david.a.cohen@linux.intel.com, tglx@linutronix.de, benh@kernel.crashing.org, jiang.liu@linux.intel.com, rjw@rjwysocki.net, bhelgaas@google.com In-Reply-To: <1416894816-23245-5-git-send-email-jiang.liu@linux.intel.com> References: <1416894816-23245-5-git-send-email-jiang.liu@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/MSI: Use new irqdomain interfaces to allocate/ free IRQ Git-Commit-ID: 4c8f9960ee497020d0858362c81ece984bc89aa5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2975 Lines: 87 Commit-ID: 4c8f9960ee497020d0858362c81ece984bc89aa5 Gitweb: http://git.kernel.org/tip/4c8f9960ee497020d0858362c81ece984bc89aa5 Author: Jiang Liu AuthorDate: Mon, 13 Apr 2015 14:11:26 +0800 Committer: Thomas Gleixner CommitDate: Fri, 24 Apr 2015 15:36:48 +0200 x86/MSI: Use new irqdomain interfaces to allocate/free IRQ Use new irqdomain interfaces to allocate/free IRQ for PCI MSI, so we can remove GENERIC_IRQ_LEGACY_ALLOC_HWIRQ later. Signed-off-by: Jiang Liu Cc: Konrad Rzeszutek Wilk Cc: David Cohen Cc: Sander Eikelenboom Cc: David Vrabel Cc: Tony Luck Cc: Joerg Roedel Cc: Greg Kroah-Hartman Cc: Bjorn Helgaas Cc: Benjamin Herrenschmidt Cc: Rafael J. Wysocki Cc: Randy Dunlap Cc: Yinghai Lu Cc: Borislav Petkov Cc: Dimitri Sivanich Link: http://lkml.kernel.org/r/1416894816-23245-5-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/msi.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c index d6ba2d6..76cc2c9 100644 --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -146,23 +147,20 @@ int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) { struct msi_desc *msidesc; - unsigned int irq; - int node, ret; + int irq, ret; /* Multiple MSI vectors only supported with interrupt remapping */ if (type == PCI_CAP_ID_MSI && nvec > 1) return 1; - node = dev_to_node(&dev->dev); - list_for_each_entry(msidesc, &dev->msi_list, list) { - irq = irq_alloc_hwirq(node); - if (!irq) + irq = irq_domain_alloc_irqs(NULL, 1, NUMA_NO_NODE, NULL); + if (irq <= 0) return -ENOSPC; ret = setup_msi_irq(dev, msidesc, irq, 0); if (ret < 0) { - irq_free_hwirq(irq); + irq_domain_free_irqs(irq, 1); return ret; } @@ -172,7 +170,7 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) void native_teardown_msi_irq(unsigned int irq) { - irq_free_hwirq(irq); + irq_domain_free_irqs(irq, 1); } #ifdef CONFIG_DMAR_TABLE -- 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/