linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI-DW: ARM64: check the result of hos_init
@ 2017-02-15  7:52 songxiaowei
  2017-02-15  8:47 ` kbuild test robot
  2017-02-15  9:13 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: songxiaowei @ 2017-02-15  7:52 UTC (permalink / raw)
  To: jingoohan1, Joao.Pinto, bhelgaas, linux-pci, linux-kernel
  Cc: songxiaowei, wangbinghui

Enumeration should be prevented 
when Host initialization fails.
Only one device link with Host escpecially, 
if host initialization fails or
establishling link-up is not successful,
there may no need for the Enumeration.

Signed-off-by: songxiaowei <songxiaowei@huawei.com>
---
 drivers/pci/host/pcie-designware.c | 7 +++++--
 drivers/pci/host/pcie-designware.h | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index bed19994c1e9..561a2edaf06f 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -637,8 +637,11 @@ int dw_pcie_host_init(struct pcie_port *pp)
 		}
 	}
 
-	if (pp->ops->host_init)
-		pp->ops->host_init(pp);
+	if (pp->ops->host_init) {
+		ret = pp->ops->host_init(pp);
+		if (ret)
+			return ret;
+	}
 
 	pp->root_bus_nr = pp->busn->start;
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h
index a567ea288ee2..eacf18f9fc79 100644
--- a/drivers/pci/host/pcie-designware.h
+++ b/drivers/pci/host/pcie-designware.h
@@ -63,7 +63,7 @@ struct pcie_host_ops {
 	int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
 			unsigned int devfn, int where, int size, u32 val);
 	int (*link_up)(struct pcie_port *pp);
-	void (*host_init)(struct pcie_port *pp);
+	int (*host_init)(struct pcie_port *pp);
 	void (*msi_set_irq)(struct pcie_port *pp, int irq);
 	void (*msi_clear_irq)(struct pcie_port *pp, int irq);
 	phys_addr_t (*get_msi_addr)(struct pcie_port *pp);
-- 
2.11.GIT

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI-DW: ARM64: check the result of hos_init
  2017-02-15  7:52 [PATCH] PCI-DW: ARM64: check the result of hos_init songxiaowei
@ 2017-02-15  8:47 ` kbuild test robot
  2017-02-15  9:13 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2017-02-15  8:47 UTC (permalink / raw)
  To: songxiaowei
  Cc: kbuild-all, jingoohan1, Joao.Pinto, bhelgaas, linux-pci,
	linux-kernel, songxiaowei, wangbinghui

