[PATCH v3 03/27] s390/MSI: Use __msi_mask_irq() instead of default_msi_mask_irq()

2014-10-14 Thread Yijing Wang
Now only s390/MSI use default_msi_mask_irq() and default_msix_mask_irq(), replace them with the common msi mask irq functions __msi_mask_irq() and __msix_mask_irq(). Remove default_msi_mask_irq() and default_msix_mask_irq(). Signed-off-by: Yijing Wang --- arch/s390/pci/pci.c |4

[PATCH v3 16/27] Mips/MSI: Save msi chip in pci sysdata

2014-10-14 Thread Yijing Wang
Save msi chip in pci sysdata, add arch pci_find_msi_chip() to extract out msi chip. Signed-off-by: Yijing Wang --- arch/mips/include/asm/pci.h | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index

[PATCH v3 10/27] PCI/MSI: Remove useless bus->msi assignment

2014-10-14 Thread Yijing Wang
Now msi chip is saved in pci_sys_data in arm, we could clean the bus->msi assignment in pci core. Signed-off-by: Yijing Wang CC: Thierry Reding CC: Thomas Petazzoni --- drivers/pci/probe.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/pci/probe.c b/driv

[PATCH v3 11/27] PCI/MSI: Refactor struct msi_chip to make it become more common

2014-10-14 Thread Yijing Wang
.restore_irqs(), .teardown_irqs() and .setup_irqs() to make it become more common. Signed-off-by: Yijing Wang Reviewed-by: Lucas Stach --- drivers/pci/msi.c | 15 +++ include/linux/msi.h |4 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/pci/msi.c b

[PATCH v3 13/27] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-10-14 Thread Yijing Wang
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 Acked-by: David Vrabel CC: Konrad Rzeszutek Wilk --- arch/x86/pci/xen.c | 58

[PATCH v3 02/27] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()

2014-10-14 Thread Yijing Wang
be removed in the later patch. Signed-off-by: Yijing Wang CC: David Vrabel CC: Konrad Rzeszutek Wilk --- Hi David and Konrad, I dropped the Acked-by and tested-by, because this version has a lot changes compared to last. So, I guess you may want to check it again. --- arch/x86/include/asm/

[PATCH v3 12/27] x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-10-14 Thread Yijing Wang
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 --- arch/x86/include/asm/pci.h | 13 + arch/x86/kernel/apic/io_apic.c | 19 +++ arch/x86/pci

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

2014-10-14 Thread Yijing Wang
es to be initialized in pci host bridge driver. Currently, pci hostbridge drivers create pci_host_bridge in pci_create_root_bus(), and pass arch specific pci sysdata to core pci scan functions. So pci arch sysdata is good place to save msi chip. Signed-off-by: Yijing Wang --- arch/arm/include/asm

[PATCH v3 00/27] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-10-14 Thread Yijing Wang
h 4/21] x86/xen/MSI: Eliminate...", export msi_chip instead of #ifdef to fix MSI bug in xen running in x86. Rename arch_get_match_msi_chip() to arch_find_msi_chip(). Drop use struct device as the msi_chip argument, we will do that later in another patchset. Yijing Wang (27): MSI

Re: [PATCH v3 16/27] Mips/MSI: Save msi chip in pci sysdata

