From patchwork Fri Oct 23 05:03:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: matt@masarand.com X-Patchwork-Id: 7469981 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A62EBF90C for ; Fri, 23 Oct 2015 05:06:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3EA42021F for ; Fri, 23 Oct 2015 05:06:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4B9320251 for ; Fri, 23 Oct 2015 05:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751309AbbJWFGG (ORCPT ); Fri, 23 Oct 2015 01:06:06 -0400 Received: from foo.masarand.uk ([104.200.29.153]:36274 "EHLO foo.masarand.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751306AbbJWFGF (ORCPT ); Fri, 23 Oct 2015 01:06:05 -0400 Received: from localhost.localdomain (shredder.masarand.uk [81.187.126.108]) by foo.masarand.uk (Postfix) with ESMTPSA id 97A23AA76; Fri, 23 Oct 2015 06:06:04 +0100 (BST) From: Matthew Minter To: linux-pci@vger.kernel.org, bhelgaas@google.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, lorenzo.pieralisi@arm.com Cc: Matthew Minter Subject: [PATCH V4 23/29] tile: pci: Defer IRQ assignment to device enable time Date: Fri, 23 Oct 2015 06:03:56 +0100 Message-Id: <1445576642-29624-24-git-send-email-matt@masarand.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1445576642-29624-1-git-send-email-matt@masarand.com> References: <1445576642-29624-1-git-send-email-matt@masarand.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently pcibios_init is running pci_fixup_irqs in order to assign IRQs to PCI devices, this is only done once at boot-time and causes devices hot-plugged after boot time to not be allocated an IRQ. This is fixed in this patch-set by delaying the allocation untill device enable time by registering the function to be called later. Signed-off-by: Matthew Minter --- arch/tile/kernel/pci.c | 10 +++++++--- arch/tile/kernel/pci_gx.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index 9475a74..e151d80 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c @@ -313,9 +313,6 @@ int __init pcibios_init(void) } } - /* Do machine dependent PCI interrupt routing */ - pci_fixup_irqs(pci_common_swizzle, tile_map_irq); - /* * This comes from the generic Linux PCI driver. * @@ -369,6 +366,13 @@ int __init pcibios_init(void) } subsys_initcall(pcibios_init); +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) +{ + bridge->swizzle_irq = pci_common_swizzle; + bridge->map_irq = tile_map_irq; + return 0; +} + /* * No bus fixups needed. */ diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index 4c017d0..7eb3e2b 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c @@ -887,9 +887,6 @@ int __init pcibios_init(void) next_busno = bus->busn_res.end + 1; } - /* Do machine dependent PCI interrupt routing */ - pci_fixup_irqs(pci_common_swizzle, tile_map_irq); - /* * This comes from the generic Linux PCI driver. * @@ -1038,6 +1035,13 @@ alloc_mem_map_failed: } subsys_initcall(pcibios_init); +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) +{ + bridge->swizzle_irq = pci_common_swizzle; + bridge->map_irq = tile_map_irq; + return 0; +} + /* No bus fixups needed. */ void pcibios_fixup_bus(struct pci_bus *bus) {