From patchwork Tue May 10 15:19:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 9059511 Return-Path: X-Original-To: patchwork-linux-arm@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 2E556BF440 for ; Tue, 10 May 2016 15:25:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 475FF200CF for ; Tue, 10 May 2016 15:25:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1C0792014A for ; Tue, 10 May 2016 15:25:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b09VU-0007mm-3M; Tue, 10 May 2016 15:23:32 +0000 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b09SY-0004iN-He for linux-arm-kernel@lists.infradead.org; Tue, 10 May 2016 15:20:37 +0000 Received: by mail-lf0-x234.google.com with SMTP id y84so18916284lfc.0 for ; Tue, 10 May 2016 08:20:15 -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=unUL8R6VPp1SuNwA3k9GjGGH9+auMLG3oSVa9GTzS0/H+B/SX9GCSLDYPCMyWgiuQd K15nWyUrFsbcxB+fGaa6uKMjHJ/iBsB0gNGtC/W2yZT8E0rOMYJZjCeIcAQ9Ve7r+4/3 rFPMDnQfX6hMQ+quEkn4TU2C/B71rEFL1O0QB1LJ3eww84IgeMHiJZb/ai0dZjNHghzt 2viQsrXnpXw4tEO1mM5ZDZLWb9kSBMnuLVoKxoZjM8uIzw/pTI34B/YcTqFFPHoBo+sI 301bc8l5XBFRtuQL/A8FnnPB73yvJFpyQvYNTiIIMP++56svVn12cDfY0CaFGGlU6xzg rPDA== 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=gfvY2MDx6cDEf+ZsYlAR7fxjm/Y9Q+vpM8j11b9j9tgkSnHaGtxzfRShB4Xiva4Xm9 mGUPDpEKMwLvrV3u3MrHKBBmzyDdhjYN8DnTNBd4hA16ki+pv9k57Oz3o1O6ibmfesvp 6FSRM9UphZBHXB+DO/VwECHSVasOXENNr8AavQc0dkGXNGHiQGUT/hfIMRPWhcICQ8f/ Fn6ptEBccNdCwdV8qSZI/DXKbHrGfTGrcfZr+VWyIjPjH1xnOEA82mrhzcRB3Fy3DIPq UKPGushGBoqaGmdWt0BrQAOh1idnHxfgR5ghfyIkhKzFARscWsrsH2oy2QbOB1gRtkiI LkJg== X-Gm-Message-State: AOPr4FWp5719tq4BD3ur/2R8PnH/vk69lILheY/9MGwMOtYPuil3CICU+6wUsTJwAgUXvQ== X-Received: by 10.112.9.200 with SMTP id c8mr15360244lbb.50.1462893613677; Tue, 10 May 2016 08:20:13 -0700 (PDT) Received: from tn-HP-4.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id s194sm468002lfs.40.2016.05.10.08.20.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 May 2016 08:20:12 -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 Subject: [PATCH V7 09/11] arm64, pci, acpi: ACPI support for legacy IRQs parsing and consolidation with DT code. Date: Tue, 10 May 2016 17:19:59 +0200 Message-Id: <1462893601-8937-10-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462893601-8937-1-git-send-email-tn@semihalf.com> References: <1462893601-8937-1-git-send-email-tn@semihalf.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160510_082031_178661_6BBF5794 X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jcm@redhat.com, linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, dhdang@apm.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, jeremy.linton@arm.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, cov@codeaurora.org, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, wangyijing@huawei.com, Tomasz Nowicki , mw@semihalf.com, andrea.gallo@linaro.org, linux-arm-kernel@lists.infradead.org, liudongdong3@huawei.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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; }