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: 9059181 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BAA519F1C1 for ; Tue, 10 May 2016 15:21:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C50752014A for ; Tue, 10 May 2016 15:21:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D789C20149 for ; Tue, 10 May 2016 15:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752655AbcEJPVh (ORCPT ); Tue, 10 May 2016 11:21:37 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34544 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752843AbcEJPUU (ORCPT ); Tue, 10 May 2016 11:20:20 -0400 Received: by mail-lf0-f49.google.com with SMTP id m64so18778613lfd.1 for ; Tue, 10 May 2016 08:20:14 -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=WbLf/po1zZmznMNdwdx6vXeN06MzgX3i/FOTtr5cNvP97HKe8IG8IbXqAlrxZyU3Il mvALl4oc8B4Cn2X6UeTIbVHLHV5Q1rXwD3UhPf19vkGU1sQXSR9b8QdkqtJRJJFOurST haQQa4DzPf1hECce3ZYeUpCTw571GYez7/f21GXyfyhfPv3x0nf1LdPBd0ypIy/jdHY3 l7ZPQTK/A7sfFGbop4eJIsckPMWLcW8c2EpUY08VpDAGY3F94zZ1K9Oom2nru3M7iUKJ hroie7EGlzQs5UT9kY/gJEq/CZjaJk5Qi8nEIsGlvJ6k88XpPTIMiVpzVGoPc/f/eTTA PBsg== X-Gm-Message-State: AOPr4FVtqG9s9kBpMR0ysXpWlb6n/kHcweIJB11PQJ/n8PgZNIRzPduw7+sQCtZzUf4qvQ== 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 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 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> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-8.9 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; }