2014-10-26 Thread Yijing Wang
On 2014/10/25 21:04, Ralf Baechle wrote: > On Wed, Oct 15, 2014 at 11:07:04AM +0800, Yijing Wang wrote: > >> +static inline struct msi_chip *pci_msi_chip(struct pci_bus *bus) >> +{ >> +struct pci_controller *control = (struct pci_controller *)bus->sysdata; > &g

[PATCH 01/10] MSI: Rename msi_chip to msi_controller for better readability

2014-10-27 Thread Yijing Wang
r in dts file. Should no functional change. Suggested-by: Bjorn Helgaas Signed-off-by: Yijing Wang --- drivers/irqchip/irq-armada-370-xp.c | 22 +- drivers/of/of_pci.c | 40 +- drivers/pci/host/pci-keystone-dw.c |4 +- drivers

[PATCH 00/10] Save MSI chip in pci_sys_data

2014-10-27 Thread Yijing Wang
. So I keep #ifdef CONFIG_PCI_MSI in this series. Yijing Wang (10): MSI: Rename msi_chip to msi_controller for better readability PCI/MSI: Introduce weak pcibios_msi_controller() arm/MSI: Save MSI controller in pci_sys_data PCI: tegra: Save MSI controller in pci_sys_data PCI: designware

[PATCH 10/10] PCI/MSI: Remove useless bus->msi assignment

2014-10-27 Thread Yijing Wang
But in fact, drivers which used MSI chip always associate MSI chip and PCI bus by add .add_bus() in arm PCI host bridge drivers. Now we have saved MSI chip in pci_sys_data. We can remove this bus->msi assignment safely. Signed-off-by: Yijing Wang CC: Thierry Reding CC: Thomas Petazzoni --- dr

[PATCH 09/10] arm/PCI: Clean unused pcibios_add_bus() and pcibios_remove_bus()

2014-10-27 Thread Yijing Wang
MSI controller has been saved in pci_sys_data, now we can clean up pcibios_add_bus() and pcibios_remove_bus() in arm, and use pcibios_msi_controller() to get MSI controller pointer. Signed-off-by: Yijing Wang --- arch/arm/include/asm/mach/pci.h |4 arch/arm/kernel/bios32.c

[PATCH 04/10] PCI: tegra: Save MSI controller in pci_sys_data

2014-10-27 Thread Yijing Wang
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every pci bus in .add_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host/pci-tegra.c | 13 +++-- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/pci/host/pci-tegra.c b

[PATCH 06/10] PCI: rcar: Save MSI controller in pci_sys_data

2014-10-27 Thread Yijing Wang
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every pci bus in .add_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host/pcie-rcar.c | 13 +++-- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/pci/host/pcie-rcar.c b

[PATCH 07/10] PCI: mvebu: Save MSI controller in pci_sys_data

2014-10-27 Thread Yijing Wang
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every pci bus in .add_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host/pci-mvebu.c | 10 +++--- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/pci/host/pci-mvebu.c b/drivers

[PATCH 05/10] PCI: designware: Save MSI controller in pci_sys_data

2014-10-27 Thread Yijing Wang
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every pci bus in .add_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host/pcie-designware.c | 15 --- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/pci/host/pcie

[PATCH 08/10] PCI: xilinx: Save MSI controller in pci_sys_data

2014-10-27 Thread Yijing Wang
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every pci bus in .add_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host/pcie-xilinx.c | 19 --- 1 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/pci/host/pcie

[PATCH 03/10] arm/MSI: Save MSI controller in pci_sys_data

2014-10-27 Thread Yijing Wang
in another series. Signed-off-by: Yijing Wang --- arch/arm/include/asm/mach/pci.h |6 ++ arch/arm/kernel/bios32.c| 12 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index 7fc4278..8144

[PATCH 02/10] PCI/MSI: Introduce weak pcibios_msi_controller()

2014-10-27 Thread Yijing Wang
Introduce a new weak pcibios_msi_controller() to get the associate msi_chip for PCI bus. This is preparation for save msi_chip in arch PCI sysdata. This weak function will be removed after we save msi_chip in generic pci_host_bridge. Suggested-by: Bjorn Helgaas Signed-off-by: Yijing Wang

[PATCH 01/16] PCI/MSI: Refactor MSI controller to make it become more common

2014-10-27 Thread Yijing Wang
common. Signed-off-by: Yijing Wang Reviewed-by: Lucas Stach --- drivers/pci/msi.c | 15 +++ include/linux/msi.h |8 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 27b6a54..0e1da3e 100644 --- a/drivers/pci

[PATCH 13/16] IA64/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- arch/ia64/include/asm/pci.h |3 ++- arch/ia64/kernel/msi_ia64.c | 24 ++-- arch/ia64/pci/pci.c

[PATCH 12/16] arm/iop13xx/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- arch/arm/mach-iop13xx/include/mach/pci.h |4 arch/arm/mach-iop13xx/iq81340mc.c|3 +++ arch/arm/mach

[PATCH 09/16] MIPS/Xlr/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- arch/mips/pci/pci-xlr.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH 05/16] x86/MSI: Remove unused MSI weak arch functions

2014-10-27 Thread Yijing Wang
Now we can clean up MSI weak arch functions in x86. Signed-off-by: Yijing Wang --- arch/x86/include/asm/pci.h |5 + arch/x86/include/asm/x86_init.h |4 arch/x86/kernel/apic/io_apic.c | 21 + arch/x86/kernel/x86_init.c | 24

[PATCH 03/16] x86/xen/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 CC: David Vrabel CC: Konrad Rzeszutek Wilk --- arch/x86/pci/xen.c | 45 +++-- 1

[PATCH 00/16] Use MSI controller framework to configure MSI/MSI-X

