RE: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-27 Thread Jake Oshins
> -Original Message-
> From: Jiang Liu [mailto:jiang@linux.intel.com]
> Sent: Tuesday, October 27, 2015 12:10 AM
> To: Jake Oshins ; gre...@linuxfoundation.org; KY
> Srinivasan ; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; t...@linutronix.de; Haiyang Zhang
> ; marc.zyng...@arm.com;
> bhelg...@google.com; linux-...@vger.kernel.org
> Subject: Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI
> buses, optionally
> 
> On 2015/10/27 7:15, ja...@microsoft.com wrote:
> > From: Jake Oshins 
> >
> > This patch allows a PCI front-end implementation to supply an
> fwnode_handle
> > associated with a root PCI bus, optionally.  If supplied, the PCI driver
> > records this.
> >
> > This patch supports the next patch in the series, which looks up an IRQ
> domain
> > through this handle.
> Hi JaKeo,
>   Instead of changing the pci_create_root_bus() interface,
> how about packing fwnode into sysdata, then we may
> either 1) introduce a helper to retrieve fwnode from sysdata
> or 2) set host_bridge->fwnode = sysdata in function
> pcibios_root_bridge_prepare.
> 
> Thanks,
> Gerry
> 

Thanks for the review.  I'll work up a version that uses this suggestion and 
resend.  (I'll respond to your feedback on the other patches, too.)

-- Jake Oshins

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-27 Thread Jiang Liu
On 2015/10/27 7:15, ja...@microsoft.com wrote:
> From: Jake Oshins 
> 
> This patch allows a PCI front-end implementation to supply an fwnode_handle
> associated with a root PCI bus, optionally.  If supplied, the PCI driver
> records this.
> 
> This patch supports the next patch in the series, which looks up an IRQ domain
> through this handle.
Hi JaKeo,
Instead of changing the pci_create_root_bus() interface,
how about packing fwnode into sysdata, then we may
either 1) introduce a helper to retrieve fwnode from sysdata
or 2) set host_bridge->fwnode = sysdata in function
pcibios_root_bridge_prepare.

Thanks,
Gerry

