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: 8326391 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 0CB1DC02AA for ; Tue, 16 Feb 2016 14:06:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CF8B20279 for ; Tue, 16 Feb 2016 14:06:37 +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 8BE3620154 for ; Tue, 16 Feb 2016 14:06:36 +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 1aVgFo-0006l1-F1; Tue, 16 Feb 2016 14:05:24 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVg5N-0002Ey-61 for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2016 13:54:39 +0000 Received: by mail-wm0-x236.google.com with SMTP id g62so153836096wme.0 for ; Tue, 16 Feb 2016 05:54:21 -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=CWhShXV8dKq64pI9e4KK0MjxJngsW8lkiHsoBsFRSSzkCUX7geXz2yBTM0VnN8R7kT WWKOO1ZKx7NABPMeYwUFh4A67tzTwEagB/W0iyxrGtN1qJ2ixhYzrIE4u4ksgh4jBXqo 5VZJTv4+Wr99hxcOsrnHXMGPutym4KPV9x8Qw8FAoqztTym0+eHRkBimG6GVR4kvFy+q 4HVIOxJrqN8p17/gyocKP8uzy4NY55ptS2W77VDMoSxqgI33w2MgdLOX7MdZXtr1YUAi Vef74KVW3E4AveEcFtn6HEnPLbBhumIeRp+JYy06Jc8Z44jYXsJfI61mvCXZXitKwG79 waAg== X-Gm-Message-State: AG10YOSvREePHw9Y582n66OW3tlrHK5Gwedks/d14rsR5l4U37gm9XlO7QDha/6TwSHPLw== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160216_055437_642612_58E4FA16 X-CRM114-Status: GOOD ( 14.29 ) 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, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, wangyijing@huawei.com, Tomasz Nowicki , mw@semihalf.com, linux-arm-kernel@lists.infradead.org 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 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; }