From patchwork Fri Jun 10 19:55:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 9170333 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 D7076607DA for ; Fri, 10 Jun 2016 19:56:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7EA0282F9 for ; Fri, 10 Jun 2016 19:56:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC92028366; Fri, 10 Jun 2016 19:56:29 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 33763282F9 for ; Fri, 10 Jun 2016 19:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752308AbcFJT4J (ORCPT ); Fri, 10 Jun 2016 15:56:09 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:33095 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753152AbcFJT4G (ORCPT ); Fri, 10 Jun 2016 15:56:06 -0400 Received: by mail-lf0-f42.google.com with SMTP id f6so31374652lfg.0 for ; Fri, 10 Jun 2016 12:56:05 -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=rdcaOygVGFhgTZmWERFFwZX3yyVAZMUtPu47s4ksUBk=; b=UrG0OluStkm0QbSv6TwQeCvCBf3rDdF+O2VFspe7GYUV+ZnvDM5NwHA3RcaMEgoVaB WHps/pfs6FsVYjoxaTGdzGjD6aT6lzA/jU5bOiHQgLKNfCAr+DTBfd54bMEsLJJrDz04 yzsGNh5j1DWDWvGAihZh/ZD/5FhVSFxpfkF7ym6/v7PzriRGgn72y6o3r9J/vWXPftBd wNqXWFQRGDHpJbRzM20nSwtBX5U131ZY3XqwsPY7ClKrhVH/X/feSC5OKSKmfnJppn0G kh1WXvrsa9kU1NpHyeCbNG9+yVGMzt1hMQC1YKVD8kb3Ae2EriJxjcXgRXsIseAfKuZb xHiA== 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=rdcaOygVGFhgTZmWERFFwZX3yyVAZMUtPu47s4ksUBk=; b=gjlf8EuZW5PhvWhWFBMAVkkgip6dRof3+4osYXi1DigeLdEdXmeb5Ch4Vp2z4rkpR1 I0oKNMwJZ/Zlzz8uTHOHTMHmrskLhIarxHUVVz0IdqyuRXCJW1ZZRp9O1XGae0/so5GL ETUTE+BtvS5JUYTarUt4Trw48oP9yoMB088sJOKtLeFriRfb6/cZl8pGPw2zYRKsQ7dG T037feIZSg4kx6dWab2CM74oSpfVic7AyWuPZJpXGIVo3OlSUZGeWL4fEKL6NCL2cHNI YeIBVSh7dYSOPj6ORs19TlzXDVrDv+lHQZSslzkZFrOrftjQMtGoQbxfgi1aPr9tglz2 /h4g== X-Gm-Message-State: ALyK8tLGoVC/LyRcSCCuJ3WRyQXzg9fqucyUoWZdjtEByd59gnAhWsTGAoxPBFp5Y08tQw== X-Received: by 10.25.79.147 with SMTP id d141mr1137438lfb.215.1465588564552; Fri, 10 Jun 2016 12:56:04 -0700 (PDT) Received: from tn-HP-4.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id a190sm1377175lfe.21.2016.06.10.12.56.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Jun 2016 12:56:03 -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, 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, andrea.gallo@linaro.org, dhdang@apm.com, jeremy.linton@arm.com, liudongdong3@huawei.com, cov@codeaurora.org, Tomasz Nowicki Subject: [PATCH V9 09/11] ARM64/PCI: ACPI support for legacy IRQs parsing and consolidation with DT code Date: Fri, 10 Jun 2016 21:55:17 +0200 Message-Id: <1465588519-11334-10-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465588519-11334-1-git-send-email-tn@semihalf.com> References: <1465588519-11334-1-git-send-email-tn@semihalf.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.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 d5d3d26..b3b8a2c 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -51,11 +51,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; }