> 
> Signed-off-by: Jake Oshins 
> ---
>  arch/sparc/kernel/pci.c   | 2 +-
>  drivers/acpi/pci_root.c   | 2 +-
>  drivers/parisc/lba_pci.c  | 2 +-
>  drivers/pci/host/pci-xgene.c  | 2 +-
>  drivers/pci/host/pcie-iproc.c | 3 ++-
>  drivers/pci/probe.c   | 8 +---
>  include/linux/pci.h   | 4 +++-
>  7 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
> index b91d7f1..3d4e9f9 100644
> --- a/arch/sparc/kernel/pci.c
> +++ b/arch/sparc/kernel/pci.c
> @@ -660,7 +660,7 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
>   pbm->busn.flags = IORESOURCE_BUS;
>   pci_add_resource(, >busn);
>   bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
> -   pbm, );
> +   pbm, , NULL);
>   if (!bus) {
>   printk(KERN_ERR "Failed to create bus for %s\n",
>  node->full_name);
> diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
> index 850d7bf..eab95bc 100644
> --- a/drivers/acpi/pci_root.c
> +++ b/drivers/acpi/pci_root.c
> @@ -840,7 +840,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root 
> *root,
>   pci_acpi_root_add_resources(info);
>   pci_add_resource(>resources, >secondary);
>   bus = pci_create_root_bus(NULL, busnum, ops->pci_ops,
> -   sysdata, >resources);
> +   sysdata, >resources, NULL);
>   if (!bus)
>   goto out_release_info;
>  
> diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
> index a32c1f6..a7b9d5c 100644
> --- a/drivers/parisc/lba_pci.c
> +++ b/drivers/parisc/lba_pci.c
> @@ -1567,7 +1567,7 @@ lba_driver_probe(struct parisc_device *dev)
>   dev->dev.platform_data = lba_dev;
>   lba_bus = lba_dev->hba.hba_bus =
>   pci_create_root_bus(>dev, lba_dev->hba.bus_num.start,
> - cfg_ops, NULL, );
> + cfg_ops, NULL, , NULL);
>   if (!lba_bus) {
>   pci_free_resource_list();
>   return 0;
> diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
> index ae00ce2..95c20c8 100644
> --- a/drivers/pci/host/pci-xgene.c
> +++ b/drivers/pci/host/pci-xgene.c
> @@ -545,7 +545,7 @@ static int xgene_pcie_probe_bridge(struct platform_device 
> *pdev)
>   return ret;
>  
>   bus = pci_create_root_bus(>dev, 0,
> - _pcie_ops, port, );
> + _pcie_ops, port, , NULL);
>   if (!bus)
>   return -ENOMEM;
>  
> diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
> index 9193951..bc999b7 100644
> --- a/drivers/pci/host/pcie-iproc.c
> +++ b/drivers/pci/host/pcie-iproc.c
> @@ -357,7 +357,8 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct 
> list_head *res)
>   sysdata = pcie;
>  #endif
>  
> - bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res);
> + bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res,
> +   NULL);
>   if (!bus) {
>   dev_err(pcie->dev, "unable to create PCI root bus\n");
>   ret = -ENOMEM;
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index f441d1b..c0f2e44 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2039,7 +2039,8 @@ void __weak pcibios_remove_bus(struct pci_bus *bus)
>  }
>  
>  struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
> - struct pci_ops *ops, void *sysdata, struct list_head *resources)
> + struct pci_ops *ops, void *sysdata, struct list_head *resources,
> + struct fwnode_handle *fwnode)
>  {
>   int error;
>   struct pci_host_bridge *bridge;
> @@ -2069,6 +2070,7 @@ struct pci_bus *pci_create_root_bus(struct device 
> *parent, int bus,
>   if (!bridge)
>   goto err_out;
>  
> + bridge->fwnode = fwnode;
>   bridge->dev.parent = parent;
>   bridge->dev.release = pci_release_host_bridge_dev;
>   dev_set_name(>dev, "pci%04x:%02x", pci_domain_nr(b), bus);
> @@ -2223,7 +2225,7 @@ struct pci_bus *pci_scan_root_bus_msi(struct device 
> *parent, int bus,
>   

Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-27 Thread Jiang Liu
On 2015/10/27 7:15, ja...@microsoft.com wrote:
> From: Jake Oshins 
> 
> This patch allows a PCI front-end implementation to supply an fwnode_handle
> associated with a root PCI bus, optionally.  If supplied, the PCI driver
> records this.
> 
> This patch supports the next patch in the series, which looks up an IRQ domain
> through this handle.
Hi JaKeo,
Instead of changing the pci_create_root_bus() interface,
how about packing fwnode into sysdata, then we may
either 1) introduce a helper to retrieve fwnode from sysdata
or 2) set host_bridge->fwnode = sysdata in function
pcibios_root_bridge_prepare.

Thanks,
Gerry

> 
> Signed-off-by: Jake Oshins 
> ---
>  arch/sparc/kernel/pci.c   | 2 +-
>  drivers/acpi/pci_root.c   | 2 +-
>  drivers/parisc/lba_pci.c  | 2 +-
>  drivers/pci/host/pci-xgene.c  | 2 +-
>  drivers/pci/host/pcie-iproc.c | 3 ++-
>  drivers/pci/probe.c   | 8 +---
>  include/linux/pci.h   | 4 +++-
>  7 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
> index b91d7f1..3d4e9f9 100644
> --- a/arch/sparc/kernel/pci.c
> +++ b/arch/sparc/kernel/pci.c
> @@ -660,7 +660,7 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
>   pbm->busn.flags = IORESOURCE_BUS;
>   pci_add_resource(, >busn);
>   bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
> -   pbm, );
> +   pbm, , NULL);
>   if (!bus) {
>   printk(KERN_ERR "Failed to create bus for %s\n",
>  node->full_name);
> diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
> index 850d7bf..eab95bc 100644
> --- a/drivers/acpi/pci_root.c
> +++ b/drivers/acpi/pci_root.c
> @@ -840,7 +840,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root 
> *root,
>   pci_acpi_root_add_resources(info);
>   pci_add_resource(>resources, >secondary);
>   bus = pci_create_root_bus(NULL, busnum, ops->pci_ops,
> -   sysdata, >resources);
> +   sysdata, >resources, NULL);
>   if (!bus)
>   goto out_release_info;
>  
> diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
> index a32c1f6..a7b9d5c 100644
> --- a/drivers/parisc/lba_pci.c
> +++ b/drivers/parisc/lba_pci.c
> @@ -1567,7 +1567,7 @@ lba_driver_probe(struct parisc_device *dev)
>   dev->dev.platform_data = lba_dev;
>   lba_bus = lba_dev->hba.hba_bus =
>   pci_create_root_bus(>dev, lba_dev->hba.bus_num.start,
> - cfg_ops, NULL, );
> + cfg_ops, NULL, , NULL);
>   if (!lba_bus) {
>   pci_free_resource_list();
>   return 0;
> diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
> index ae00ce2..95c20c8 100644
> --- a/drivers/pci/host/pci-xgene.c
> +++ b/drivers/pci/host/pci-xgene.c
> @@ -545,7 +545,7 @@ static int xgene_pcie_probe_bridge(struct platform_device 
> *pdev)
>   return ret;
>  
>   bus = pci_create_root_bus(>dev, 0,
> - _pcie_ops, port, );
> + _pcie_ops, port, , NULL);
>   if (!bus)
>   return -ENOMEM;
>  
> diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
> index 9193951..bc999b7 100644
> --- a/drivers/pci/host/pcie-iproc.c
> +++ b/drivers/pci/host/pcie-iproc.c
> @@ -357,7 +357,8 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct 
> list_head *res)
>   sysdata = pcie;
>  #endif
>  
> - bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res);
> + bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res,
> +   NULL);
>   if (!bus) {
>   dev_err(pcie->dev, "unable to create PCI root bus\n");
>   ret = -ENOMEM;
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index f441d1b..c0f2e44 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2039,7 +2039,8 @@ void __weak pcibios_remove_bus(struct pci_bus *bus)
>  }
>  
>  struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
> - struct pci_ops *ops, void *sysdata, struct list_head *resources)
> + struct pci_ops *ops, void *sysdata, struct list_head *resources,
> + struct fwnode_handle *fwnode)
>  {
>   int error;
>   struct pci_host_bridge *bridge;
> @@ -2069,6 +2070,7 @@ struct pci_bus *pci_create_root_bus(struct device 
> *parent, int bus,
>   if (!bridge)
>   goto err_out;
>  
> + bridge->fwnode = fwnode;
>   bridge->dev.parent = parent;
>   bridge->dev.release = pci_release_host_bridge_dev;
>   dev_set_name(>dev, "pci%04x:%02x", pci_domain_nr(b), bus);
> @@ -2223,7 +2225,7 @@ struct pci_bus *pci_scan_root_bus_msi(struct device 
> 

RE: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-27 Thread Jake Oshins
> -Original Message-
> From: Jiang Liu [mailto:jiang@linux.intel.com]
> Sent: Tuesday, October 27, 2015 12:10 AM
> To: Jake Oshins <ja...@microsoft.com>; gre...@linuxfoundation.org; KY
> Srinivasan <k...@microsoft.com>; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; t...@linutronix.de; Haiyang Zhang
> <haiya...@microsoft.com>; marc.zyng...@arm.com;
> bhelg...@google.com; linux-...@vger.kernel.org
> Subject: Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI
> buses, optionally
> 
> On 2015/10/27 7:15, ja...@microsoft.com wrote:
> > From: Jake Oshins <ja...@microsoft.com>
> >
> > This patch allows a PCI front-end implementation to supply an
> fwnode_handle
> > associated with a root PCI bus, optionally.  If supplied, the PCI driver
> > records this.
> >
> > This patch supports the next patch in the series, which looks up an IRQ
> domain
> > through this handle.
> Hi JaKeo,
>   Instead of changing the pci_create_root_bus() interface,
> how about packing fwnode into sysdata, then we may
> either 1) introduce a helper to retrieve fwnode from sysdata
> or 2) set host_bridge->fwnode = sysdata in function
> pcibios_root_bridge_prepare.
> 
> Thanks,
> Gerry
> 

Thanks for the review.  I'll work up a version that uses this suggestion and 
resend.  (I'll respond to your feedback on the other patches, too.)

-- Jake Oshins

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-26 Thread kbuild test robot
Hi Jake,

[auto build test ERROR on next-20151022 -- if it's inappropriate base, please 
suggest rules for selecting the more suitable base]

url:
https://github.com/0day-ci/linux/commits/jakeo-microsoft-com/New-paravirtual-PCI-front-end-for-Hyper-V-VMs/20151027-072118
config: powerpc-defconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   arch/powerpc/kernel/pci-common.c: In function 'pcibios_scan_phb':
>> arch/powerpc/kernel/pci-common.c:1621:8: error: too few arguments to 
>> function 'pci_create_root_bus'
 bus = pci_create_root_bus(hose->parent, hose->first_busno,
   ^
   In file included from arch/powerpc/kernel/pci-common.c:20:0:
   include/linux/pci.h:791:17: note: declared here
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
^

vim +/pci_create_root_bus +1621 arch/powerpc/kernel/pci-common.c

be8e60d8 Yinghai Lu2012-05-17  1615 hose->busn.start = 
hose->first_busno;
be8e60d8 Yinghai Lu2012-05-17  1616 hose->busn.end   = 
hose->last_busno;
be8e60d8 Yinghai Lu2012-05-17  1617 hose->busn.flags = 
IORESOURCE_BUS;
be8e60d8 Yinghai Lu2012-05-17  1618 pci_add_resource(, 
>busn);
be8e60d8 Yinghai Lu2012-05-17  1619  
0ed2c722 Grant Likely  2009-08-28  1620 /* Create an empty bus for the 
toplevel */
45a709f8 Bjorn Helgaas 2011-10-28 @1621 bus = 
pci_create_root_bus(hose->parent, hose->first_busno,
45a709f8 Bjorn Helgaas 2011-10-28  1622   
hose->ops, hose, );
0ed2c722 Grant Likely  2009-08-28  1623 if (bus == NULL) {
0ed2c722 Grant Likely  2009-08-28  1624 pr_err("Failed to 
create bus for PCI domain %04x\n",

:: The code at line 1621 was first introduced by commit
:: 45a709f890a7b84930942a5f5f82011312fe727c powerpc/PCI: convert to 
pci_create_root_bus()

:: TO: Bjorn Helgaas 
:: CC: Jesse Barnes 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-26 Thread kbuild test robot
Hi Jake,

[auto build test ERROR on next-20151022 -- if it's inappropriate base, please 
suggest rules for selecting the more suitable base]

url:
https://github.com/0day-ci/linux/commits/jakeo-microsoft-com/New-paravirtual-PCI-front-end-for-Hyper-V-VMs/20151027-072118
config: parisc-b180_defconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=parisc 

All errors (new ones prefixed by >>):

   drivers/parisc/dino.c: In function 'dino_probe':
>> drivers/parisc/dino.c:988:32: error: too few arguments to function 
>> 'pci_create_root_bus'
 dino_dev->hba.hba_bus = bus = pci_create_root_bus(>dev,
   ^
   In file included from drivers/parisc/dino.c:49:0:
   include/linux/pci.h:791:17: note: declared here
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
^

vim +/pci_create_root_bus +988 drivers/parisc/dino.c

30aa80da Yinghai Lu 2012-05-17  982 dino_dev->hba.bus_num.flags = 
IORESOURCE_BUS;
30aa80da Yinghai Lu 2012-05-17  983 pci_add_resource(, 
_dev->hba.bus_num);
^1da177e Linus Torvalds 2005-04-16  984 /*
^1da177e Linus Torvalds 2005-04-16  985 ** It's not used to avoid 
chicken/egg problems
^1da177e Linus Torvalds 2005-04-16  986 ** with configuration accessor 
functions.
^1da177e Linus Torvalds 2005-04-16  987 */
7590e500 Bjorn Helgaas  2011-10-28 @988 dino_dev->hba.hba_bus = bus = 
pci_create_root_bus(>dev,
7590e500 Bjorn Helgaas  2011-10-28  989  
dino_current_bus, _cfg_ops, NULL, );
c4e06576 Bjorn Helgaas  2011-10-28  990 if (!bus) {
c4e06576 Bjorn Helgaas  2011-10-28  991 printk(KERN_ERR "ERROR: 
failed to scan PCI bus on %s (duplicate bus number %d?)\n",

:: The code at line 988 was first introduced by commit
:: 7590e500ad83d9ac1e55eed4720e053eff14b8e5 parisc/PCI: dino: convert to 
pci_create_root_bus() for correct root bus resources

:: TO: Bjorn Helgaas 
:: CC: Jesse Barnes 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-26 Thread jakeo
From: Jake Oshins 

This patch allows a PCI front-end implementation to supply an fwnode_handle
associated with a root PCI bus, optionally.  If supplied, the PCI driver
records this.

This patch supports the next patch in the series, which looks up an IRQ domain
through this handle.

Signed-off-by: Jake Oshins 
---
 arch/sparc/kernel/pci.c   | 2 +-
 drivers/acpi/pci_root.c   | 2 +-
 drivers/parisc/lba_pci.c  | 2 +-
 drivers/pci/host/pci-xgene.c  | 2 +-
 drivers/pci/host/pcie-iproc.c | 3 ++-
 drivers/pci/probe.c   | 8 +---
 include/linux/pci.h   | 4 +++-
 7 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index b91d7f1..3d4e9f9 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -660,7 +660,7 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
pbm->busn.flags = IORESOURCE_BUS;
pci_add_resource(, >busn);
bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
- pbm, );
+ pbm, , NULL);
if (!bus) {
printk(KERN_ERR "Failed to create bus for %s\n",
   node->full_name);
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 850d7bf..eab95bc 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -840,7 +840,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root 
*root,
pci_acpi_root_add_resources(info);
pci_add_resource(>resources, >secondary);
bus = pci_create_root_bus(NULL, busnum, ops->pci_ops,
- sysdata, >resources);
+ sysdata, >resources, NULL);
if (!bus)
goto out_release_info;
 
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index a32c1f6..a7b9d5c 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -1567,7 +1567,7 @@ lba_driver_probe(struct parisc_device *dev)
dev->dev.platform_data = lba_dev;
lba_bus = lba_dev->hba.hba_bus =
pci_create_root_bus(>dev, lba_dev->hba.bus_num.start,
-   cfg_ops, NULL, );
+   cfg_ops, NULL, , NULL);
if (!lba_bus) {
pci_free_resource_list();
return 0;
diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
index ae00ce2..95c20c8 100644
--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -545,7 +545,7 @@ static int xgene_pcie_probe_bridge(struct platform_device 
*pdev)
return ret;
 
bus = pci_create_root_bus(>dev, 0,
-   _pcie_ops, port, );
+   _pcie_ops, port, , NULL);
if (!bus)
return -ENOMEM;
 
diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
index 9193951..bc999b7 100644
--- a/drivers/pci/host/pcie-iproc.c
+++ b/drivers/pci/host/pcie-iproc.c
@@ -357,7 +357,8 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct 
list_head *res)
sysdata = pcie;
 #endif
 
-   bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res);
+   bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res,
+ NULL);
if (!bus) {
dev_err(pcie->dev, "unable to create PCI root bus\n");
ret = -ENOMEM;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f441d1b..c0f2e44 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2039,7 +2039,8 @@ void __weak pcibios_remove_bus(struct pci_bus *bus)
 }
 
 struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
-   struct pci_ops *ops, void *sysdata, struct list_head *resources)
+   struct pci_ops *ops, void *sysdata, struct list_head *resources,
+   struct fwnode_handle *fwnode)
 {
int error;
struct pci_host_bridge *bridge;
@@ -2069,6 +2070,7 @@ struct pci_bus *pci_create_root_bus(struct device 
*parent, int bus,
if (!bridge)
goto err_out;
 
+   bridge->fwnode = fwnode;
bridge->dev.parent = parent;
bridge->dev.release = pci_release_host_bridge_dev;
dev_set_name(>dev, "pci%04x:%02x", pci_domain_nr(b), bus);
@@ -2223,7 +2225,7 @@ struct pci_bus *pci_scan_root_bus_msi(struct device 
*parent, int bus,
break;
}
 
-   b = pci_create_root_bus(parent, bus, ops, sysdata, resources);
+   b = pci_create_root_bus(parent, bus, ops, sysdata, resources, NULL);
if (!b)
return NULL;
 
@@ -2261,7 +2263,7 @@ struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops,
pci_add_resource(, _resource);
pci_add_resource(, _resource);
pci_add_resource(, _resource);
-   b = pci_create_root_bus(NULL, bus, 

[PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-26 Thread jakeo
From: Jake Oshins 

This patch allows a PCI front-end implementation to supply an fwnode_handle
associated with a root PCI bus, optionally.  If supplied, the PCI driver
records this.

This patch supports the next patch in the series, which looks up an IRQ domain
through this handle.

Signed-off-by: Jake Oshins 
---
 arch/sparc/kernel/pci.c   | 2 +-
 drivers/acpi/pci_root.c   | 2 +-
 drivers/parisc/lba_pci.c  | 2 +-
 drivers/pci/host/pci-xgene.c  | 2 +-
 drivers/pci/host/pcie-iproc.c | 3 ++-
 drivers/pci/probe.c   | 8 +---
 include/linux/pci.h   | 4 +++-
 7 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index b91d7f1..3d4e9f9 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -660,7 +660,7 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm,
pbm->busn.flags = IORESOURCE_BUS;
pci_add_resource(, >busn);
bus = pci_create_root_bus(parent, pbm->pci_first_busno, pbm->pci_ops,
- pbm, );
+ pbm, , NULL);
if (!bus) {
printk(KERN_ERR "Failed to create bus for %s\n",
   node->full_name);
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 850d7bf..eab95bc 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -840,7 +840,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root 
*root,
pci_acpi_root_add_resources(info);
pci_add_resource(>resources, >secondary);
bus = pci_create_root_bus(NULL, busnum, ops->pci_ops,
- sysdata, >resources);
+ sysdata, >resources, NULL);
if (!bus)
goto out_release_info;
 
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index a32c1f6..a7b9d5c 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -1567,7 +1567,7 @@ lba_driver_probe(struct parisc_device *dev)
dev->dev.platform_data = lba_dev;
lba_bus = lba_dev->hba.hba_bus =
pci_create_root_bus(>dev, lba_dev->hba.bus_num.start,
-   cfg_ops, NULL, );
+   cfg_ops, NULL, , NULL);
if (!lba_bus) {
pci_free_resource_list();
return 0;
diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
index ae00ce2..95c20c8 100644
--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -545,7 +545,7 @@ static int xgene_pcie_probe_bridge(struct platform_device 
*pdev)
return ret;
 
bus = pci_create_root_bus(>dev, 0,
-   _pcie_ops, port, );
+   _pcie_ops, port, , NULL);
if (!bus)
return -ENOMEM;
 
diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
index 9193951..bc999b7 100644
--- a/drivers/pci/host/pcie-iproc.c
+++ b/drivers/pci/host/pcie-iproc.c
@@ -357,7 +357,8 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct 
list_head *res)
sysdata = pcie;
 #endif
 
-   bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res);
+   bus = pci_create_root_bus(pcie->dev, 0, _pcie_ops, sysdata, res,
+ NULL);
if (!bus) {
dev_err(pcie->dev, "unable to create PCI root bus\n");
ret = -ENOMEM;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f441d1b..c0f2e44 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2039,7 +2039,8 @@ void __weak pcibios_remove_bus(struct pci_bus *bus)
 }
 
 struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
