From patchwork Tue Feb 16 13:53:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 8325911 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 C9D1B9F38B for ; Tue, 16 Feb 2016 13:55:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 294072027D for ; Tue, 16 Feb 2016 13:55:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44D1120263 for ; Tue, 16 Feb 2016 13:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932630AbcBPNyZ (ORCPT ); Tue, 16 Feb 2016 08:54:25 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:33350 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932625AbcBPNyU (ORCPT ); Tue, 16 Feb 2016 08:54:20 -0500 Received: by mail-wm0-f41.google.com with SMTP id g62so192688643wme.0 for ; Tue, 16 Feb 2016 05:54:20 -0800 (PST) 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=VxEPeq7fWNMcZu2J4AxcdogV37vLxhSaBu12lKzUOf8=; b=trtQ1yfMDGQY+Kf0Pdapyqb9TcWJfatomsmRtgQU/0JKGBzl6ImsKQHqgtrp1H0czU O9FJL3zEXXZvzDGiECVFDDb/VqH4+xgmNShl4gTFrEPNfQFXyA4VpoKBvQ1Ac8L2H+Tg V5Q5Yo8UKbcEN1+lCS1FdjUgV+UFk5uUWsV2NGTjeq056shkRnlK6m3p2uqYfyhzjibg nzJlpcs/JMYWl+8loDWezJNCrgPRU0nmBbjLHaQPxt02kf/07ECkBORXjviiBSo6fTaW er+4yfpNCgQHWF2GkPfO3WLzT3pesDjy9BYwz3EMllLiUITgQvkELu0Sj6QIcGxlWlzA sGug== 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=VxEPeq7fWNMcZu2J4AxcdogV37vLxhSaBu12lKzUOf8=; b=f7GQM4/BhmUoTJCAlPSle48XYXbVaan+tjxHAX8r3lZ4eWIPbVs2PoabfPZHOmMFIH +sA264q6bZ68yuUPnzQv0kWQt4GZNAWkDcE8psNW5KBCQAtlc/uFq8FcXdn8RCnKG1Lb XiyvQ8MBcVNj7WhhoCJOB1fuiwxgkuR53IRqAl90FVS8xvKNksLPB8RkFhG9sXx48wDh 7Jb+tUqBUk6UcXO3Km8vOaYs53VkWtjfRZ6zzPVG1Y6YeAOVLuTwRT8Urjg8Lsb5kpeN pEk2N4nDG6Lo9wHEw8nC4FahzhwhhYzMhK9tXKd2Z2AVBwvMioBrINDXXIsEeNXkqDTP Nq5Q== X-Gm-Message-State: AG10YOTCYZ1S8PMFVr6c4jyPmwoHdF3iECPnHprZutlZ0Ss/Cvzb7YhLq3jOVySa1DKVSw== X-Received: by 10.28.148.68 with SMTP id w65mr20080064wmd.66.1455630859603; Tue, 16 Feb 2016 05:54:19 -0800 (PST) Received: from tn-HP-4.semihalf.local ([80.82.22.190]) by smtp.gmail.com with ESMTPSA id q129sm20833462wmd.14.2016.02.16.05.54.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Feb 2016 05:54:19 -0800 (PST) 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, jiang.liu@linux.intel.com, jchandra@broadcom.com, Stefano.Stabellini@eu.citrix.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, Tomasz Nowicki Subject: [PATCH V5 14/15] arm64, pci, acpi: Assign legacy IRQs once device is enable. Date: Tue, 16 Feb 2016 14:53:44 +0100 Message-Id: <1455630825-27253-15-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455630825-27253-1-git-send-email-tn@semihalf.com> References: <1455630825-27253-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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 This is the last step before enabling generic ACPI PCI host controller for ARM64. We need to take care of legacy IRQ mapping for non-MSI(X) PCI devices. pcibios_alloc_irq() evaluation is not sensitive to ACPI device enumeration order, so it is the best place to assign device's IRQs for ACPI boot method. Also, it does not hurt DT to be initialized form the same place. NOTE: *This is going to be temporary solution*. There is ongoing work which aims for cleaning legacy IRQ allocation from arch specific code. We can consider this patch as the necessary evil which will be removed once cleanup series lands in mailnline in the near future. Signed-off-by: Tomasz Nowicki Suggested-by: Lorenzo Pieralisi Reviewed-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 023b983..6e77e1b 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -52,11 +52,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; }