From patchwork Fri Oct 23 05:03:48 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: 7469901 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 07995BEEA4 for ; Fri, 23 Oct 2015 05:06:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 366B520160 for ; Fri, 23 Oct 2015 05:06:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63FB62021F for ; Fri, 23 Oct 2015 05:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751294AbbJWFF6 (ORCPT ); Fri, 23 Oct 2015 01:05:58 -0400 Received: from foo.masarand.uk ([104.200.29.153]:36244 "EHLO foo.masarand.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096AbbJWFF5 (ORCPT ); Fri, 23 Oct 2015 01:05:57 -0400 Received: from localhost.localdomain (shredder.masarand.uk [81.187.126.108]) by foo.masarand.uk (Postfix) with ESMTPSA id 6E43DAA60; Fri, 23 Oct 2015 06:05:56 +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 15/29] cris/PCI: Defer IRQ assignment to device enable time Date: Fri, 23 Oct 2015 06:03:48 +0100 Message-Id: <1445576642-29624-16-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 PCI IRQs are currently configured to be enabled once at boot in a dedicated pass. This means that PCI devices which are hot-plugged after boot time will not be given an IRQ, this patch-set fixes this by registering the assignment function to be called later in the device enable path. Signed-off-by: Matthew Minter --- arch/cris/arch-v32/drivers/pci/bios.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c index 64a5fb9..2b7b79f 100644 --- a/arch/cris/arch-v32/drivers/pci/bios.c +++ b/arch/cris/arch-v32/drivers/pci/bios.c @@ -80,9 +80,10 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask) return 0; } -int pcibios_enable_irq(struct pci_dev *dev) +int pcibios_enable_irq(struct pci_dev *dev, u8 slot, u8 pin) { - dev->irq = EXT_INTR_VECT; + if (!dev->msi_enabled) + dev->irq = EXT_INTR_VECT; return 0; } @@ -92,8 +93,11 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) if ((err = pcibios_enable_resources(dev, mask)) < 0) return err; + return 0; +} - if (!dev->msi_enabled) - pcibios_enable_irq(dev); +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) +{ + bridge->map_irq = pcibios_enable_irq; return 0; }