From patchwork Thu Jun 8 14:13:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 9775543 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7763860350 for ; Thu, 8 Jun 2017 14:14:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68BD720855 for ; Thu, 8 Jun 2017 14:14:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D0692854A; Thu, 8 Jun 2017 14:14:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB80620855 for ; Thu, 8 Jun 2017 14:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751590AbdFHOOr (ORCPT ); Thu, 8 Jun 2017 10:14:47 -0400 Received: from foss.arm.com ([217.140.101.70]:51124 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbdFHOOq (ORCPT ); Thu, 8 Jun 2017 10:14:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A5071610; Thu, 8 Jun 2017 07:14:46 -0700 (PDT) Received: from red-moon.cambridge.arm.com (red-moon.cambridge.arm.com [10.1.206.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 20D873F3E1; Thu, 8 Jun 2017 07:14:41 -0700 (PDT) From: Lorenzo Pieralisi To: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Matthew Minter , Lorenzo Pieralisi , Arnd Bergmann , Will Deacon , Russell King , Pratyush Anand , Jingoo Han , Bjorn Helgaas , Rob Herring , Simon Horman , Mingkai Hu , Tanmay Inamdar , Murali Karicheri , Bharat Kumar Gogada , Wenrui Li , Shawn Lin , Minghuan Lian , Gabriele Paoloni , Thomas Petazzoni , Joao Pinto , Thierry Reding , Michal Simek , Stanimir Varbanov , Zhou Wang , Roy Zang , Linus Walleij Subject: [RFT PATCH v2 28/42] PCI: Add a call to pci_assign_irq() in pci_device_probe() Date: Thu, 8 Jun 2017 15:13:28 +0100 Message-Id: <20170608141342.2018-29-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170608141342.2018-1-lorenzo.pieralisi@arm.com> References: <20170608141342.2018-1-lorenzo.pieralisi@arm.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Minter The pci_assign_irq() function allows assignment of an irq to devices during device enable time rather than only at boot. Therefore call it in the pci_device_probe() function during the enable device code path so this assignment can be performed. This patch will do nothing on arches which do not set the irq mapping function pointers and is therefore currently a nop, however as support for these function pointers is added to arch specific code this will cause irq assignment to migrate to device enable time allowing the new code paths to be used. Signed-off-by: Matthew Minter [lorenzo.pieralisi@arm.com: moved pci_assign_irq() call site] Signed-off-by: Lorenzo Pieralisi --- drivers/pci/pci-driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 192e7b6..11167c6 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -412,6 +412,8 @@ static int pci_device_probe(struct device *dev) struct pci_dev *pci_dev = to_pci_dev(dev); struct pci_driver *drv = to_pci_driver(dev->driver); + pci_assign_irq(pci_dev); + error = pcibios_alloc_irq(pci_dev); if (error < 0) return error;