From patchwork Mon May 30 15:14:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 9141667 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 A9BD160777 for ; Mon, 30 May 2016 15:17:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B6C328222 for ; Mon, 30 May 2016 15:17:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9005028224; Mon, 30 May 2016 15:17:42 +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 1A03C28222 for ; Mon, 30 May 2016 15:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932210AbcE3PRj (ORCPT ); Mon, 30 May 2016 11:17:39 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:32956 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755083AbcE3PPK (ORCPT ); Mon, 30 May 2016 11:15:10 -0400 Received: by mail-lf0-f44.google.com with SMTP id s64so50065513lfe.0 for ; Mon, 30 May 2016 08:15:09 -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=msdomAJau1P3V/kIj7ywTeCD3fqOdJuRUbsMyZxWxW8=; b=Kk1Hjqrm+HEHohZrRLMDvwvTxzyhtduIbfT9uyFKgsEA/RVCCTIAqF/ocUlBNExQqj Kx+ypS47xh9XJCGoiNfZY4aIp8kLHbZH4WKulaCAg4YsqE91UhQYwCBAi7uHOlZwXhCA J6mbahCcMmRhYVbU0QuKSahc2pOPhxYBQT4+Ig2FsI6mKZyqfdup6SyP5++ATO+RUpT9 NuelFxbfDZZiaMi0XxhA2JYqeji2QuSTnEhpqGjaU4g1Nl6CXAocuSdHYOZxUSnMd8fH GhZJcxxJ7gf27WOaK2bAdqNB8X1XNoR99u+eEiI1boy2ryiIIXDaEvDHOVPID2K1MpZM 7fLw== 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=msdomAJau1P3V/kIj7ywTeCD3fqOdJuRUbsMyZxWxW8=; b=lbQXieUHyk/Ilsha/GTwY8iHuXgAHzVeg6cPPCOIJD2xMwNKFhEJFgFW41qzryPnJj U9WvBLUEARygTpkm0KkmDAxKD1sRIj1PebK9eJ+jlp8g3VidbzsO4xTT8hcNq2H0h0zM pXTRXm2KokHn8jaIG4kQk3smfIVhsTkedT7RsEL4Vv/gQNE4LTUTGCJdHyJY9tECIVt2 CUS8uL62vQk+57RhzdrYFnnaMqhFoJYz+akG9fWOdCrbA0JJzkgIGYKsoAG1SpsWdnbz 2Tsy0V9oInQg/I/9G77ErDvHLChEJsYk/9btsStxhd8BUC7PYvKmg4cVS1+MWI9QGJhN CnQA== X-Gm-Message-State: ALyK8tKnDPN/q8bSLPd5XJ6+eLOz01EE12DzqFTEyCp+pXPTLB89+7ehXVuwfMHNctaZ2w== X-Received: by 10.25.196.200 with SMTP id u191mr9239111lff.129.1464621308919; Mon, 30 May 2016 08:15:08 -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 n13sm1392264lfb.33.2016.05.30.08.15.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 May 2016 08:15:08 -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 V8 6/9] arm64, pci, acpi: ACPI support for legacy IRQs parsing and consolidation with DT code. Date: Mon, 30 May 2016 17:14:19 +0200 Message-Id: <1464621262-26770-7-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464621262-26770-1-git-send-email-tn@semihalf.com> References: <1464621262-26770-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 3c4e308..336deef 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; }