From patchwork Thu Oct 2 03:50:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: matt@masarand.com X-Patchwork-Id: 5015561 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A9F45BEEA6 for ; Thu, 2 Oct 2014 03:59:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B50FA2021A for ; Thu, 2 Oct 2014 03:59:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C947120200 for ; Thu, 2 Oct 2014 03:59:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751031AbaJBD7c (ORCPT ); Wed, 1 Oct 2014 23:59:32 -0400 Received: from foo.masarand.uk ([69.164.217.139]:56323 "EHLO foo.masarand.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbaJBD7Y (ORCPT ); Wed, 1 Oct 2014 23:59:24 -0400 Received: from shredder.masarand.uk (shredder.masarand.uk [81.187.126.108]) by foo.masarand.uk (Postfix) with ESMTPSA id C322DA16E; Thu, 2 Oct 2014 04:51:03 +0100 (BST) From: matt@masarand.com To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, Vality Subject: [PATCH 06/18] Delayed alpha setup of PCI IRQs to bus scan time Date: Thu, 2 Oct 2014 04:50:25 +0100 Message-Id: <1412221837-17452-7-git-send-email-matt@masarand.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1412221837-17452-1-git-send-email-matt@masarand.com> References: <1412221837-17452-1-git-send-email-matt@masarand.com> Signed-off-by: Matthew Minter Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Vality PCI IRQ initialisation is currently run during the boot code on alpha, this has the issue that firstly an extra pass over the PCI bus is required and second hot-plugged devices which are added after boot have no way to be assigned an IRQ. This patch set fixes this by defering the assignment of PCI IRQs untill device enable time which should solve both of these issues. --- arch/alpha/kernel/pci.c | 16 ++++++++++------ arch/alpha/kernel/sys_nautilus.c | 1 - 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 076c35c..338537c 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -28,7 +28,7 @@ /* - * Some string constants used by the various core logics. + * Some string constants used by the various core logics. */ const char *const pci_io_names[] = { @@ -247,7 +247,7 @@ void pcibios_fixup_bus(struct pci_bus *bus) if (pci_has_flag(PCI_PROBE_ONLY) && dev && (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { pci_read_bridge_bases(bus); - } + } list_for_each_entry(dev, &bus->devices, bus_list) { pdev_save_srm_config(dev); @@ -338,7 +338,7 @@ common_init_pci(void) hose->need_domain_info = need_domain_info; next_busno = bus->busn_res.end + 1; /* Don't allow 8-bit bus number overflow inside the hose - - reserve some space for bridges. */ + reserve some space for bridges. */ if (next_busno > 224) { next_busno = 0; need_domain_info = 1; @@ -346,11 +346,15 @@ common_init_pci(void) } pcibios_claim_console_setup(); - pci_assign_unassigned_resources(); - pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq); } +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) +{ + bridge->swizzle_irq = alpha_mv.pci_swizzle; + bridge->map_irq = alpha_mv.pci_map_irq; + return 0; +} struct pci_controller * __init alloc_pci_controller(void) @@ -387,7 +391,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) /* from hose or from bus.devfn */ if (which & IOBASE_FROM_HOSE) { - for(hose = hose_head; hose; hose = hose->next) + for(hose = hose_head; hose; hose = hose->next) if (hose->index == bus) break; if (!hose) return -ENODEV; } else { diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c index 837c0fa..7fb4d51 100644 --- a/arch/alpha/kernel/sys_nautilus.c +++ b/arch/alpha/kernel/sys_nautilus.c @@ -252,7 +252,6 @@ nautilus_init_pci(void) /* pci_common_swizzle() relies on bus->self being NULL for the root bus, so just clear it. */ bus->self = NULL; - pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq); } /*