From patchwork Fri Apr 15 17:06:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 8852611 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 55C9DBF29F for ; Fri, 15 Apr 2016 17:10:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 711B22037C for ; Fri, 15 Apr 2016 17:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23332203B7 for ; Fri, 15 Apr 2016 17:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbcDORJv (ORCPT ); Fri, 15 Apr 2016 13:09:51 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35286 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151AbcDORH3 (ORCPT ); Fri, 15 Apr 2016 13:07:29 -0400 Received: by mail-wm0-f47.google.com with SMTP id a140so40051546wma.0 for ; Fri, 15 Apr 2016 10:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aD1wNAfHhHAWBhGyDaGyUwmugPmH2rgnieveTTexQWU=; b=ZRsK/hfzqZjm0B/Ioic1S5jHKfNJ+0Eh5awW9Yp4gXyS88Ji/BrGIihOpe0Gi50kYW Werr5KSoID1wUQ9CR6s0A7p0/UE/p98pdNwmHPFQ8fcbYoZXUvE75BETxlaSlIveSXGV Eag2UehM8cT27bIB9k8Qxf4c1CA0+qhNX1nM7DhzHfACOQfI+PdQk9OHdnXGL19ZpUUH eDYlwPRPjvKmT1Xdtis8lP3upOWolPhTtplzaHN4WU3ZE0cS3UavldIrCSlCPYFsbGlj liBgw3v6cx3J2LnJP+t4H+AtJntdxNmMRnCRSUoxrY7OaTUVdx8Mw/AJL6OP3l6vCjgI LBRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aD1wNAfHhHAWBhGyDaGyUwmugPmH2rgnieveTTexQWU=; b=SVEZ7S9k0Z7aI8Nf+8ufHPirwk2scoD3pvPu+aL71qHEjTb22Wf3ruMiaxOhQT92eg y5ZdlyqAl57jApQ+J98C8AId90s7ELYH1W24aXAq2A1KFE12o2bLQEfA6coHYPJLTRiN YZ/eaeEJ0fxVpLATM45hpCETpcWlP/7HBqpEqTsrr4g1KqjpYZDqVTxgZyAUyIjV37dW c5Gt7FFtkAn3yEqccKLAdAXnNOFxn7wjrKb16RT+uNd+g2HviooPV7pDQ6uKuc7oXuWH 2pchStS8TGnFEmxrliyQU6Cq9RTH8b0u/AIiFAE9YXe3MhgzGo4cQ1pffQ5UMcKUqDg6 Fz6A== X-Gm-Message-State: AOPr4FXYT/iL2qN7U1UuE/4vJzslXYFTDTR8aOP80HIJvRp9o4w7pdalmUEot1fo3OHGzw== X-Received: by 10.28.125.8 with SMTP id y8mr5703632wmc.87.1460740043409; Fri, 15 Apr 2016 10:07:23 -0700 (PDT) Received: from tn-HP-4.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id gr4sm14282723wjd.23.2016.04.15.10.07.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Apr 2016 10:07:22 -0700 (PDT) From: Tomasz Nowicki To: helgaas@kernel.org, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, rafael@kernel.org, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com, okaya@codeaurora.org, jiang.liu@linux.intel.com, jchandra@broadcom.com Cc: robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jcm@redhat.com, Tomasz Nowicki Subject: [PATCH V6 06/13] arm64, pci, acpi: ACPI support for legacy IRQs parsing and consolidation with DT code. Date: Fri, 15 Apr 2016 19:06:41 +0200 Message-Id: <1460740008-19489-7-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460740008-19489-1-git-send-email-tn@semihalf.com> References: <1460740008-19489-1-git-send-email-tn@semihalf.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=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 To enable PCI legacy IRQs on platforms booting with ACPI, arch code should include ACPI specific callbacks that parse and set-up the device IRQ number, equivalent to the DT boot path. Owing to the current ACPI core scan handlers implementation, ACPI PCI legacy IRQs bindings cannot be parsed at device add time, since that would trigger ACPI scan handlers ordering issues depending on how the ACPI tables are defined. To solve this problem and consolidate FW PCI legacy IRQs parsing in one single pcibios callback (pending final removal), this patch moves DT PCI IRQ parsing to the pcibios_alloc_irq() callback (called by PCI core code at device probe time) and adds ACPI PCI legacy IRQs parsing to the same callback too, so that FW PCI legacy IRQs parsing is confined in one single arch callback that can be easily removed when code parsing PCI legacy IRQs is consolidated and moved to core PCI code. Signed-off-by: Tomasz Nowicki Suggested-by: Lorenzo Pieralisi --- arch/arm64/kernel/pci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index c72de66..15109c11 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -50,11 +50,16 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) } /* - * Try to assign the IRQ number from DT when adding a new device + * Try to assign the IRQ number when probing a new device */ -int pcibios_add_device(struct pci_dev *dev) +int pcibios_alloc_irq(struct pci_dev *dev) { - dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); + if (acpi_disabled) + dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); +#ifdef CONFIG_ACPI + else + return acpi_pci_irq_enable(dev); +#endif return 0; }