Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933181AbaDIMH7 (ORCPT ); Wed, 9 Apr 2014 08:07:59 -0400 Received: from service87.mimecast.com ([91.220.42.44]:45988 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932866AbaDIMHz convert rfc822-to-8bit (ORCPT ); Wed, 9 Apr 2014 08:07:55 -0400 Date: Wed, 9 Apr 2014 13:07:50 +0100 From: Liviu Dudau To: Bjorn Helgaas Cc: Benjamin Herrenschmidt , linux-pci , Catalin Marinas , Will Deacon , linaro-kernel , Arnd Bergmann , LKML , "devicetree@vger.kernel.org" , LAKML , Tanmay Inamdar , Grant Likely Subject: Re: [PATCH v7 4/6] pci: Introduce a domain number for pci_host_bridge. Message-ID: <20140409120750.GN985@e106497-lin.cambridge.arm.com> Mail-Followup-To: Bjorn Helgaas , Benjamin Herrenschmidt , linux-pci , Catalin Marinas , Will Deacon , linaro-kernel , Arnd Bergmann , LKML , "devicetree@vger.kernel.org" , LAKML , Tanmay Inamdar , Grant Likely References: <1394811272-1547-1-git-send-email-Liviu.Dudau@arm.com> <1394811272-1547-5-git-send-email-Liviu.Dudau@arm.com> <20140405000007.GD15806@google.com> <20140407084623.GG17163@e106497-lin.cambridge.arm.com> <1396862058.3671.40.camel@pasglop> <20140407100715.GI17163@e106497-lin.cambridge.arm.com> <20140408102043.GV17163@e106497-lin.cambridge.arm.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-OriginalArrivalTime: 09 Apr 2014 12:08:06.0812 (UTC) FILETIME=[5DCCBDC0:01CF53EC] X-MC-Unique: 114040913075118401 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 08, 2014 at 05:28:39PM +0100, Bjorn Helgaas wrote: > On Tue, Apr 8, 2014 at 4:20 AM, Liviu Dudau wrote: > > On Mon, Apr 07, 2014 at 11:44:51PM +0100, Bjorn Helgaas wrote: > > >> Let me try to explain my concern about the > >> pci_create_root_bus_in_domain() interface. We currently have these > >> interfaces: > >> > >> pci_scan_root_bus() > >> pci_scan_bus() > >> pci_scan_bus_parented() > >> pci_create_root_bus() > >> ... > > >> One alternative is to add an _in_domain() variant of each of these > >> interfaces, but that doesn't seem very convenient either. My idea of > >> passing in a structure would also require adding variants, so there's > >> not really an advantage there, but I am thinking of the next > >> unification effort, e.g., for NUMA node info. I don't really want to > >> have to change all the _in_domain() interfaces to also take yet > >> another parameter for the node number. > > > > OK, what about this: all the functions that you have mentioned take a > > void *sysdata parameter. Should we convert this opaque pointer into a > > specific structure that holds the domain_nr and (in future) the NUMA > > node info? > > I doubt if we can make sysdata itself generic because I suspect we > need a way to have *some* arch-specific data. But maybe the arch > could supply a structure containing a struct device *, domain, struct > pci_ops *, list of resources, aperture info, etc. I wonder if struct > pci_host_bridge would be a reasonable place to put this stuff, e.g., > something like this: > > struct pci_host_bridge { > int domain; > int node; > struct device *dev; > struct pci_ops *ops; > struct list_head resources; > void *sysdata; > struct pci_bus *bus; /* filled in by core, not by arch */ > ... /* other existing contents managed by core */ > }; > > struct pci_bus *pci_scan_host_bridge(struct pci_host_bridge *bridge); I'm really reluctant to give the arches more rope to hang themselves. I really dislike the use of xxxx_initcall() to do PCI initialisation ordering that is currently in widespread use through the arch code. As I hope to have proven with my arm64 code, you can have PCI support for an architecture without having to provide any arch specific code. We have enough correct code in the PCI framework, what would the architectures provide to the generic code that we cannot get by following the standard? Of course, there are always arch specific corners and they need their data structures to make sense of those, but rather than having architectures fill in a structure *before* we can setup host bridges I think we need to reverse the order. Using your example structure, I don't think is the arch's job to provide the list of resources or the domain number before we can scan the host bridge. We should be able to get those from somewhere else (like adding by default the ioport_resource and iomem_resource and managing domain numbers inside the core framework). Best regards, Liviu > -- > 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 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ -- 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/