On Tue, Feb 07, 2017 at 09:34:43AM +0800, Dongdong Liu wrote: > Hi Bjorn > > 在 2017/2/7 6:40, Bjorn Helgaas 写道: > >On Mon, Feb 06, 2017 at 02:25:04PM +0800, Dongdong Liu wrote: > >>The PCIe controller in Hip06/Hip07 SoCs is not completely > >>ECAM-compliant. It is non-ECAM only for the RC bus config space; for > >>any other bus underneath the root bus it does support ECAM access. > >>This is to add the almost ECAM support in DT way. > >> > >>Signed-off-by: Dongdong Liu <liudongdong3@xxxxxxxxxx> > >>Reviewed-by: Gabriele Paoloni <gabriele.paoloni@xxxxxxxxxx> > >>Reviewed-by: Zhou Wang <wangzhou1@xxxxxxxxxxxxx> > > > >Applied to pci/host-hisi for v4.11, thanks! > > Thanks for applying this patch. > > > > >>-#if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS) > >>+#if defined(CONFIG_PCI_HISI) || (defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)) > >> > >> static int hisi_pcie_acpi_rd_conf(struct pci_bus *bus, u32 devfn, int where, > >> int size, u32 *val) > > > >These "_acpi_" accessors are now used for both the ACPI and the DT > >model, and the accessors aren't ACPI-specific anyway. So these are > >slight misnomers. > > Yes, It is better to change hisi_pcie_acpi_rd_conf()/ hisi_pcie_acpi_wr_conf() to hisi_pcie_rd_conf()/hisi_pcie_wr_conf(). I added a trivial patch to do this rename. > >>+static int hisi_pcie_platform_init(struct pci_config_window *cfg) > >>+{ > >>+ struct device *dev = cfg->parent; > >>+ struct platform_device *pdev = to_platform_device(dev); > >>+ struct resource *res; > >>+ void __iomem *reg_base; > >>+ > >>+ if (!dev->of_node) > >>+ return -EINVAL; > > > >What's the point of testing dev->of_node here? There's no obvious > >dependency on of_node in this code. Could we just drop this test? > > Yes, only DT driver will call this function, we should drop this test. > Thanks for pointing this. I dropped this test. Please check out https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-hisi to make sure it looks OK. I haven't applied the IRQ patch yet, but am looking at that next. Bjorn