2014-10-27 Thread Yijing Wang
quot;s390/MSI: Use MSI..". Fix several typo problems found by Lucas. RFC->v1: Updated "[patch 4/21] x86/xen/MSI: Eliminate...", export msi_chip instead of #ifdef to fix MSI bug in xen running in x86. Rename arch_get_match_msi_chip() to arch_find_msi_chip(). Drop use struct devic

[PATCH 16/16] PCI/MSI: Clean up unused MSI arch functions

2014-10-27 Thread Yijing Wang
Now we use MSI controller in all platforms to configure MSI/MSI-X. We can clean up the unused arch functions. Signed-off-by: Yijing Wang Reviewed-by: Lucas Stach --- drivers/pci/msi.c | 90 ++ include/linux/msi.h | 11 -- 2 files

[PATCH 02/16] x86/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- arch/x86/include/asm/pci.h |4 arch/x86/kernel/apic/io_apic.c | 25 + arch/x86/pci

[PATCH 06/16] Mips/MSI: Save MSI controller in pci sysdata

2014-10-27 Thread Yijing Wang
Save MSI controller in pci sysdata, add arch pcibios_msi_controller() to extract out MSI controller. Signed-off-by: Yijing Wang --- arch/mips/include/asm/pci.h |3 +++ arch/mips/pci/pci.c |9 + 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/mips

[PATCH 15/16] tile/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- arch/tile/include/asm/pci.h |2 ++ arch/tile/kernel/pci_gx.c | 18 -- 2 files changed, 18

[PATCH 14/16] Sparc/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 Acked-by: David S. Miller --- arch/sparc/kernel/pci.c | 20 ++-- arch/sparc/kernel/pci_impl.h |3

[PATCH 07/16] MIPS/Octeon/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- arch/mips/include/asm/octeon/pci-octeon.h |4 +++ arch/mips/pci/msi-octeon.c| 31

[PATCH 08/16] MIPS/Xlp/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- arch/mips/include/asm/netlogic/xlp-hal/pcibus.h |1 + arch/mips/pci/msi-xlp.c | 11

[PATCH 04/16] Irq_remapping/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 --- drivers/iommu/irq_remapping.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 10/16] Powerpc/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 Acked-by: Michael Ellerman --- arch/powerpc/include/asm/pci-bridge.h |8 arch/powerpc/kernel/msi.c

[PATCH 11/16] s390/MSI: Use MSI controller framework to configure MSI/MSI-X irq

2014-10-27 Thread Yijing Wang
Use MSI controller 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 Acked-by: Sebastian Ott --- arch/s390/include/asm/pci.h |1 + arch/s390/pci/pci.c | 19 +-- 2

Re: [PATCH] sysfs: driver core: Fix glue dir race condition

2014-11-06 Thread Yijing Wang
On 2014/11/7 0:55, Tejun Heo wrote: > Maybe "fix glue dir race condition by not removing them" is a better > title? Yes, it's better, thank you! > > On Thu, Nov 06, 2014 at 04:16:38PM +0800, Yijing Wang wrote: >> There is a race condition when removing glue dire

Re: [PATCH] sysfs: driver core: Fix glue dir race condition

2014-11-06 Thread Yijing Wang
On 2014/11/7 1:22, Greg KH wrote: > On Thu, Nov 06, 2014 at 11:55:47AM -0500, Tejun Heo wrote: >> Maybe "fix glue dir race condition by not removing them" is a better >> title? >> >> On Thu, Nov 06, 2014 at 04:16:38PM +0800, Yijing Wang wrote: >>>

Re: [PATCH] sysfs: driver core: Fix glue dir race condition

