From patchwork Thu Oct 29 15:53:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 7519691 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 6B6C7BEEA4 for ; Thu, 29 Oct 2015 15:53:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 819A62080D for ; Thu, 29 Oct 2015 15:53:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1C582080F for ; Thu, 29 Oct 2015 15:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757286AbbJ2Pxh (ORCPT ); Thu, 29 Oct 2015 11:53:37 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:36481 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753388AbbJ2Pxg (ORCPT ); Thu, 29 Oct 2015 11:53:36 -0400 Received: by lbjm5 with SMTP id m5so31703839lbj.3 for ; Thu, 29 Oct 2015 08:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf_com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=gjxVvtw1QrHreCgF0qifS7LZxZE2IyGbLK7op9J8H3o=; b=j56lPUeZDfNVdaNq7YNMZvkfPdgamJHPb/KTwbps0oyM0FF2ay4RfZw+A7OJlsH0iC ozI8x9P+ujX1SyT7VuP7GX9I19oTrj3a9oaFGZyu/4n011Cxl8tst9p+AYWRAHWnhNtG 2o3DCWN3HyAiXpWwypwhlSh+hQw8YO4Kh6vW4D1VNefM8BfJBe92ZHFdoPYiaJ9eznl8 H4sFUE447kW3BcGL8ZSdl+PL3B/3T3dl2vykP9ckYqLajsbRwBqXrJalyPJMfJC/v0l2 OLMejAxGgJBqCEGRHkTD2kPHAle7YgT8hrx5OCwcJPhXAgNLGP1jHDMoNn5kUKMEIrCR Dbvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=gjxVvtw1QrHreCgF0qifS7LZxZE2IyGbLK7op9J8H3o=; b=XWxaF95qgOqLra1JykUr/Ue9sywx/qLcJ1MokivGoTDAWipfznbLmDz9IorNXdZsoY TcuxnMs5wzENs9SfEriKkPZhQqmWHVomrHpIJlfuUaSfofjGEQ2UhtWT6JoE8w6vdFcx i/JWTbO3oNh1NEkiujY7r4agjxHaNu91sXGxkrt/qkrIzHSRdXh5Y6Sx3/7H3w+4S8dh b+Gafjl+Rps3MK7Uakco44QA8fIWY5j/TVKSydtGDlg8w+qe3JoYBXDShqvniPoAYpZN acutmciwzyqgdPCJncnpkRh5Ja2oMdIkuoxYNc0sL35FqNsyjAj0sBm5YTbdpYZ1RvPu A09g== X-Gm-Message-State: ALoCoQnyxt7EPW0A6fWC3v257Iia10zhNFxaK4htgIw2omNrvLw3x7iX3bHghq08D5teF3LkbGhB X-Received: by 10.112.16.199 with SMTP id i7mr1399012lbd.105.1446134014646; Thu, 29 Oct 2015 08:53:34 -0700 (PDT) Received: from [10.0.0.11] ([80.82.22.190]) by smtp.googlemail.com with ESMTPSA id y204sm448838lfd.6.2015.10.29.08.53.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 08:53:34 -0700 (PDT) Subject: Re: [PATCH V1 11/11] arm64, pci, acpi: Support for ACPI based PCI hostbridge init To: Sinan Kaya , bhelgaas@google.com, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, rjw@rjwysocki.net, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com References: <1445963922-22711-1-git-send-email-tn@semihalf.com> <1445963922-22711-12-git-send-email-tn@semihalf.com> <5631180D.2000902@codeaurora.org> <563131B0.9060305@codeaurora.org> <56320538.6000905@semihalf.com> <563234E6.4050109@codeaurora.org> Cc: jiang.liu@linux.intel.com, robert.richter@caviumnetworks.com, Narinder.Dhillon@caviumnetworks.com, ddaney@caviumnetworks.com, Liviu.Dudau@arm.com, tglx@linutronix.de, 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, linaro-acpi@lists.linaro.org From: Tomasz Nowicki Message-ID: <563240F6.2060209@semihalf.com> Date: Thu, 29 Oct 2015 16:53:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <563234E6.4050109@codeaurora.org> 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 On 29.10.2015 16:01, Sinan Kaya wrote: > > > On 10/29/2015 7:38 AM, Tomasz Nowicki wrote: >> On 28.10.2015 21:36, Sinan Kaya wrote: >>> 1. ACPI code is unable to discover the interrupt numbers when objects >>> are ordered as follows in the ACPI file >>> >>> PNP0A08 object >>> PNP0C0F INTA object >>> PNP0C0F INTB object >>> PNP0C0F INTC object >>> PNP0C0F INTD object >>> >>> This gives me invalid link context error. >>> >>> pci 0000:00:00.0: PCI INT A: no GSI >>> pci 0000:01:00.0: Derived GSI for 0000:01:00.0 INT A from 0000:00:00.0 >>> acpi PNP0C0F:00: Invalid link context >>> >>> If I order it like this in the ACPI file, >>> >>> PNP0C0F INTA object >>> PNP0C0F INTB object >>> PNP0C0F INTC object >>> PNP0C0F INTD object >>> PNP0A08 object >>> >>> then, the legacy interrupt numbers can be discovered properly. >> >> Can you show full content of your PNP0C0F and PNP0A08 objects? >> > > ACPI table is considered proprietary. I don't think I can get the legal > approval in time. I can give you pieces though. > > Here is the _PRT > Device (PCI0) { // PCIe port 0 > Name(_HID, EISAID("PNP0A08")) // PCI express > Name(_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge > { > .... > Name(_PRT, Package(){ > Package(){0x0FFFF, 0, \_SB.LN0A, 0}, // Slot 0, INTA > Package(){0x0FFFF, 1, \_SB.LN0B, 0}, // Slot 0, INTB > Package(){0x0FFFF, 2, \_SB.LN0C, 0}, // Slot 0, INTC > Package(){0x0FFFF, 3, \_SB.LN0D, 0} // Slot 0, INTD > }) > } > > Here is the PNP0C0F > > Device(LN0A){ > Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link > Name(_UID, 1) > Name(_PRS, ResourceTemplate(){ > Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive, , ,) {0xE8} > }) > Method(_DIS) {} > Method(_CRS) { Return (_PRS) } > Method(_SRS, 1) {} > } > Can you please apply patch below: /* @@ -61,10 +70,6 @@ int pcibios_add_device(struct pci_dev *dev) { if (acpi_disabled) dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); -#ifdef CONFIG_ACPI - else - acpi_pci_irq_enable(dev); -#endif return 0; } and let me know if the order still matter? Regards, Tomasz --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index fec1c91..fe34415 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -48,10 +48,19 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, */ int pcibios_enable_device(struct pci_dev *dev, int mask) { + int ret; + if (pci_has_flag(PCI_PROBE_ONLY)) return 0; - return pci_enable_resources(dev, mask); + ret = pci_enable_resources(dev, mask); + if (ret < 0) + return ret; +#ifdef CONFIG_ACPI + if (!dev->msi_enabled) + return acpi_pci_irq_enable(dev); +#endif + return 0; }