Re: [RFC PATCH 01/16] PCI: Enhance pci_scan_root_bus() to support default IO/MEM resources

2014-11-17 Thread Yijing Wang
On 2014/11/17 18:08, Arnd Bergmann wrote: > On Monday 17 November 2014 18:21:35 Yijing Wang wrote: >> - list_for_each_entry(window, resources, list) >> - if (window->res->flags & IORESOURCE_BUS) { >> - found = true; &

Re: [RFC PATCH 07/16] PCI: Separate pci_host_bridge creation out of pci_create_root_bus()

2014-11-18 Thread Yijing Wang
>> +LIST_HEAD(pci_host_bridge_list); >> +DECLARE_RWSEM(pci_host_bridge_sem); > > Unless the pci_host_bridge_sem is accessed thousands of times per second, > it's normally better to use a simple mutex instead. OK, I will use simple mutex instead. > >> +static struct resource busn_resource = { >

Re: [RFC PATCH 00/16] Refine PCI host bridge scan interfaces

2014-11-18 Thread Yijing Wang
On 2014/11/17 22:13, Arnd Bergmann wrote: > On Monday 17 November 2014 18:21:34 Yijing Wang wrote: >> This series is based Linux 3.18-rc1 and Lorenzo Pieralisi's >> arm PCI domain cleanup patches, link: >> https://patchwork.ozlabs.org/patch/407585/ >> >

Re: [RFC PATCH 07/16] PCI: Separate pci_host_bridge creation out of pci_create_root_bus()

2014-11-18 Thread Yijing Wang
On 2014/11/18 17:30, Arnd Bergmann wrote: > On Tuesday 18 November 2014 16:32:26 Yijing Wang wrote: > >>>> +static struct resource busn_resource = { >>>> + .name = "PCI busn", >>>> + .start = 0, >>>> + .end= 255, >&g

Re: [RFC PATCH 01/16] PCI: Enhance pci_scan_root_bus() to support default IO/MEM resources

2014-11-18 Thread Yijing Wang
On 2014/11/18 17:36, Arnd Bergmann wrote: > On Tuesday 18 November 2014 15:44:23 Yijing Wang wrote: >> On 2014/11/17 18:08, Arnd Bergmann wrote: >>> On Monday 17 November 2014 18:21:35 Yijing Wang wrote: >>>> - list_for_each_entry(window, resources, list) >&g

Re: [RFC PATCH 00/16] Refine PCI host bridge scan interfaces

2014-11-18 Thread Yijing Wang
On 2014/11/18 19:45, Lorenzo Pieralisi wrote: > On Tue, Nov 18, 2014 at 11:30:11AM +, Arnd Bergmann wrote: >> On Tuesday 18 November 2014 19:17:32 Yijing Wang wrote: >>> On 2014/11/17 22:13, Arnd Bergmann wrote: >>>> On Monday 17 November 2014 18:21:34 Yijing Wa

Re: [RFC PATCH 00/16] Refine PCI host bridge scan interfaces

2014-11-18 Thread Yijing Wang
On 2014/11/18 19:30, Arnd Bergmann wrote: > On Tuesday 18 November 2014 19:17:32 Yijing Wang wrote: >> On 2014/11/17 22:13, Arnd Bergmann wrote: >>> On Monday 17 November 2014 18:21:34 Yijing Wang wrote: >>>> This series is based Linux 3.18-rc1 and Lorenzo Pieralisi

Re: [RFC PATCH 07/16] PCI: Separate pci_host_bridge creation out of pci_create_root_bus()

2014-11-18 Thread Yijing Wang
We need, some platforms pass NULL pointer as host bridge parent. >>> >>> But those don't have to use the new pci_create_host_bridge() function, >>> right? >> >> As I mentioned in another reply, I hope all pci host drivers could use >> pci_create_host_bridge(), keep different PCI scan interface

Re: [PATCH v3 22/27] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-10-16 Thread Yijing Wang
On 2014/10/16 20:13, Sebastian Ott wrote: > On Wed, 15 Oct 2014, Yijing Wang wrote: >> Use MSI chip framework instead of arch MSI functions to configure >> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. >> >> Signed-off-by: Yijing Wang >

Re: [PATCH v3 21/27] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-10-17 Thread Yijing Wang
On 2014/10/17 15:23, Michael Ellerman wrote: > On Wed, 2014-10-15 at 11:07 +0800, Yijing Wang wrote: >> Use MSI chip framework instead of arch MSI functions to configure >> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. >> >> Signed-off-by: Yijing

Re: [PATCH v3 04/27] arm/MSI: Save MSI chip in pci_sys_data

2014-10-20 Thread Yijing Wang
On 2014/10/21 1:21, Lorenzo Pieralisi wrote: > On Wed, Oct 15, 2014 at 04:06:52AM +0100, Yijing Wang wrote: >> Saving msi chip in pci_sys_data can make pci bus and >> devices don't need to know msi chip detail, it also >> make pci enumeration code be decoupled from msi

Re: e1000e pci_disable_link_state_locked() issues

2015-05-22 Thread Yijing Wang
On 2015/5/21 3:47, Bjorn Helgaas wrote: > I think we have some issues with the e1000e usage of > pci_disable_link_state_locked(), which Yinghai added with 9f728f53dd70 > ("PCI/e1000e: Add and use pci_disable_link_state_locked()"). > > That fixed an AER deadlock in the following path, where pci_bus

Re: e1000e pci_disable_link_state_locked() issues

2015-05-22 Thread Yijing Wang
On 2015/5/21 3:47, Bjorn Helgaas wrote: > I think we have some issues with the e1000e usage of > pci_disable_link_state_locked(), which Yinghai added with 9f728f53dd70 > ("PCI/e1000e: Add and use pci_disable_link_state_locked()"). > > That fixed an AER deadlock in the following path, where pci_bus

Re: [PATCH v2 00/30] Refine PCI scan interfaces and make generic pci host bridge

2015-02-25 Thread Yijing Wang
On 2015/2/26 7:09, Bjorn Helgaas wrote: > On Wed, Jan 21, 2015 at 08:29:55AM +0800, Yijing Wang wrote: >> v1->v2: >> Split pci_host_bridge_list into a new patch, remove .phb_probe_mode >> and rework powerpc .phb_of_scan_bus() for simpilicty suggested by >>

[PATCH v3 22/30] PCI/Parisc: Use pci_scan_root_bus() for simplicity

2015-02-25 Thread Yijing Wang
From: Yijing Wang Now pci_bus_add_devices() has been ripped out from pci_scan_root_bus(), we could use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. We could also remove the pci bus resource(dino_current_bus,255) and pci_bus_update_busn_res_end

[PATCH v3 10/30] PCI: Introduce pci_host_bridge_list to manage host bridges

2015-02-25 Thread Yijing Wang
Introduce pci_host_bridge_list to manage pci host bridges in system, so we could detect whether the host in domain:bus is alreay registered. Then we could remove bus alreay exist test in __pci_create_root_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c | 24

[PATCH v3 27/30] PCI: Rename __pci_create_root_bus() to pci_create_root_bus()

2015-02-25 Thread Yijing Wang
Now no one use pci_create_root_bus(), we could remove it and rename __pci_create_root_bus() to pci_create_root_bus(). Signed-off-by: wangyij...@huawei.com --- drivers/pci/probe.c | 27 --- include/linux/pci.h |3 --- 2 files changed, 8 insertions(+), 22 deletions(-)

[PATCH v3 02/30] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus()

2015-02-25 Thread Yijing Wang
. For arm hw_pci->scan() functions which call pci_scan_root_bus(), it's no need to change anything, because pci_bus_add_devices() will be called later in pci_common_init_dev(). Signed-off-by: Yijing Wang CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner CC: David Howells CC: T

[PATCH v3 07/30] PCI: Pass PCI domain number combined with root bus number

2015-02-25 Thread Yijing Wang
arm/arm64 to assign domain number in later patch. Signed-off-by: Yijing Wang CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner CC: Tony Luck CC: Fenghua Yu CC: Michal Simek CC: Ralf Baechle CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Sebastian Ott CC

[PATCH v3 28/30] PCI: Export find_pci_host_bridge()

2015-02-25 Thread Yijing Wang
Export find_pci_host_bridge(). Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |2 +- include/linux/pci.h |1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index 4a2baa2..51e24f8 100644 --- a/drivers

[PATCH v3 30/30] PCI: Remove pci_bus_assign_domain_nr()

2015-02-25 Thread Yijing Wang
Now we save the domain number in pci_host_bridge, we could remove pci_bus_assign_domain_nr() and clean the domain member in pci_bus. Signed-off-by: Yijing Wang --- drivers/pci/pci.c |5 - drivers/pci/probe.c | 12 include/linux/pci.h |3 --- 3 files changed, 4

[PATCH v3 18/30] PCI/powerpc: Use pci_scan_root_bridge() for simplicity

2015-02-25 Thread Yijing Wang
Now we could use pci_scan_root_bridge() to scan pci buses, provide powerpc specific pci_host_bridge_ops. Suggested-by: Arnd Bergmann Signed-off-by: Yijing Wang CC: Benjamin Herrenschmidt CC: linuxppc-...@lists.ozlabs.org --- arch/powerpc/include/asm/machdep.h |2 +- arch/powerpc

[PATCH v3 29/30] PCI: Remove platform specific pci_domain_nr()

2015-02-25 Thread Yijing Wang
Now pci_host_bridge holds the domain number, so we could eliminate all platform specific pci_domain_nr(). Signed-off-by: Yijing Wang --- arch/alpha/include/asm/pci.h |2 -- arch/ia64/include/asm/pci.h |1 - arch/microblaze/pci/pci-common.c | 11 --- arch/mips/include

[PATCH v3 09/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus()

2015-02-25 Thread Yijing Wang
, we could use the generic pci_host_bridge to hold host bridge specific operations like pcibios_root_bridge_prepare(). The changes are transparent to platform host bridge drivers. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c | 56 ++ drivers/pci/probe.c

[PATCH v3 26/30] PCI/xgene: Use pci_scan_root_bus() instead of pci_create_root_bus()

2015-02-25 Thread Yijing Wang
Use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. Signed-off-by: Yijing Wang CC: Tanmay Inamdar --- drivers/pci/host/pci-xgene.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci

[PATCH v3 25/30] PCI/designware: Use pci_scan_root_bus() for simplicity

2015-02-25 Thread Yijing Wang
Use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. Signed-off-by: Yijing Wang CC: Mohit Kumar CC: Jingoo Han --- drivers/pci/host/pcie-designware.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host/pcie

[PATCH v3 01/30] PCI: Rip out pci_bus_add_devices() from pci_scan_bus()

2015-02-25 Thread Yijing Wang
used like: pci_scan_bus() (mandatory) pci_fixup_irqs() (optional) pci_bus_size_bridges() (optional) pci_pci_bus_assign_resources() (optional) pci_bus_add_devices() (mandatory) Signed-off-by: Yijing Wang CC: "David S. Miller" CC: Geert Uytterhoeven CC: Guan Xuetao CC: Richard Henderson

[PATCH v3 06/30] PCI: Combine PCI domain and bus number in u32 arg

2015-02-25 Thread Yijing Wang
dge to save domain number. Finally, we could eliminate lots of the platform specific pci_domain_nr() in the last of the series. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 16 +--- include/linux/pci.h |7 --- include/uapi/linux/pci.h |3 +++ 3 files chan

[PATCH v3 08/30] PCI: Introduce pci_host_assign_domain_nr() to assign domain

2015-02-25 Thread Yijing Wang
Introduce pci_host_assign_domain_nr() to assign domain number for pci_host_bridge. Later we will remove pci_bus_assign_domain_nr(). Signed-off-by: Yijing Wang --- drivers/pci/pci.c | 14 +++--- include/linux/pci.h |4 2 files changed, 15 insertions(+), 3 deletions(-) diff

[PATCH v3 05/30] PCI: Rename pci_scan_bus() to pci_scan_bus_legacy()

2015-02-25 Thread Yijing Wang
Pci_scan_bus() is called by legacy pci host drivers, the legacy host drivers mean they use NULL as parent device, use all IO/MEM as default resources. Rename pci_scan_bus() to pci_scan_bus_legacy() for better readability. Signed-off-by: Yijing Wang --- arch/alpha/kernel/sys_nautilus.c |2

[PATCH v3 00/30] Refine PCI scan interfaces and make generic pci host bridge

2015-02-25 Thread Yijing Wang
ries on x86 (with or without ACPI). Comments and tests are warmly welcome! Arnd Bergmann (1): xen/PCI: Don't use deprecated function pci_scan_bus_parented() Yijing Wang (29): PCI: Rip out pci_bus_add_devices() from pci_scan_bus() PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus

[PATCH v3 04/30] PCI: Remove deprecated pci_scan_bus_parented()

2015-02-25 Thread Yijing Wang
No one uses pci_scan_bus_parented() any more, remove it. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 19 --- include/linux/pci.h |2 -- 2 files changed, 0 insertions(+), 21 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 8ef0375..699a238

[PATCH v3 11/30] PCI: Save sysdata in pci_host_bridge drvdata

2015-02-25 Thread Yijing Wang
Save platform specific sysdata in pci_host_bridge drvdata, host bridge specific operation need to access it before the pci bus creation. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |4 +++- drivers/pci/probe.c | 18 -- include/linux/pci.h |3

[PATCH v3 23/30] PCI/mvebu: Use pci_common_init_dev() to simplify code

2015-02-25 Thread Yijing Wang
Mvebu_pcie_scan_bus() is not necessary, we could use pci_common_init_dev() instead of pci_common_init(), and pass the device pointer as the parent. Then pci_scan_root_bus() will be called to scan the pci busses. Signed-off-by: Yijing Wang CC: Thomas Petazzoni CC: Jason Cooper --- drivers/pci

[PATCH v3 03/30] xen/PCI: Don't use deprecated function pci_scan_bus_parented()

2015-02-25 Thread Yijing Wang
From: Arnd Bergmann Use pci_scan_root_bus() instead of deprecated function pci_scan_bus_parented(). Signed-off-by: Arnd Bergmann Signed-off-by: Yijing Wang CC: Konrad Rzeszutek Wilk CC: xen-de...@lists.xenproject.org --- drivers/pci/xen-pcifront.c | 10 +++--- 1 files changed, 7

[PATCH v3 12/30] PCI: Introduce pci_host_bridge_ops to support host specific operations

2015-02-25 Thread Yijing Wang
*/ int (*phb_prepare)(struct pci_host_bridge *host); /* platform specific of scan hook to scan pci device */ void (*phb_of_scan_bus)(struct pci_host_bridge *); } We could easily extend it to support different host bridge specific operations. Signed-off-by: Yijing Wang

[PATCH v3 13/30] PCI: Introduce new scan function pci_scan_root_bridge()

2015-02-25 Thread Yijing Wang
Introduce new scan function pci_scan_root_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 21 + include/linux/pci.h |3 +++ 2 files changed, 24 insertions(+), 0

[PATCH v3 24/30] PCI/tegra: Remove redundant tegra_pcie_scan_bus()

2015-02-25 Thread Yijing Wang
Now pci_scan_root_bus() is almost simliar to pci_create_root_bus() + pci_scan_child_bus(). So we could use common pci_scan_root_bus() in pci_common_init_dev() to scan pci busses. tegra_pcie_scan_bus() is redundant, remove it. Signed-off-by: Yijing Wang CC: Thierry Reding CC: linux-te

[PATCH v3 14/30] PCI/x86: Refine pci_acpi_scan_root() with generic pci_host_bridge

2015-02-25 Thread Yijing Wang
Signed-off-by: Yijing Wang CC: Thomas Gleixner CC: x...@kernel.org --- arch/x86/pci/acpi.c | 36 1 files changed, 20 insertions(+), 16 deletions(-) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 5bfe983..3feb12c 100644 --- a/arch/x86/pci

[PATCH v3 16/30] PCI/IA64: Fix the build warning about pci_domain_nr()

2015-02-25 Thread Yijing Wang
Should pass pci_bus * instead of pci_dev * to pci_domain_nr(). Signed-off-by: Yijing Wang CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org --- arch/ia64/sn/kernel/io_acpi_init.c |6 +++--- arch/ia64/sn/kernel/io_init.c |2 +- 2 files changed, 4 insertions(+), 4

[PATCH v3 20/30] PCI/sparc: Use pci_scan_root_bridge() for simplicity

2015-02-25 Thread Yijing Wang
Now we could use pci_scan_root_bridge() to scan pci buses, provide sparc specific pci_host_bridge_ops. Signed-off-by: Yijing Wang CC: "David S. Miller" CC: sparcli...@vger.kernel.org --- arch/sparc/kernel/pci.c | 32 ++-- 1 files changed, 22 inserti

[PATCH v3 19/30] PCI: Remove weak pcibios_root_bridge_prepare()

2015-02-25 Thread Yijing Wang
Now no one use weak pcibios_root_bridge_prepare(), we could remove it. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 15 --- include/linux/pci.h |2 -- 2 files changed, 0 insertions(+), 17 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index

[PATCH v3 15/30] PCI/IA64: Refine pci_acpi_scan_root() with generic pci_host_bridge

2015-02-25 Thread Yijing Wang
From: Yijing Wang Signed-off-by: Yijing Wang CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org --- arch/ia64/pci/pci.c | 34 ++ 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index e4cda61

[PATCH v3 21/30] PCI: Introduce pci_bus_child_max_busnr()

2015-02-25 Thread Yijing Wang
Sometimes, we need to know the highest reserved busnr for children bus. Because parent's bus->busn_res could have padding in it. This function return the max child busnr as pci_scan_child_bus(). Signed-off-by: Yijing Wang --- drivers/pci/hotplug/acpiphp_glue.

[PATCH v3 17/30] PCI/powerpc: Rename pcibios_root_bridge_prepare()

2015-02-25 Thread Yijing Wang
Pcibios_root_bridge_prepare() in powerpc is used to set root bus speed. Rename it to pcibios_set_root_bus_speed() for better readability. Signed-off-by: Yijing Wang CC: Benjamin Herrenschmidt CC: linuxppc-...@lists.ozlabs.org --- arch/powerpc/include/asm/machdep.h |2 +- arch/powerpc

[PATCH v4 18/30] PCI/powerpc: Use pci_scan_root_bridge() for simplicity

2015-02-26 Thread Yijing Wang
Now we could use pci_scan_root_bridge() to scan pci buses, provide powerpc specific pci_host_bridge_ops. Suggested-by: Arnd Bergmann Signed-off-by: Yijing Wang CC: Benjamin Herrenschmidt CC: linuxppc-...@lists.ozlabs.org --- arch/powerpc/include/asm/machdep.h |2 +- arch/powerpc

[PATCH v4 04/30] PCI: Remove deprecated pci_scan_bus_parented()

2015-02-26 Thread Yijing Wang
No one uses pci_scan_bus_parented() any more, remove it. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 19 --- include/linux/pci.h |2 -- 2 files changed, 0 insertions(+), 21 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 8ef0375..699a238

[PATCH v4 10/30] PCI: Introduce pci_host_bridge_list to manage host bridges

2015-02-26 Thread Yijing Wang
Introduce pci_host_bridge_list to manage pci host bridges in system, so we could detect whether the host in domain:bus is alreay registered. Then we could remove bus alreay exist test in __pci_create_root_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c | 24

[PATCH v4 16/30] PCI/IA64: Fix the build warning about pci_domain_nr()

2015-02-26 Thread Yijing Wang
Should pass pci_bus * instead of pci_dev * to pci_domain_nr(). Signed-off-by: Yijing Wang CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org --- arch/ia64/sn/kernel/io_acpi_init.c |6 +++--- arch/ia64/sn/kernel/io_init.c |2 +- 2 files changed, 4 insertions(+), 4

[PATCH v4 24/30] PCI/tegra: Remove redundant tegra_pcie_scan_bus()

2015-02-26 Thread Yijing Wang
Now pci_scan_root_bus() is almost simliar to pci_create_root_bus() + pci_scan_child_bus(). So we could use common pci_scan_root_bus() in pci_common_init_dev() to scan pci busses. tegra_pcie_scan_bus() is redundant, remove it. Signed-off-by: Yijing Wang CC: Thierry Reding CC: linux-te

[PATCH v4 27/30] PCI: Rename __pci_create_root_bus() to pci_create_root_bus()

2015-02-26 Thread Yijing Wang
Now no one use pci_create_root_bus(), we could remove it and rename __pci_create_root_bus() to pci_create_root_bus(). Signed-off-by: wangyij...@huawei.com --- drivers/pci/probe.c | 27 --- include/linux/pci.h |3 --- 2 files changed, 8 insertions(+), 22 deletions(-)

[PATCH v4 23/30] PCI/mvebu: Use pci_common_init_dev() to simplify code

2015-02-26 Thread Yijing Wang
Mvebu_pcie_scan_bus() is not necessary, we could use pci_common_init_dev() instead of pci_common_init(), and pass the device pointer as the parent. Then pci_scan_root_bus() will be called to scan the pci busses. Signed-off-by: Yijing Wang CC: Thomas Petazzoni CC: Jason Cooper --- drivers/pci

[PATCH v4 22/30] PCI/Parisc: Use pci_scan_root_bus() for simplicity

2015-02-26 Thread Yijing Wang
From: Yijing Wang Now pci_bus_add_devices() has been ripped out from pci_scan_root_bus(), we could use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. We could also remove the pci bus resource(dino_current_bus,255) and pci_bus_update_busn_res_end

[PATCH v4 21/30] PCI: Introduce pci_bus_child_max_busnr()

2015-02-26 Thread Yijing Wang
Sometimes, we need to know the highest reserved busnr for children bus. Because parent's bus->busn_res could have padding in it. This function return the max child busnr as pci_scan_child_bus(). Signed-off-by: Yijing Wang --- drivers/pci/hotplug/acpiphp_glue.

[PATCH v4 07/30] PCI: Pass PCI domain number combined with root bus number

2015-02-26 Thread Yijing Wang
arm/arm64 to assign domain number in later patch. Signed-off-by: Yijing Wang CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner CC: Tony Luck CC: Fenghua Yu CC: Michal Simek CC: Ralf Baechle CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Sebastian Ott CC

[PATCH v4 20/30] PCI/sparc: Use pci_scan_root_bridge() for simplicity

2015-02-26 Thread Yijing Wang
Now we could use pci_scan_root_bridge() to scan pci buses, provide sparc specific pci_host_bridge_ops. Signed-off-by: Yijing Wang CC: "David S. Miller" CC: sparcli...@vger.kernel.org --- arch/sparc/kernel/pci.c | 32 ++-- 1 files changed, 22 inserti

[PATCH v4 25/30] PCI/designware: Use pci_scan_root_bus() for simplicity

2015-02-26 Thread Yijing Wang
Use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. Signed-off-by: Yijing Wang CC: Mohit Kumar CC: Jingoo Han --- drivers/pci/host/pcie-designware.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host/pcie

[PATCH v4 28/30] PCI: Export find_pci_host_bridge()

2015-02-26 Thread Yijing Wang
Export find_pci_host_bridge(). Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |2 +- include/linux/pci.h |1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index 4a2baa2..51e24f8 100644 --- a/drivers

[PATCH v4 29/30] PCI: Remove platform specific pci_domain_nr()

2015-02-26 Thread Yijing Wang
Now pci_host_bridge holds the domain number, so we could eliminate all platform specific pci_domain_nr(). Signed-off-by: Yijing Wang --- arch/alpha/include/asm/pci.h |2 -- arch/ia64/include/asm/pci.h |1 - arch/microblaze/pci/pci-common.c | 11 --- arch/mips/include

[PATCH v4 30/30] PCI: Remove pci_bus_assign_domain_nr()

2015-02-26 Thread Yijing Wang
Now we save the domain number in pci_host_bridge, we could remove pci_bus_assign_domain_nr() and clean the domain member in pci_bus. Signed-off-by: Yijing Wang --- drivers/pci/pci.c |5 - drivers/pci/probe.c | 12 include/linux/pci.h |3 --- 3 files changed, 4

[PATCH v4 02/30] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus()

2015-02-26 Thread Yijing Wang
. For arm hw_pci->scan() functions which call pci_scan_root_bus(), it's no need to change anything, because pci_bus_add_devices() will be called later in pci_common_init_dev(). Signed-off-by: Yijing Wang CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner CC: David Howells CC: T

[PATCH v4 26/30] PCI/xgene: Use pci_scan_root_bus() instead of pci_create_root_bus()

2015-02-26 Thread Yijing Wang
Use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. Signed-off-by: Yijing Wang CC: Tanmay Inamdar --- drivers/pci/host/pci-xgene.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci

[PATCH v4 15/30] PCI/IA64: Refine pci_acpi_scan_root() with generic pci_host_bridge

2015-02-26 Thread Yijing Wang
From: Yijing Wang Signed-off-by: Yijing Wang CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org --- arch/ia64/pci/pci.c | 34 ++ 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index e4cda61

[PATCH v4 19/30] PCI: Remove weak pcibios_root_bridge_prepare()

2015-02-26 Thread Yijing Wang
Now no one use weak pcibios_root_bridge_prepare(), we could remove it. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 15 --- include/linux/pci.h |2 -- 2 files changed, 0 insertions(+), 17 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index

[PATCH v4 12/30] PCI: Introduce pci_host_bridge_ops to support host specific operations

2015-02-26 Thread Yijing Wang
*/ int (*phb_prepare)(struct pci_host_bridge *host); /* platform specific of scan hook to scan pci device */ void (*phb_of_scan_bus)(struct pci_host_bridge *); } We could easily extend it to support different host bridge specific operations. Signed-off-by: Yijing Wang

[PATCH v4 17/30] PCI/powerpc: Rename pcibios_root_bridge_prepare()

2015-02-26 Thread Yijing Wang
Pcibios_root_bridge_prepare() in powerpc is used to set root bus speed. Rename it to pcibios_set_root_bus_speed() for better readability. Signed-off-by: Yijing Wang CC: Benjamin Herrenschmidt CC: linuxppc-...@lists.ozlabs.org --- arch/powerpc/include/asm/machdep.h |2 +- arch/powerpc

[PATCH v4 14/30] PCI/x86: Refine pci_acpi_scan_root() with generic pci_host_bridge

2015-02-26 Thread Yijing Wang
Signed-off-by: Yijing Wang CC: Thomas Gleixner CC: x...@kernel.org --- arch/x86/pci/acpi.c | 36 1 files changed, 20 insertions(+), 16 deletions(-) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 5bfe983..3feb12c 100644 --- a/arch/x86/pci

[PATCH v4 05/30] PCI: Rename pci_scan_bus() to pci_scan_bus_legacy()

2015-02-26 Thread Yijing Wang
Pci_scan_bus() is called by legacy pci host drivers, the legacy host drivers mean they use NULL as parent device, use all IO/MEM as default resources. Rename pci_scan_bus() to pci_scan_bus_legacy() for better readability. Signed-off-by: Yijing Wang --- arch/alpha/kernel/sys_nautilus.c |2

[PATCH v4 01/30] PCI: Rip out pci_bus_add_devices() from pci_scan_bus()

2015-02-26 Thread Yijing Wang
used like: pci_scan_bus() (mandatory) pci_fixup_irqs() (optional) pci_bus_size_bridges() (optional) pci_pci_bus_assign_resources() (optional) pci_bus_add_devices() (mandatory) Signed-off-by: Yijing Wang CC: "David S. Miller" CC: Geert Uytterhoeven CC: Guan Xuetao CC: Richard Henderson

[PATCH v4 11/30] PCI: Save sysdata in pci_host_bridge drvdata

2015-02-26 Thread Yijing Wang
Save platform specific sysdata in pci_host_bridge drvdata, host bridge specific operation need to access it before the pci bus creation. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |4 +++- drivers/pci/probe.c | 18 -- include/linux/pci.h |3

[PATCH v4 13/30] PCI: Introduce new scan function pci_scan_root_bridge()

2015-02-26 Thread Yijing Wang
Introduce new scan function pci_scan_root_bridge() to support host bridge drivers that need to provide platform own pci_host_bridge_ops. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 21 + include/linux/pci.h |3 +++ 2 files changed, 24 insertions(+), 0

Re: [PATCH v3 00/30] Refine PCI scan interfaces and make generic pci host bridge

2015-02-26 Thread Yijing Wang
On 2015/2/26 13:51, Bjorn Helgaas wrote: > On Thu, Feb 26, 2015 at 09:29:17AM +0800, Yijing Wang wrote: >> v2->v3: >> Rebase this series on v4.0-rc1. > > Hm, still doesn't apply for me: Hi Bjorn, I redo the series, I guess the errors were introduced by calling

[PATCH v4 03/30] xen/PCI: Don't use deprecated function pci_scan_bus_parented()

2015-02-26 Thread Yijing Wang
From: Arnd Bergmann Use pci_scan_root_bus() instead of deprecated function pci_scan_bus_parented(). Signed-off-by: Arnd Bergmann Signed-off-by: Yijing Wang CC: Konrad Rzeszutek Wilk CC: xen-de...@lists.xenproject.org --- drivers/pci/xen-pcifront.c | 10 +++--- 1 files changed, 7

[PATCH v4 00/30] Refine PCI scan interfaces and make generic pci host bridge

2015-02-26 Thread Yijing Wang
() for callers provide its own parent and io/mem/bus resources Arnd Bergmann (1): xen/PCI: Don't use deprecated function pci_scan_bus_parented() Yijing Wang (29): PCI: Rip out pci_bus_add_devices() from pci_scan_bus() PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus() PCI

[PATCH v4 09/30] PCI: Separate pci_host_bridge creation out of pci_create_root_bus()

2015-02-26 Thread Yijing Wang
, we could use the generic pci_host_bridge to hold host bridge specific operations like pcibios_root_bridge_prepare(). The changes are transparent to platform host bridge drivers. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c | 56 ++ drivers/pci/probe.c

[PATCH v4 08/30] PCI: Introduce pci_host_assign_domain_nr() to assign domain

2015-02-26 Thread Yijing Wang
Introduce pci_host_assign_domain_nr() to assign domain number for pci_host_bridge. Later we will remove pci_bus_assign_domain_nr(). Signed-off-by: Yijing Wang --- drivers/pci/pci.c | 14 +++--- include/linux/pci.h |4 2 files changed, 15 insertions(+), 3 deletions(-) diff

[PATCH v4 06/30] PCI: Combine PCI domain and bus number in u32 arg

2015-02-26 Thread Yijing Wang
dge to save domain number. Finally, we could eliminate lots of the platform specific pci_domain_nr() in the last of the series. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 16 +--- include/linux/pci.h |7 --- include/uapi/linux/pci.h |3 +++ 3 files chan

[PATCH v6 01/30] PCI: Rip out pci_bus_add_devices() from pci_scan_bus()

2015-03-08 Thread Yijing Wang
used like: pci_scan_bus() (mandatory) pci_fixup_irqs() (optional) pci_bus_size_bridges() (optional) pci_pci_bus_assign_resources() (optional) pci_bus_add_devices() (mandatory) Signed-off-by: Yijing Wang CC: "David S. Miller" CC: Geert Uytterhoeven CC: Guan Xuetao CC: Richard Henderson

[PATCH v6 16/30] powerpc/pci: Rename pcibios_root_bridge_prepare()

2015-03-08 Thread Yijing Wang
Pcibios_root_bridge_prepare() in powerpc is used to set root bus speed. Rename it to pcibios_set_root_bus_speed() for better readability. Signed-off-by: Yijing Wang CC: Benjamin Herrenschmidt CC: linuxppc-...@lists.ozlabs.org Signed-off-by: Bjorn Helgaas --- arch/powerpc/include/asm/machdep.h

[PATCH v6 30/30] PCI: Remove pci_bus_assign_domain_nr()

2015-03-08 Thread Yijing Wang
Now we save the domain number in pci_host_bridge, we could remove pci_bus_assign_domain_nr() and clean the domain member in pci_bus. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/pci.c |5 - drivers/pci/probe.c | 12 include/linux/pci.h |3

[PATCH v6 20/30] sparc/PCI: Use pci_scan_host_bridge() for simplicity

2015-03-08 Thread Yijing Wang
Now we could use pci_scan_host_bridge() to scan pci buses, provide sparc specific pci_host_bridge_ops. Signed-off-by: Yijing Wang CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Bjorn Helgaas --- arch/sparc/kernel/pci.c | 32 ++-

[PATCH v6 19/30] sparc/PCI: Claim bus resources before pci_bus_add_devices()

2015-03-08 Thread Yijing Wang
Pci_claim_bus_resources() should be called before pci_bus_add_devices(), or driver may failed to load, because the resources had not claimed. Signed-off-by: Yijing Wang --- arch/sparc/kernel/pci.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/pci.c

[PATCH v6 06/30] PCI: Combine PCI domain and bus number in u32 arg

2015-03-08 Thread Yijing Wang
dge to save domain number. Finally, we could eliminate lots of the platform specific pci_domain_nr() in the last of the series. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 16 +--- include/linux/pci.h |7 --- include/uapi/li

[PATCH v6 07/30] PCI: Pass PCI domain number combined with root bus number

2015-03-08 Thread Yijing Wang
arm/arm64 to assign domain number in later patch. Signed-off-by: Yijing Wang CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner CC: Tony Luck CC: Fenghua Yu CC: Michal Simek CC: Ralf Baechle CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Sebastian Ott CC

[PATCH v6 27/30] PCI: Rename __pci_create_root_bus() to pci_create_root_bus()

2015-03-08 Thread Yijing Wang
Now no one use pci_create_root_bus(), we could remove it and rename __pci_create_root_bus() to pci_create_root_bus(). Signed-off-by: wangyij...@huawei.com Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 27 --- include/linux/pci.h |3 --- 2 files changed, 8 i

[PATCH v6 26/30] PCI/xgene: Use pci_scan_root_bus() instead of pci_create_root_bus()

2015-03-08 Thread Yijing Wang
Use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. Signed-off-by: Yijing Wang CC: Tanmay Inamdar Signed-off-by: Bjorn Helgaas --- drivers/pci/host/pci-xgene.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci

[PATCH v6 02/30] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus()

2015-03-08 Thread Yijing Wang
. For arm hw_pci->scan() functions which call pci_scan_root_bus(), it's no need to change anything, because pci_bus_add_devices() will be called later in pci_common_init_dev(). Signed-off-by: Yijing Wang CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner CC: David Howells CC: T

[PATCH v6 15/30] ia64/PCI: Refine pci_acpi_scan_root() with generic pci_host_bridge

2015-03-08 Thread Yijing Wang
From: Yijing Wang Signed-off-by: Yijing Wang CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org Signed-off-by: Bjorn Helgaas --- arch/ia64/pci/pci.c | 34 ++ 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/arch/ia64/pci/pci.c b

[PATCH v6 12/30] PCI: Introduce pci_host_bridge_ops to support host specific operations

2015-03-08 Thread Yijing Wang
*/ int (*prepare)(struct pci_host_bridge *host); /* platform specific of scan hook to scan pci device */ void (*scan_bus)(struct pci_host_bridge *); } We could easily extend it to support different host bridge specific operations. Signed-off-by: Yijing Wang Signed-off-by

