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: 9170347 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 0BAF36048F for ; Fri, 10 Jun 2016 19:56:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0AE326E5D for ; Fri, 10 Jun 2016 19:56:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3C5328325; Fri, 10 Jun 2016 19:56:53 +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 7BF2526E5D for ; Fri, 10 Jun 2016 19:56:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbcFJT4k (ORCPT ); Fri, 10 Jun 2016 15:56:40 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:33095 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753152AbcFJT4L (ORCPT ); Fri, 10 Jun 2016 15:56:11 -0400 Received: by mail-lf0-f46.google.com with SMTP id f6so31374659lfg.0 for ; Fri, 10 Jun 2016 12:56:10 -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=KI65mbokrodHH1ZuNTQi6wtN0OUlefu3KtZSoGWxG9m2/T/5kdxDHb5coTW0z1v45n UNpbln+tsbEZhgCi/q+XfbQfjc3J7mP8F+oGivZuPk6TU2cb0Ahy+vxAO5fbNb+Ny5VX U/TtxV8d4Ct6w4acGdKhip6YAbPzLbAQu2XJicdYQhRVIl12Vkrx0UB3lLaZbKmt+aHR PTVnRcTEWtDw9AvkbzjDc+wszLlDHqecks1AV6XI8QFcnKsx1PiZgR3MBfkEeR8lfy7c cLj9m36CKWDdcF/FKy3/kIBblpD9oO5tlnfDv47P0VaaKjJb4f6HjKYMeNSWTKPdx9Zn DaTg== X-Gm-Message-State: ALyK8tIS8+NqiZdfCerg6XksVJKx70fpOgVr6w1dnhBCRyXEze6XyiGXpfXEloomNWMv2w== 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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; }