-   struct pci_ops *ops, void *sysdata, struct list_head *resources)
+   struct pci_ops *ops, void *sysdata, struct list_head *resources,
+   struct fwnode_handle *fwnode)
 {
int error;
struct pci_host_bridge *bridge;
@@ -2069,6 +2070,7 @@ struct pci_bus *pci_create_root_bus(struct device 
*parent, int bus,
if (!bridge)
goto err_out;
 
+   bridge->fwnode = fwnode;
bridge->dev.parent = parent;
bridge->dev.release = pci_release_host_bridge_dev;
dev_set_name(>dev, "pci%04x:%02x", pci_domain_nr(b), bus);
@@ -2223,7 +2225,7 @@ struct pci_bus *pci_scan_root_bus_msi(struct device 
*parent, int bus,
break;
}
 
-   b = pci_create_root_bus(parent, bus, ops, sysdata, resources);
+   b = pci_create_root_bus(parent, bus, ops, sysdata, resources, NULL);
if (!b)
return NULL;
 
@@ -2261,7 +2263,7 @@ struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops,
pci_add_resource(, _resource);
pci_add_resource(, _resource);
pci_add_resource(, _resource);
-   

Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-26 Thread kbuild test robot
Hi Jake,

[auto build test ERROR on next-20151022 -- if it's inappropriate base, please 
suggest rules for selecting the more suitable base]

url:
https://github.com/0day-ci/linux/commits/jakeo-microsoft-com/New-paravirtual-PCI-front-end-for-Hyper-V-VMs/20151027-072118
config: parisc-b180_defconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=parisc 

All errors (new ones prefixed by >>):

   drivers/parisc/dino.c: In function 'dino_probe':
>> drivers/parisc/dino.c:988:32: error: too few arguments to function 
>> 'pci_create_root_bus'
 dino_dev->hba.hba_bus = bus = pci_create_root_bus(>dev,
   ^
   In file included from drivers/parisc/dino.c:49:0:
   include/linux/pci.h:791:17: note: declared here
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
^

vim +/pci_create_root_bus +988 drivers/parisc/dino.c

30aa80da Yinghai Lu 2012-05-17  982 dino_dev->hba.bus_num.flags = 
IORESOURCE_BUS;
30aa80da Yinghai Lu 2012-05-17  983 pci_add_resource(, 
_dev->hba.bus_num);
^1da177e Linus Torvalds 2005-04-16  984 /*
^1da177e Linus Torvalds 2005-04-16  985 ** It's not used to avoid 
chicken/egg problems
^1da177e Linus Torvalds 2005-04-16  986 ** with configuration accessor 
functions.
^1da177e Linus Torvalds 2005-04-16  987 */
7590e500 Bjorn Helgaas  2011-10-28 @988 dino_dev->hba.hba_bus = bus = 
pci_create_root_bus(>dev,
7590e500 Bjorn Helgaas  2011-10-28  989  
dino_current_bus, _cfg_ops, NULL, );
c4e06576 Bjorn Helgaas  2011-10-28  990 if (!bus) {
c4e06576 Bjorn Helgaas  2011-10-28  991 printk(KERN_ERR "ERROR: 
failed to scan PCI bus on %s (duplicate bus number %d?)\n",

:: The code at line 988 was first introduced by commit
:: 7590e500ad83d9ac1e55eed4720e053eff14b8e5 parisc/PCI: dino: convert to 
pci_create_root_bus() for correct root bus resources

:: TO: Bjorn Helgaas 
:: CC: Jesse Barnes 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH v3 4/7] PCI: Record an fwnode associated with root PCI buses, optionally

2015-10-26 Thread kbuild test robot
Hi Jake,

[auto build test ERROR on next-20151022 -- if it's inappropriate base, please 
suggest rules for selecting the more suitable base]

url:
https://github.com/0day-ci/linux/commits/jakeo-microsoft-com/New-paravirtual-PCI-front-end-for-Hyper-V-VMs/20151027-072118
config: powerpc-defconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   arch/powerpc/kernel/pci-common.c: In function 'pcibios_scan_phb':
>> arch/powerpc/kernel/pci-common.c:1621:8: error: too few arguments to 
>> function 'pci_create_root_bus'
 bus = pci_create_root_bus(hose->parent, hose->first_busno,
   ^
   In file included from arch/powerpc/kernel/pci-common.c:20:0:
   include/linux/pci.h:791:17: note: declared here
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
^

vim +/pci_create_root_bus +1621 arch/powerpc/kernel/pci-common.c

be8e60d8 Yinghai Lu2012-05-17  1615 hose->busn.start = 
hose->first_busno;
be8e60d8 Yinghai Lu2012-05-17  1616 hose->busn.end   = 
hose->last_busno;
be8e60d8 Yinghai Lu2012-05-17  1617 hose->busn.flags = 
IORESOURCE_BUS;
be8e60d8 Yinghai Lu2012-05-17  1618 pci_add_resource(, 
>busn);
be8e60d8 Yinghai Lu2012-05-17  1619  
0ed2c722 Grant Likely  2009-08-28  1620 /* Create an empty bus for the 
toplevel */
45a709f8 Bjorn Helgaas 2011-10-28 @1621 bus = 
pci_create_root_bus(hose->parent, hose->first_busno,
45a709f8 Bjorn Helgaas 2011-10-28  1622   
hose->ops, hose, );
0ed2c722 Grant Likely  2009-08-28  1623 if (bus == NULL) {
0ed2c722 Grant Likely  2009-08-28  1624 pr_err("Failed to 
create bus for PCI domain %04x\n",

:: The code at line 1621 was first introduced by commit
:: 45a709f890a7b84930942a5f5f82011312fe727c powerpc/PCI: convert to 
pci_create_root_bus()

:: TO: Bjorn Helgaas 
:: CC: Jesse Barnes 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data