From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suravee Suthikulpanit Subject: Re: [PATCH v10 00/10] Support for creating generic PCI host bridges from DT Date: Fri, 12 Sep 2014 03:25:13 -0500 Message-ID: <5412ADE9.2050708@amd.com> References: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> Sender: linux-pci-owner@vger.kernel.org To: Liviu Dudau , Bjorn Helgaas , Arnd Bergmann , Rob Herring , Jason Gunthorpe , Benjamin Herrenschmidt , Catalin Marinas , Will Deacon , Russell King , linux-pci , Linus Walleij Cc: Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , linux-arch , LKML , Device Tree ML , LAKML List-Id: devicetree@vger.kernel.org On 9/8/2014 8:54 AM, Liviu Dudau wrote: > This is my version 10 of the attempt at adding support for generic PCI host > bridge controllers that make use of device tree information to > configure themselves. This version reverses v9's attempt to create one function > to drive the whole process of extracting the host bridge ranges, setup the > host bridge driver and then scan the root bus behind the host bridge. While it > would've been quite user friendly, I agree that it would've caused a lot of pain > in the future. > > I would like to get ACKs for the remaining patches as I would like to integrate > this into -next in the following week. > > This version marks an implementation break with the previous versions as > of_create_pci_host_bridge() is now gone. It gets replaced by > of_pci_get_host_bridge_resources() that only parses the DT and extracts the > relevant ranges and converts them to resources. The updated host bridge drivers > will have to follow the guidelines in this example code: > > static int foohb_probe(struct platform_device *pdev) > { > struct device_node *dn = pdev->dev.of_node; > struct foohb_drv *drv; > resource_size_t io_base = 0; /* phys address for start of IO */ > struct pci_bus *bus; > int err = 0; > LIST_HEAD(res); > > ..... > err = of_pci_get_host_bridge_resources(dn, 0, 255, &res, &io_base); > if (err) > goto err_handling; > err = foohb_setup(drv, ...., &res, &io_base); > if (err) > goto err_handling; My understanding is that the "foohb_setup" above is supposed to be equivalent to the "int (*setup)(struct pci_host_bridge *, resource_size_t)" in V9 that was passed in as an argument of "of_create_pci_hot_bridge()". The problem I have is I need an intermediate step between "pci_create_root_bus()" and "pci_scan_child_bus()" in order to update the information such as the "pci_bus->msi" before this is propagate down to the child bus during the "pci_scan_child_bus" which is also called in the pci_scan_root_bus() function. Does this mean that I should not be calling the pci_scan_root_bus(), and tries to re-implement the same logic in my driver? Thanks, Suravee > ..... > pci_add_flags(....); > bus = pci_scan_root_bus(&pdev->dev, 0, &foohb_ops, drv, &res); > if (!bus) > goto err_handling; > .... > return 0; > > err_handling: > ...... > return err; > } >