[PATCH v6 08/30] PCI: Introduce pci_host_assign_domain_nr() to assign domain

2015-03-08 Thread Yijing Wang
Introduce pci_host_assign_domain_nr() to assign domain number for pci_host_bridge. Later we will remove pci_bus_assign_domain_nr(). Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/pci.c | 20 +++- include/linux/pci.h |4 2 files changed, 19

[PATCH v6 05/30] PCI: Remove deprecated pci_scan_bus_parented()

2015-03-08 Thread Yijing Wang
No one uses pci_scan_bus_parented() any more, remove it. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 19 --- include/linux/pci.h |2 -- 2 files changed, 0 insertions(+), 21 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci

[PATCH v6 29/30] PCI: Remove platform specific pci_domain_nr()

2015-03-08 Thread Yijing Wang
Now pci_host_bridge holds the domain number, so we could eliminate all platform specific pci_domain_nr(). Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- arch/alpha/include/asm/pci.h |2 -- arch/ia64/include/asm/pci.h |1 - arch/microblaze/pci/pci-common.c | 11

[PATCH v6 28/30] PCI: Export find_pci_host_bridge() and rename to pci_find_host_bridge()

2015-03-08 Thread Yijing Wang
Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/host-bridge.c |6 +++--- drivers/pci/pci.h |2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index bc1de59..51f0a82 100644 --- a