2014-11-06 Thread Yijing Wang
>> +static DEFINE_MUTEX(gdp_mutex); >> >> static struct kobject *get_device_parent(struct device *dev, >> struct device *parent) >> { >> if (dev->class) { >> -static DEFINE_MUTEX(gdp_mutex); >> struct kobject *kobj = NULL; >>

[PATCH] sysfs: driver core: Fix glue dir race condition by gdp_mutex

2014-11-06 Thread Yijing Wang
0 <4>[ 3965.686748] [] blk_trace_init_sysfs+0x14/0x20 <4>[ 3965.686753] [] blk_register_queue+0x3b/0x120 <4>[ 3965.686756] [] add_disk+0x1cc/0x490 --- Signed-off-by: Yijing Wang Signed-off-by: Weng Meiling Cc: #3.4+ --- dri

[PATCH part3 v12 06/10] PCI: Make pci_host_bridge hold sysdata in drvdata

2015-07-20 Thread Yijing Wang
Now platform specific sysdata is saved in pci_bus, and pcibios_root_bridge_prepare() need to know the sysdata. Later, we would move pcibios_root_bridge_prepare() prior to root bus creation, so we need to make pci_host_bridge hold sysdata. Signed-off-by: Yijing Wang --- arch/ia64/pci/pci.c

[PATCH part3 v12 10/10] IA64/PCI: Fix build warning found by kbuild test

2015-07-20 Thread Yijing Wang
ci_bus * have opaque sysdata, so IA64 specific pci_domain_nr() could get the pci_controller and return the exact domain number, but now we use common pci_domain_nr() functions, so we should fix this warning. Signed-off-by: Yijing Wang --- arch/ia64/sn/kernel/io_acpi_init.c |6 +++--- arch/i

[PATCH part3 v12 03/10] PCI: Remove declaration for pci_get_new_domain_nr()

2015-07-20 Thread Yijing Wang
pci_get_new_domain_nr() is only used in drivers/pci/pci.c, remove the declaration in include/linux/pci.h. Signed-off-by: Yijing Wang --- drivers/pci/pci.c |4 ++-- include/linux/pci.h |3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci.c b/drivers

[PATCH part3 v12 02/10] PCI: Move pci_bus_assign_domain_nr() declaration into drivers/pci/pci.h

2015-07-20 Thread Yijing Wang
pci_bus_assign_domain_nr() is only called in probe.c, Move pci_bus_assign_domain_nr() declaration into drivers/pci/pci.h. Signed-off-by: Yijing Wang --- drivers/pci/pci.h |9 + include/linux/pci.h |6 -- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a

[PATCH part3 v12 07/10] PCI: Create pci host bridge prior to root bus

2015-07-20 Thread Yijing Wang
Pci_host_bridge hold the domain number, we need to assign domain number prior to root bus creation, because root bus need to know the domain number to check whether it's alreay exist. Also it's preparation for separating pci_host_bridge creation from pci_create_root_bus(). Signed-off-

[PATCH part3 v12 09/10] PCI: Remove pci_bus_assign_domain_nr()

2015-07-20 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/pci.h |9 - drivers/pci/probe.c | 11 +++ include/linux/pci.h

[PATCH part3 v12 04/10] PCI: Introduce pci_host_assign_domain_nr() to assign domain

2015-07-20 Thread Yijing Wang
Introduce pci_host_assign_domain_nr() to assign domain number for pci_host_bridge. Signed-off-by: Yijing Wang --- drivers/pci/pci.c | 24 +++- drivers/pci/pci.h |1 + 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c

[PATCH part3 v12 08/10] PCI: Introduce common pci_domain_nr() and remove platform specific code

2015-07-20 Thread Yijing Wang
Now pci_host_bridge holds the domain number, we could introduce common pci_domain_nr(), and remove platform specific code. Signed-off-by: Yijing Wang --- arch/alpha/include/asm/pci.h |2 -- arch/ia64/include/asm/pci.h |1 - arch/microblaze/include/asm/pci.h |2 -- arch

[PATCH part3 v12 00/10] Cleanup platform pci_domain_nr()

2015-07-20 Thread Yijing Wang
wrap function pci_create_root_bus_generic() and pci_create_root_bus_generic() for arm/arm64 which enable CONFIG_PCI_DOMAINS_GENERIC. Rebased this series based 4.2-rc1 Yijing Wang (10): PCI: Save domain in pci_host_bridge PCI: Move pci_bus_assign_domain_nr() declaration into drivers/pci/pci.h

[PATCH part3 v12 05/10] powerpc/PCI: Rename pcibios_root_bridge_prepare() to pcibios_root_bus_prepare()

2015-07-20 Thread Yijing Wang
Pcibios_root_bridge_prepare() in powerpc set root bus speed, it's not the preparation for pci host bridge. For better separation of host bridge and root bus creation, It's need to rename it to another weak function. Signed-off-by: Yijing Wang --- arch/powerpc/include/asm/machdep.h

[PATCH part3 v12 01/10] PCI: Save domain in pci_host_bridge

2015-07-20 Thread Yijing Wang
, so introduce pci_create_root_bus_generic and pci_scan_root_bus_generic() which simply assign domain number to -1. Tested-by: Gregory CLEMENT #mvebu part Signed-off-by: Yijing Wang --- arch/alpha/kernel/pci.c|4 ++-- arch/alpha/kernel/sys_nautilus.c |2 +- arch/arm/kernel

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 22:23, Liviu Dudau wrote: > On Tue, Nov 18, 2014 at 11:46:06AM +0000, Yijing Wang wrote: >> 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: >>>

Re: [RFC PATCH 02/16] PCI: Use pci_scan_root_bus() instead of pci_scan_bus()

2014-11-18 Thread Yijing Wang
On 2014/11/18 22:28, Liviu Dudau wrote: > On Mon, Nov 17, 2014 at 10:21:36AM +0000, Yijing Wang wrote: >> From: Yijing Wang >> >> Now we could use pci_scan_root_bus() instead of >> pci_scan_bus(), pass NULL resources means use the default >> io/mem. > > A

Re: [RFC PATCH 04/16] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus()

2014-11-18 Thread Yijing Wang
On 2014/11/18 22:34, Liviu Dudau wrote: > On Mon, Nov 17, 2014 at 10:21:38AM +0000, Yijing Wang wrote: >> Rip out pci_bus_add_devices() from pci_scan_root_bus() >> for following reasons. >> 1. pci_scan_root_bus() means we only do the scan, we should >> not add pci buss

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 23:30, Liviu Dudau wrote: > On Mon, Nov 17, 2014 at 10:21:41AM +0000, Yijing Wang wrote: >> There are some common PCI infos like domain, msi_controller, these >> infos are saved in arch PCI sysdata, and lots arch specific functions >> like pci_domain_nr() and p

Re: [RFC PATCH 08/16] PCI: Introduce pci_scan_host_bridge() and pci_host_info

2014-11-18 Thread Yijing Wang
>> struct pci_host_bridge *pci_create_host_bridge( >> -struct device *parent, u32 db, >> -struct pci_ops *ops, void *sysdata, >> -struct list_head *resources) >> +struct device *parent, u32 db, struct pci_ops *ops, >> +struct pci_host_

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. > > Yijing, > > May I suggest a different approach here? Rather than having to pass an opaque > pointer that gets converted by the host bridge driver back to the private > structure, what about promoting a new style of usage, tha

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

2014-11-19 Thread Yijing Wang
>>> Something like this: >>> >>> struct pci_controller { >>> struct pci_host_bridge bridge; >>> /* private host bridge data here */ >>> . >>> }; >>> >>> #define PCI_CONTROLLER(bus) ({ >>> struct pci_host_bridge *hb = to_pci_host_bridge(bus->bridge); \ >>> container_of(hb, st

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

2014-11-19 Thread Yijing Wang
+static void pci_release_host_bridge_dev(struct device *dev) +{ + struct pci_host_bridge *bridge = to_pci_host_bridge(dev); + + if (bridge->release_fn) + bridge->release_fn(bridge); + pci_free_resource_list(&bridge->windows); +

Re: [RFC PATCH 08/16] PCI: Introduce pci_scan_host_bridge() and pci_host_info

2014-11-19 Thread Yijing Wang
>> No, in this patch, host drivers pass a pci host bridge resources init hook >> in pci_host_info *info, and we call this info->init_res() in >> pci_create_host_bridge(). >> >> +struct pci_host_info { >> +u8 res_type; >> +void *arg; >> +struct list_head *resources; /*just for build, wi

Re: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-20 Thread Yijing Wang
On 2014/11/21 0:31, Marc Zyngier wrote: > Bjorn, Yijing, > > I've just realized that patch c167caf8d174 (PCI/MSI: Remove useless > bus->msi assignment) completely breaks MSI on arm64 when using the new > MSI stacked domain: Sorry, this is my first part to refactor MSI related code, now how to get

Re: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-20 Thread Yijing Wang
>> Thomas, let me know if you want to do that. I suppose we could add a new >> patch to add it back, but that would leave bisection broken for the >> interval between c167caf8d174 and the patch that adds it back. > > Fortunately my irq/irqdomain branch is not immutable yet. So we have > no proble

Re: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-20 Thread Yijing Wang
On 2014/11/21 9:46, Thomas Gleixner wrote: > On Fri, 21 Nov 2014, Yijing Wang wrote: >> On 2014/11/21 0:31, Marc Zyngier wrote: >>> Bjorn, Yijing, >>> >>> I've just realized that patch c167caf8d174 (PCI/MSI: Remove useless >>> bus->msi assignme

Re: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-20 Thread Yijing Wang
On 2014/11/21 10:03, Jiang Liu wrote: > On 2014/11/21 9:46, Thomas Gleixner wrote: >> On Fri, 21 Nov 2014, Yijing Wang wrote: >>> On 2014/11/21 0:31, Marc Zyngier wrote: >>>> Bjorn, Yijing, >>>> >>>> I've just realized that patch c16

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

2014-11-20 Thread Yijing Wang
>>> pci_create_host_bridge() can get pci_host_bridge ops while >>> pci_create_root_bus() gets >>> the bus ops. For find out the MSI controller, the domain number and any >>> other HB >>> specific stuff, you use the HB ops. For config R/W acceses you use bus ops. >>> >> >> I want to unexport pci_c

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

2014-11-20 Thread Yijing Wang
gt;>>> 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: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-20 Thread Yijing Wang
On 2014/11/21 10:25, Jiang Liu wrote: > On 2014/11/21 9:54, Yijing Wang wrote: >>>> Thomas, let me know if you want to do that. I suppose we could add a new >>>> patch to add it back, but that would leave bisection broken for the >>>> interval between c167c

Re: [Patch V1 0/6] Refine generic/PCI MSI irqodmian interfaces

2014-11-13 Thread Yijing Wang
On 2014/11/13 19:43, Jiang Liu wrote: > This patch set is based on tip/irq/irqdomain and tries to refine > interfaces to support irqdomain for generic MSI and PCI MSI. > > Patch 1 is just minor fixes for tip/irq/irqdomain. > > Patch 2 introduces some helpers to hide struct msi_desc implementation

Re: [Patch V1 3/6] genirq: Introduce msi_irq_domain_{alloc|free}_irqs()

2014-11-13 Thread Yijing Wang
Gerry, this patch seems to be the same as last one. On 2014/11/13 19:43, Jiang Liu wrote: > Introduce msi_irq_domain_{alloc|free}_irqs() to alloc/free interrupts > from irqdomain for generic MSI interrupts. > > Signed-off-by: Jiang Liu > --- > include/linux/msi.h | 35 +++

Re: [Patch V1 0/6] Refine generic/PCI MSI irqodmian interfaces

2014-11-13 Thread Yijing Wang
On 2014/11/13 20:39, Jiang Liu wrote: > > > On 2014/11/13 20:28, Yijing Wang wrote: >> On 2014/11/13 19:43, Jiang Liu wrote: >>> This patch set is based on tip/irq/irqdomain and tries to refine >>> interfaces to support irqdomain for generic MSI and PCI MSI. &g

Re: [Patch V1 3/6] genirq: Introduce msi_irq_domain_{alloc|free}_irqs()

2014-11-13 Thread Yijing Wang
On 2014/11/13 20:41, Jiang Liu wrote: > On 2014/11/13 20:34, Yijing Wang wrote: >> Gerry, this patch seems to be the same as last one. > Do you means patch 6/6? They are different:) Oh, it's not the patch problem, I received two double patch. > >> >> >>

Re: [Patch V1 0/6] Refine generic/PCI MSI irqodmian interfaces

2014-11-13 Thread Yijing Wang
On 2014/11/14 8:25, Jiang Liu wrote: > On 2014/11/14 5:00, Marc Zyngier wrote: >> On 13/11/14 11:43, Jiang Liu wrote: >>> This patch set is based on tip/irq/irqdomain and tries to refine >>> interfaces to support irqdomain for generic MSI and PCI MSI. >>> >>> With this patch set applied, the generi

Re: [PATCH V2 0/2] PCI: generic: Assiging msi-controller to PCI hostbridge

2014-11-13 Thread Yijing Wang
On 2014/11/14 2:09, Bjorn Helgaas wrote: > [+cc Yijing] Hi, I'm doing the same thing to associate MSI_controller and PCI host bridge(not PCI bus), In my working series, I go one step further, rip out pci host bridge of pci root bus creation. And we could put the common things in the generic pci

Re: [Patch V1 0/6] Refine generic/PCI MSI irqodmian interfaces

2014-11-13 Thread Yijing Wang
On 2014/11/14 9:31, Thomas Gleixner wrote: > On Fri, 14 Nov 2014, Yijing Wang wrote: > > Could you please use a mail client which does proper line wraps or > configure yours to do so? > >> Associate the irq domain and PCI bus is not necessary, because all >> PCI b

Re: [Patch V1 0/6] Refine generic/PCI MSI irqodmian interfaces

2014-11-14 Thread Yijing Wang
在 2014/11/14 9:39, Jiang Liu 写道: On 2014/11/14 9:31, Thomas Gleixner wrote: On Fri, 14 Nov 2014, Yijing Wang wrote: Could you please use a mail client which does proper line wraps or configure yours to do so? Associate the irq domain and PCI bus is not necessary, because all PCI buses under

Re: [PATCH 10/10] PCI/MSI: Remove useless bus->msi assignment

2014-11-11 Thread Yijing Wang
On 2014/11/12 12:24, Bjorn Helgaas wrote: > On Mon, Oct 27, 2014 at 03:48:47PM +0800, Yijing Wang wrote: >> Thierry introduced MSI chip(now renamed to MSI controller) >> framework to associate MSI chip and PCI bus in arm. >> Other platforms still use its own arch MSI functi

Re: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-21 Thread Yijing Wang
在 2014/11/21 18:11, Marc Zyngier 写道: On 21/11/14 01:22, Yijing Wang wrote: On 2014/11/21 0:31, Marc Zyngier wrote: Bjorn, Yijing, I've just realized that patch c167caf8d174 (PCI/MSI: Remove useless bus->msi assignment) completely breaks MSI on arm64 when using the new MSI stacke

Re: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-21 Thread Yijing Wang
在 2014/11/21 18:29, Marc Zyngier 写道: Hi Thomas, On 21/11/14 01:46, Thomas Gleixner wrote: On Fri, 21 Nov 2014, Yijing Wang wrote: On 2014/11/21 0:31, Marc Zyngier wrote: Bjorn, Yijing, I've just realized that patch c167caf8d174 (PCI/MSI: Remove useless bus->msi assignment) co

Re: [PATCH 00/10] Save MSI chip in pci_sys_data

2014-11-21 Thread Yijing Wang
在 2014/11/22 1:20, Bjorn Helgaas 写道: [+cc Marc] On Tue, Nov 11, 2014 at 09:23:59PM -0700, Bjorn Helgaas wrote: On Mon, Oct 27, 2014 at 03:48:37PM +0800, Yijing Wang wrote: Now PCI host bridge drivers in arm associate MSI chip and PCI bus by adding .add_bus(), and assign MSI chip pointer to

Re: Removal of bus->msi assignment breaks MSI with stacked domains

2014-11-21 Thread Yijing Wang
在 2014/11/22 1:31, Bjorn Helgaas 写道: On Fri, Nov 21, 2014 at 09:54:40AM +0800, Yijing Wang wrote: Thomas, let me know if you want to do that. I suppose we could add a new patch to add it back, but that would leave bisection broken for the interval between c167caf8d174 and the patch that adds

[RFC PATCH 03/16] PCI: Clean up pci_scan_bus()

2014-11-17 Thread Yijing Wang
No one uses it, clean up. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 20 include/linux/pci.h |1 - 2 files changed, 0 insertions(+), 21 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index fc99e88..0a02fc2 100644 --- a/drivers/pci

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

2014-11-17 Thread Yijing Wang
hanks! Yijing. Yijing Wang (16): PCI: Enhance pci_scan_root_bus() to support default IO/MEM resources PCI: Use pci_scan_root_bus() instead of pci_scan_bus() PCI: Clean up pci_scan_bus() PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus() PCI: Use pci_scan_root_bus() inste

[RFC PATCH 12/16] ia64/PCI: Remove the redundant bus variable

2014-11-17 Thread Yijing Wang
Signed-off-by: Yijing Wang --- arch/ia64/pci/pci.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 291a582..aac3220 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -424,7 +424,6 @@ struct pci_bus

[RFC PATCH 05/16] PCI: Use pci_scan_root_bus() instead of pci_scan_bus_parented()

2014-11-17 Thread Yijing Wang
Now we can remove the deprecated pci_scan_bus_parented(), and use pci_scan_root_bus() instead. Signed-off-by: Yijing Wang --- drivers/pci/probe.c| 19 --- drivers/pci/xen-pcifront.c |6 +++--- include/linux/pci.h|2 -- 3 files changed, 3 insertions

[RFC PATCH 15/16] arm/PCI: Use pci_scan_host_bridge() instead of pci_scan_root_bus()

2014-11-17 Thread Yijing Wang
Signed-off-by: Yijing Wang --- arch/arm/include/asm/mach/pci.h |1 + arch/arm/kernel/bios32.c| 52 +++--- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index 370b3bd

[RFC PATCH 09/16] PCI: Associate .get_msi_ctrl() with pci_host_bridge

2014-11-17 Thread Yijing Wang
From: Yijing Wang Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |1 + include/linux/pci.h |2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c index 49b6c21..872cae1 100644 --- a/drivers/pci/host

[RFC PATCH 16/16] powerpc/PCI: Use pci_scan_host_bridge() to scan PCI bus

2014-11-17 Thread Yijing Wang
Signed-off-by: Yijing Wang --- arch/powerpc/kernel/pci-common.c | 81 ++--- 1 files changed, 48 insertions(+), 33 deletions(-) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index e5dad9a..5b0f078 100644 --- a/arch/powerpc

[RFC PATCH 14/16] arm/PCI: Introduce pci_get_domain_nr()

2014-11-17 Thread Yijing Wang
Signed-off-by: Yijing Wang --- arch/arm/include/asm/mach/pci.h |9 + arch/arm/kernel/bios32.c|8 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index f19f627..370b3bd 100644 --- a

[RFC PATCH 10/16] PCI: Add of_scan_bus() to pci_host_info

2014-11-17 Thread Yijing Wang
Add of_scan_bus() to support some platforms scan bus by of_node. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |1 + drivers/pci/probe.c | 10 +++--- include/linux/pci.h |3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host

[RFC PATCH 13/16] ia64/PCI: Use pci_scan_host_bridge() to refactor pci_acpi_scan_root()

2014-11-17 Thread Yijing Wang
Signed-off-by: Yijing Wang --- arch/ia64/pci/pci.c | 84 +++--- 1 files changed, 39 insertions(+), 45 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index aac3220..c7d97ae 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci

[RFC PATCH 02/16] PCI: Use pci_scan_root_bus() instead of pci_scan_bus()

2014-11-17 Thread Yijing Wang
From: Yijing Wang Now we could use pci_scan_root_bus() instead of pci_scan_bus(), pass NULL resources means use the default io/mem. Signed-off-by: Yijing Wang --- arch/alpha/include/asm/pci.h |2 +- arch/alpha/kernel/sys_nautilus.c |2 +- arch/cris/include/asm/pci.h |2

[RFC PATCH 06/16] PCI: Use u32 type to combine PCI domain and bus number

2014-11-17 Thread Yijing Wang
ate the arch specific pci_domain_nr(). Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 11 ++- include/linux/pci.h |4 ++-- include/uapi/linux/pci.h |3 +++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c in

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

2014-11-17 Thread Yijing Wang
From: Yijing Wang Pci_scan_root_bus(), pci_scan_bus() and pci_scan_bus_parented() are very similar. But the latter two use the default io/mem resources. Enhance pci_scan_root_bus() to support default io/mem resources, then we could use pci_scan_root_bus() instead of them, and clean them up

[RFC PATCH 11/16] x86/PCI: Use pci_scan_host_bridge() instead of pci_create_root_bus()

2014-11-17 Thread Yijing Wang
Now we could use pci_scan_host_bridge() to refactor pci_acpi_scan_root(). Signed-off-by: Yijing Wang --- arch/x86/pci/acpi.c | 65 ++--- arch/x86/pci/common.c | 23 - 2 files changed, 56 insertions(+), 32 deletions(-) diff --git

[RFC PATCH 08/16] PCI: Introduce pci_scan_host_bridge() and pci_host_info

2014-11-17 Thread Yijing Wang
From: Yijing Wang Now pci_host_bridge has been ripped out from pci root bus creation. Currently pci_scan_root_bus() lacks scalability, so platform host drivers have no proper way to configure pci_host_bridge. E.g we should assign msi_controller to pci_host_bridge, add argument for

[RFC PATCH 04/16] PCI: Rip out pci_bus_add_devices() from pci_scan_root_bus()

2014-11-17 Thread Yijing Wang
strictly speaking pci_bus_add_devices() should be called after the resources assignment. Signed-off-by: Yijing Wang --- arch/alpha/kernel/pci.c |1 + arch/alpha/kernel/sys_nautilus.c |1 + arch/frv/mb93090-mb00/pci-vdk.c |8 +--- arch/ia64/sn/kernel/io_init.c |2

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

2014-11-17 Thread Yijing Wang
infos in, then we could eliminate the arch specifc functions. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c | 99 + drivers/pci/probe.c | 134 include/linux/pci.h | 11 +++- 3 files changed

Re: [RFC PATCH 14/16] arm/PCI: Introduce pci_get_domain_nr()

2014-11-17 Thread Yijing Wang
>> >> -bus->domain_nr = domain; >> +void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) >> +{ >> +bus->domain_nr = pci_get_domain_nr(parent); >> } >> #endif > > This code is superseded by the last patches I sent to move the domain > assignment to PCI core code. >

<    2   3   4   5   6   7   8   9   10   11   >