Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932630AbbKDKFR (ORCPT ); Wed, 4 Nov 2015 05:05:17 -0500 Received: from mail-lb0-f180.google.com ([209.85.217.180]:33950 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932205AbbKDKFL (ORCPT ); Wed, 4 Nov 2015 05:05:11 -0500 Subject: Re: [Linaro-acpi] [PATCH V1 10/11] pci, acpi: Provide generic way to assign bus domain number. To: Lorenzo Pieralisi , Tomasz Nowicki References: <1445963922-22711-1-git-send-email-tn@semihalf.com> <1445963922-22711-11-git-send-email-tn@semihalf.com> <20151103161059.GE3574@red-moon> Cc: rjw@rjwysocki.net, linux-kernel@vger.kernel.org, arnd@arndb.de, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, catalin.marinas@arm.com, linaro-acpi@lists.linaro.org, will.deacon@arm.com, ddaney@caviumnetworks.com, Narinder.Dhillon@caviumnetworks.com, wangyijing@huawei.com, robert.richter@caviumnetworks.com, tglx@linutronix.de, bhelgaas@google.com, Liviu.Dudau@arm.com, jiang.liu@linux.intel.com, linux-arm-kernel@lists.infradead.org From: Tomasz Nowicki Message-ID: <5639D84A.1020809@linaro.org> Date: Wed, 4 Nov 2015 11:04:58 +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: <20151103161059.GE3574@red-moon> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2099 Lines: 50 On 03.11.2015 17:10, Lorenzo Pieralisi wrote: > On Tue, Oct 27, 2015 at 05:38:41PM +0100, Tomasz Nowicki wrote: >> Architectures which support PCI_DOMAINS_GENERIC (like ARM64) >> cannot call pci_bus_assign_domain_nr along ACPI PCI host bridge >> initialization since this function needs valid parent device reference >> to be able to retrieve domain number (aka segment). >> >> We can omit that blocker and pass down host bridge device via >> pci_create_root_bus parameter and then be able to evaluate _SEG method >> being in pci_bus_assign_domain_nr. >> >> Note that _SEG method is optional, therefore _SEG absence means >> that all PCI buses belong to domain 0. >> >> Signed-off-by: Tomasz Nowicki >> --- >> drivers/acpi/pci_root.c | 2 +- >> drivers/pci/pci.c | 32 +++++++++++++++++++++++++++----- >> 2 files changed, 28 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c >> index 850d7bf..e682dc6 100644 >> --- a/drivers/acpi/pci_root.c >> +++ b/drivers/acpi/pci_root.c >> @@ -839,7 +839,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, >> >> pci_acpi_root_add_resources(info); >> pci_add_resource(&info->resources, &root->secondary); >> - bus = pci_create_root_bus(NULL, busnum, ops->pci_ops, >> + bus = pci_create_root_bus(&device->dev, busnum, ops->pci_ops, >> sysdata, &info->resources); > > If I read x86 code correctly, they rely on the first argument to be > NULL, I think you would break x86 by doing that, see: > > arch/x86/pci/acpi.c (pcibios_root_bridge_prepare()) > > By the way, can't we move the code setting up the ACPI_COMPANION > to core PCI code and stop relying on sysdata for that ? > Yes, that will break x86&ia64 but as you said it may be overcome with consolidation of ACPI_COMPANION into the core code. Tomasz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/