[PATCH v6 21/30] PCI: Introduce pci_bus_child_max_busnr()

2015-03-08 Thread Yijing Wang
Sometimes, we need to know the highest reserved busnr for children bus. Because parent's bus->busn_res could have padding in it. This function return the max child busnr as pci_scan_child_bus(). Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas Signed-off-by: Fengguang Wu ---

[PATCH v6 11/30] PCI: Save sysdata in pci_host_bridge drvdata

2015-03-08 Thread Yijing Wang
Save platform specific sysdata in pci_host_bridge drvdata, host bridge specific operation need to access it before the pci bus creation. Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas --- drivers/pci/host-bridge.c |4 +++- drivers/pci/pci.h |4 +++- drivers/pci/probe.c

Re: [PATCH v5 16/29] powerpc/pci: Use pci_scan_host_bridge() for simplicity

2015-03-08 Thread Yijing Wang
On 2015/3/6 22:19, Rob Herring wrote: > On Fri, Mar 6, 2015 at 3:33 AM, Yijing Wang wrote: >> Now we could use pci_scan_host_bridge() to scan >> pci buses, provide powerpc specific pci_host_bridge_ops. >> >> Suggested-by: Arnd Bergmann >> Signed-off-by: Yijing Wa

[PATCH v6 22/30] parisc/PCI: Use pci_scan_root_bus() for simplicity

