From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754064AbbCICvj (ORCPT ); Sun, 8 Mar 2015 22:51:39 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:23382 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752277AbbCICnI (ORCPT ); Sun, 8 Mar 2015 22:43:08 -0400 From: Yijing Wang To: Bjorn Helgaas CC: Jiang Liu , , Yinghai Lu , , Marc Zyngier , , Russell King , , Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , , "David S. Miller" , "Guan Xuetao" , , , Liviu Dudau , "Arnd Bergmann" , Geert Uytterhoeven , "Yijing Wang" , Bjorn Helgaas Subject: [PATCH v6 13/30] PCI: Introduce new scan function pci_scan_host_bridge() Date: Mon, 9 Mar 2015 10:34:10 +0800 Message-ID: <1425868467-9667-14-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce new scan function pci_scan_host_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 4 ++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 59d9be3..99f17e3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2064,6 +2064,28 @@ static struct pci_bus *__pci_scan_root_bus( return b; } +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 db, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops) +{ + struct pci_host_bridge *host; + struct pci_bus *bus; + + host = pci_create_host_bridge(parent, db, resources, + sysdata, phb_ops); + if (!host) + return NULL; + + bus = __pci_scan_root_bus(host, ops); + if (!bus) + pci_free_host_bridge(host); + + return host; +} +EXPORT_SYMBOL(pci_scan_host_bridge); + + struct pci_bus *pci_scan_root_bus(struct device *parent, u32 db, struct pci_ops *ops, void *sysdata, struct list_head *resources) { diff --git a/include/linux/pci.h b/include/linux/pci.h index e9922b1..28eafb5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -790,6 +790,10 @@ void pci_bus_release_busn_res(struct pci_bus *b); struct pci_bus *pci_scan_root_bus(struct device *parent, u32 dombus, struct pci_ops *ops, void *sysdata, struct list_head *resources); +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 dombus, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops); struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Subject: [PATCH v6 13/30] PCI: Introduce new scan function pci_scan_host_bridge() Date: Mon, 9 Mar 2015 10:34:10 +0800 Message-ID: <1425868467-9667-14-git-send-email-wangyijing@huawei.com> References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> Sender: linux-m68k-owner@vger.kernel.org List-Id: linux-m68k@vger.kernel.org Cc: Jiang Liu , linux-pci@vger.kernel.org, Yinghai Lu , linux-kernel@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Russell King , x86@kernel.org, Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , linux-ia64@vger.kernel.org, "David S. Miller" , Guan Xuetao , linux-alpha@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Liviu Dudau , Arnd Bergmann , Geert Uytterhoeven , Yijing Wang , Bjorn Helgaas Introduce new scan function pci_scan_host_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 4 ++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 59d9be3..99f17e3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2064,6 +2064,28 @@ static struct pci_bus *__pci_scan_root_bus( return b; } +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 db, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops) +{ + struct pci_host_bridge *host; + struct pci_bus *bus; + + host = pci_create_host_bridge(parent, db, resources, + sysdata, phb_ops); + if (!host) + return NULL; + + bus = __pci_scan_root_bus(host, ops); + if (!bus) + pci_free_host_bridge(host); + + return host; +} +EXPORT_SYMBOL(pci_scan_host_bridge); + + struct pci_bus *pci_scan_root_bus(struct device *parent, u32 db, struct pci_ops *ops, void *sysdata, struct list_head *resources) { diff --git a/include/linux/pci.h b/include/linux/pci.h index e9922b1..28eafb5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -790,6 +790,10 @@ void pci_bus_release_busn_res(struct pci_bus *b); struct pci_bus *pci_scan_root_bus(struct device *parent, u32 dombus, struct pci_ops *ops, void *sysdata, struct list_head *resources); +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 dombus, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops); struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga01-in.huawei.com ([58.251.152.64]:23382 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752277AbbCICnI (ORCPT ); Sun, 8 Mar 2015 22:43:08 -0400 From: Yijing Wang To: Bjorn Helgaas CC: Jiang Liu , , Yinghai Lu , , Marc Zyngier , , Russell King , , Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , , "David S. Miller" , "Guan Xuetao" , , , Liviu Dudau , "Arnd Bergmann" , Geert Uytterhoeven , "Yijing Wang" , Bjorn Helgaas Subject: [PATCH v6 13/30] PCI: Introduce new scan function pci_scan_host_bridge() Date: Mon, 9 Mar 2015 10:34:10 +0800 Message-ID: <1425868467-9667-14-git-send-email-wangyijing@huawei.com> In-Reply-To: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-pci-owner@vger.kernel.org List-ID: Introduce new scan function pci_scan_host_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 4 ++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 59d9be3..99f17e3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2064,6 +2064,28 @@ static struct pci_bus *__pci_scan_root_bus( return b; } +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 db, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops) +{ + struct pci_host_bridge *host; + struct pci_bus *bus; + + host = pci_create_host_bridge(parent, db, resources, + sysdata, phb_ops); + if (!host) + return NULL; + + bus = __pci_scan_root_bus(host, ops); + if (!bus) + pci_free_host_bridge(host); + + return host; +} +EXPORT_SYMBOL(pci_scan_host_bridge); + + struct pci_bus *pci_scan_root_bus(struct device *parent, u32 db, struct pci_ops *ops, void *sysdata, struct list_head *resources) { diff --git a/include/linux/pci.h b/include/linux/pci.h index e9922b1..28eafb5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -790,6 +790,10 @@ void pci_bus_release_busn_res(struct pci_bus *b); struct pci_bus *pci_scan_root_bus(struct device *parent, u32 dombus, struct pci_ops *ops, void *sysdata, struct list_head *resources); +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 dombus, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops); struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: wangyijing@huawei.com (Yijing Wang) Date: Mon, 9 Mar 2015 10:34:10 +0800 Subject: [PATCH v6 13/30] PCI: Introduce new scan function pci_scan_host_bridge() In-Reply-To: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> Message-ID: <1425868467-9667-14-git-send-email-wangyijing@huawei.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Introduce new scan function pci_scan_host_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 4 ++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 59d9be3..99f17e3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2064,6 +2064,28 @@ static struct pci_bus *__pci_scan_root_bus( return b; } +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 db, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops) +{ + struct pci_host_bridge *host; + struct pci_bus *bus; + + host = pci_create_host_bridge(parent, db, resources, + sysdata, phb_ops); + if (!host) + return NULL; + + bus = __pci_scan_root_bus(host, ops); + if (!bus) + pci_free_host_bridge(host); + + return host; +} +EXPORT_SYMBOL(pci_scan_host_bridge); + + struct pci_bus *pci_scan_root_bus(struct device *parent, u32 db, struct pci_ops *ops, void *sysdata, struct list_head *resources) { diff --git a/include/linux/pci.h b/include/linux/pci.h index e9922b1..28eafb5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -790,6 +790,10 @@ void pci_bus_release_busn_res(struct pci_bus *b); struct pci_bus *pci_scan_root_bus(struct device *parent, u32 dombus, struct pci_ops *ops, void *sysdata, struct list_head *resources); +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 dombus, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops); struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Date: Mon, 09 Mar 2015 02:34:10 +0000 Subject: [PATCH v6 13/30] PCI: Introduce new scan function pci_scan_host_bridge() Message-Id: <1425868467-9667-14-git-send-email-wangyijing@huawei.com> List-Id: References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> In-Reply-To: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bjorn Helgaas Cc: Jiang Liu , linux-pci@vger.kernel.org, Yinghai Lu , linux-kernel@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Russell King , x86@kernel.org, Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , linux-ia64@vger.kernel.org, "David S. Miller" , Guan Xuetao , linux-alpha@vger.kernel.org, linux-m68k@vger.kernel.org, Liviu Dudau , Arnd Bergmann , Geert Uytterhoeven , Yijing Wang , Bjorn Helgaas Introduce new scan function pci_scan_host_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 4 ++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 59d9be3..99f17e3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2064,6 +2064,28 @@ static struct pci_bus *__pci_scan_root_bus( return b; } +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 db, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops) +{ + struct pci_host_bridge *host; + struct pci_bus *bus; + + host = pci_create_host_bridge(parent, db, resources, + sysdata, phb_ops); + if (!host) + return NULL; + + bus = __pci_scan_root_bus(host, ops); + if (!bus) + pci_free_host_bridge(host); + + return host; +} +EXPORT_SYMBOL(pci_scan_host_bridge); + + struct pci_bus *pci_scan_root_bus(struct device *parent, u32 db, struct pci_ops *ops, void *sysdata, struct list_head *resources) { diff --git a/include/linux/pci.h b/include/linux/pci.h index e9922b1..28eafb5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -790,6 +790,10 @@ void pci_bus_release_busn_res(struct pci_bus *b); struct pci_bus *pci_scan_root_bus(struct device *parent, u32 dombus, struct pci_ops *ops, void *sysdata, struct list_head *resources); +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 dombus, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops); struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yijing Wang Subject: [PATCH v6 13/30] PCI: Introduce new scan function pci_scan_host_bridge() Date: Mon, 9 Mar 2015 10:34:10 +0800 Message-ID: <1425868467-9667-14-git-send-email-wangyijing@huawei.com> References: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> Mime-Version: 1.0 Return-path: In-Reply-To: <1425868467-9667-1-git-send-email-wangyijing@huawei.com> Sender: linux-m68k-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bjorn Helgaas Cc: Jiang Liu , linux-pci@vger.kernel.org, Yinghai Lu , linux-kernel@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Russell King , x86@kernel.org, Thomas Gleixner , Benjamin Herrenschmidt , Rusty Russell , Tony Luck , linux-ia64@vger.kernel.org, "David S. Miller" , Guan Xuetao , linux-alpha@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Liviu Dudau , Arnd Bergmann , Geert Uytterhoeven , Yijing Wang , Bjorn Helgaas Introduce new scan function pci_scan_host_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 22 ++++++++++++++++++++++ include/linux/pci.h | 4 ++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 59d9be3..99f17e3 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2064,6 +2064,28 @@ static struct pci_bus *__pci_scan_root_bus( return b; } +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 db, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops) +{ + struct pci_host_bridge *host; + struct pci_bus *bus; + + host = pci_create_host_bridge(parent, db, resources, + sysdata, phb_ops); + if (!host) + return NULL; + + bus = __pci_scan_root_bus(host, ops); + if (!bus) + pci_free_host_bridge(host); + + return host; +} +EXPORT_SYMBOL(pci_scan_host_bridge); + + struct pci_bus *pci_scan_root_bus(struct device *parent, u32 db, struct pci_ops *ops, void *sysdata, struct list_head *resources) { diff --git a/include/linux/pci.h b/include/linux/pci.h index e9922b1..28eafb5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -790,6 +790,10 @@ void pci_bus_release_busn_res(struct pci_bus *b); struct pci_bus *pci_scan_root_bus(struct device *parent, u32 dombus, struct pci_ops *ops, void *sysdata, struct list_head *resources); +struct pci_host_bridge *pci_scan_host_bridge(struct device *parent, + u32 dombus, struct pci_ops *ops, void *sysdata, + struct list_head *resources, + struct pci_host_bridge_ops *phb_ops); struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); -- 1.7.1