[-- Attachment #1: Type: text/plain, Size: 2944 bytes --]

Hi songxiaowei,

[auto build test ERROR on pci/next]
[also build test ERROR on v4.10-rc8 next-20170215]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/songxiaowei/PCI-DW-ARM64-check-the-result-of-hos_init/20170215-155753
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: i386-randconfig-a0-02131010 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/pci/host/pcie-designware-plat.c:48:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .host_init = dw_plat_pcie_host_init,
                  ^~~~~~~~~~~~~~~~~~~~~~
   drivers/pci/host/pcie-designware-plat.c:48:15: note: (near initialization for 'dw_plat_pcie_host_ops.host_init')
   cc1: some warnings being treated as errors

vim +48 drivers/pci/host/pcie-designware-plat.c

5a3aa2a8 Joao Pinto    2016-03-10  32  {
5a3aa2a8 Joao Pinto    2016-03-10  33  	struct pcie_port *pp = arg;
5a3aa2a8 Joao Pinto    2016-03-10  34  
5a3aa2a8 Joao Pinto    2016-03-10  35  	return dw_handle_msi_irq(pp);
5a3aa2a8 Joao Pinto    2016-03-10  36  }
5a3aa2a8 Joao Pinto    2016-03-10  37  
5a3aa2a8 Joao Pinto    2016-03-10  38  static void dw_plat_pcie_host_init(struct pcie_port *pp)
5a3aa2a8 Joao Pinto    2016-03-10  39  {
5a3aa2a8 Joao Pinto    2016-03-10  40  	dw_pcie_setup_rc(pp);
5a3aa2a8 Joao Pinto    2016-03-10  41  	dw_pcie_wait_for_link(pp);
5a3aa2a8 Joao Pinto    2016-03-10  42  
5a3aa2a8 Joao Pinto    2016-03-10  43  	if (IS_ENABLED(CONFIG_PCI_MSI))
5a3aa2a8 Joao Pinto    2016-03-10  44  		dw_pcie_msi_init(pp);
5a3aa2a8 Joao Pinto    2016-03-10  45  }
5a3aa2a8 Joao Pinto    2016-03-10  46  
5a3aa2a8 Joao Pinto    2016-03-10  47  static struct pcie_host_ops dw_plat_pcie_host_ops = {
5a3aa2a8 Joao Pinto    2016-03-10 @48  	.host_init = dw_plat_pcie_host_init,
5a3aa2a8 Joao Pinto    2016-03-10  49  };
5a3aa2a8 Joao Pinto    2016-03-10  50  
5a3aa2a8 Joao Pinto    2016-03-10  51  static int dw_plat_add_pcie_port(struct pcie_port *pp,
5a3aa2a8 Joao Pinto    2016-03-10  52  				 struct platform_device *pdev)
5a3aa2a8 Joao Pinto    2016-03-10  53  {
2d6054b9 Bjorn Helgaas 2016-10-06  54  	struct device *dev = pp->dev;
5a3aa2a8 Joao Pinto    2016-03-10  55  	int ret;
5a3aa2a8 Joao Pinto    2016-03-10  56  

:::::: The code at line 48 was first introduced by commit
:::::: 5a3aa2a8fae4ce1a3ad786d212b8fffca8ee72f5 PCI: designware: Add driver for prototyping kits based on ARC SDP

:::::: TO: Joao Pinto <Joao.Pinto@synopsys.com>
:::::: CC: Bjorn Helgaas <bhelgaas@google.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26459 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI-DW: ARM64: check the result of hos_init
  2017-02-15  7:52 [PATCH] PCI-DW: ARM64: check the result of hos_init songxiaowei
  2017-02-15  8:47 ` kbuild test robot
@ 2017-02-15  9:13 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2017-02-15  9:13 UTC (permalink / raw)
  To: songxiaowei
  Cc: kbuild-all, jingoohan1, Joao.Pinto, bhelgaas, linux-pci,
	linux-kernel, songxiaowei, wangbinghui

[-- Attachment #1: Type: text/plain, Size: 2831 bytes --]

Hi songxiaowei,

[auto build test WARNING on pci/next]
[also build test WARNING on v4.10-rc8 next-20170215]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/songxiaowei/PCI-DW-ARM64-check-the-result-of-hos_init/20170215-155753
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: x86_64-randconfig-i0-201707 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

>> drivers/pci/host/pcie-designware-plat.c:48:2: warning: initialization from incompatible pointer type
     .host_init = dw_plat_pcie_host_init,
     ^
   drivers/pci/host/pcie-designware-plat.c:48:2: warning: (near initialization for 'dw_plat_pcie_host_ops.host_init')

vim +48 drivers/pci/host/pcie-designware-plat.c

5a3aa2a8 Joao Pinto    2016-03-10  32  {
5a3aa2a8 Joao Pinto    2016-03-10  33  	struct pcie_port *pp = arg;
5a3aa2a8 Joao Pinto    2016-03-10  34  
5a3aa2a8 Joao Pinto    2016-03-10  35  	return dw_handle_msi_irq(pp);
5a3aa2a8 Joao Pinto    2016-03-10  36  }
5a3aa2a8 Joao Pinto    2016-03-10  37  
5a3aa2a8 Joao Pinto    2016-03-10  38  static void dw_plat_pcie_host_init(struct pcie_port *pp)
5a3aa2a8 Joao Pinto    2016-03-10  39  {
5a3aa2a8 Joao Pinto    2016-03-10  40  	dw_pcie_setup_rc(pp);
5a3aa2a8 Joao Pinto    2016-03-10  41  	dw_pcie_wait_for_link(pp);
5a3aa2a8 Joao Pinto    2016-03-10  42  
5a3aa2a8 Joao Pinto    2016-03-10  43  	if (IS_ENABLED(CONFIG_PCI_MSI))
5a3aa2a8 Joao Pinto    2016-03-10  44  		dw_pcie_msi_init(pp);
5a3aa2a8 Joao Pinto    2016-03-10  45  }
5a3aa2a8 Joao Pinto    2016-03-10  46  
5a3aa2a8 Joao Pinto    2016-03-10  47  static struct pcie_host_ops dw_plat_pcie_host_ops = {
5a3aa2a8 Joao Pinto    2016-03-10 @48  	.host_init = dw_plat_pcie_host_init,
5a3aa2a8 Joao Pinto    2016-03-10  49  };
5a3aa2a8 Joao Pinto    2016-03-10  50  
5a3aa2a8 Joao Pinto    2016-03-10  51  static int dw_plat_add_pcie_port(struct pcie_port *pp,
5a3aa2a8 Joao Pinto    2016-03-10  52  				 struct platform_device *pdev)
5a3aa2a8 Joao Pinto    2016-03-10  53  {
2d6054b9 Bjorn Helgaas 2016-10-06  54  	struct device *dev = pp->dev;
5a3aa2a8 Joao Pinto    2016-03-10  55  	int ret;
5a3aa2a8 Joao Pinto    2016-03-10  56  

:::::: The code at line 48 was first introduced by commit
:::::: 5a3aa2a8fae4ce1a3ad786d212b8fffca8ee72f5 PCI: designware: Add driver for prototyping kits based on ARC SDP

:::::: TO: Joao Pinto <Joao.Pinto@synopsys.com>
:::::: CC: Bjorn Helgaas <bhelgaas@google.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27586 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-15  9:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15  7:52 [PATCH] PCI-DW: ARM64: check the result of hos_init songxiaowei
2017-02-15  8:47 ` kbuild test robot
2017-02-15  9:13 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).