2015-03-08 Thread Yijing Wang
From: Yijing Wang Now pci_bus_add_devices() has been ripped out from pci_scan_root_bus(), we could use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. Signed-off-by: Yijing Wang CC: "James E.J. Bottomley" CC: linux-par...@vger.kernel.org

[PATCH v6 17/30] powerpc/pci: Use pci_scan_host_bridge() for simplicity

2015-03-08 Thread Yijing Wang
Now we could use pci_scan_host_bridge() to scan pci buses, provide powerpc specific pci_host_bridge_ops. Suggested-by: Arnd Bergmann Signed-off-by: Yijing Wang CC: Benjamin Herrenschmidt CC: linuxppc-...@lists.ozlabs.org Signed-off-by: Bjorn Helgaas --- arch/powerpc/include/asm/machdep.h

[PATCH v6 24/30] PCI/tegra: Remove redundant tegra_pcie_scan_bus()

2015-03-08 Thread Yijing Wang
Now pci_scan_root_bus() is almost similar to pci_create_root_bus() + pci_scan_child_bus(). So we could use common pci_scan_root_bus() in pci_common_init_dev() to scan pci busses. tegra_pcie_scan_bus() is redundant, remove it. Signed-off-by: Yijing Wang CC: Thierry Reding CC: linux-te

[PATCH v6 25/30] PCI/designware: Use pci_scan_root_bus() for simplicity

2015-03-08 Thread Yijing Wang
Use pci_scan_root_bus() instead of pci_create_root_bus() + pci_scan_child_bus() for simplicity. Signed-off-by: Yijing Wang CC: Mohit Kumar CC: Jingoo Han Signed-off-by: Bjorn Helgaas --- drivers/pci/host/pcie-designware.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff

<    3   4   5   6   7   8   9   10   11   >