[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/acpi

[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 ++-- include

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

2014-10-14 Thread David Miller
From: Yijing Wang Date: Wed, 15 Oct 2014 11:07:13 +0800 > 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 S. Miller

[PATCH v3 24/27] IA64/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/ia64/include/asm/pci.h | 10 ++ arch/ia64/kernel/msi_ia64.c | 14 ++ arch/ia64/pci/pci.c |

[PATCH v3 20/27] MIPS/Xlr/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/mips/pci/pci-xlr.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/mips/pci/p

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

2014-10-14 Thread Yijing Wang
Now we use struct msi_chip in all platforms to configure MSI/MSI-X. We can clean up the unused arch functions. Signed-off-by: Yijing Wang --- Hi Lucas, I dropped the reviewed-by, because this version has a lot changes compared to last one, I guess you may want to check it again. --- drivers/i

[PATCH v3 23/27] arm/iop13xx/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/arm/mach-iop13xx/include/mach/pci.h |4 arch/arm/mach-iop13xx/iq81340mc.c|3 +++ arch/arm/mach-iop13xx/

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

2014-10-14 Thread Yijing Wang
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 chip. In fact, all pci devices under the same pci hostbridge share same msi chip. So msi chip should be seen as one of resources or attributes to

[PATCH v3 05/27] PCI: tegra: Save msi chip in pci_sys_data

2014-10-14 Thread Yijing Wang
Save msi chip in pci_sys_data instead of assign msi chip 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/drivers/pci/host/pci-tegra.c i

[PATCH v3 22/27] s390/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 --- Hi Sebastian, I dropped the Acked-by , because this version has a lot changes compared to last. So, I guess you may want to che

[PATCH v3 19/27] MIPS/Xlp/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/mips/include/asm/netlogic/xlp-hal/pcibus.h |1 + arch/mips/pci/msi-xlp.c | 11 +-- arc

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

2014-10-14 Thread Yijing Wang
MSI chip will be saved in pci_sys_data, now we can clean up pcibios_add_bus() and pcibios_remove_bus() in arm, and use pci_find_msi_chip() to get msi chip in core MSI code. Signed-off-by: Yijing Wang --- arch/arm/include/asm/mach/pci.h |4 arch/arm/kernel/bios32.c| 16

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

2014-10-14 Thread Yijing Wang
Now there are a lot of __weak arch functions in MSI code. These functions make MSI driver complex. Thierry introduced MSI chip framework to configure MSI/MSI-X irq in arm. Use MSI chip framework to refactor all other platform MSI code to eliminate weak arch MSI functions. This patch add .restore_ir

[PATCH v3 08/27] PCI: mvebu: Save msi chip in pci_sys_data

2014-10-14 Thread Yijing Wang
Save msi chip in pci_sys_data instead of assign msi chip 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/pci/host/pci-mvebu.c 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/drivers/pc

[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 00/27] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-10-14 Thread Yijing Wang
Now there are a lot of weak arch functions in MSI code. Thierry Reding Introduced MSI chip framework to configure MSI/MSI-X in arm, that's a better solution than overriding lots of existing weak arch functionsin. This series use MSI chip framework to refactor MSI code across all platforms to eli

[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 97

[PATCH v3 14/27] Irq_remapping/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 --- drivers/iommu/irq_remapping.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/ir

[PATCH v3 15/27] x86/MSI: Remove unused MSI weak arch functions

2014-10-14 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 v3 01/27] MSI: Remove the redundant irq_set_chip_data()

2014-10-14 Thread Yijing Wang
Currently, pcie-designware, pcie-rcar and pci-tegra drivers use irq chip_data to save the msi_chip pointer. They already call irq_set_chip_data() in their own MSI irq map functions. And chip_data is an opaque pointer, how to use it is arch dependent. It should not be placed in MSI core. Signed-off

[PATCH v3 17/27] MIPS/Octeon/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/mips/include/asm/octeon/pci-octeon.h |4 +++ arch/mips/pci/msi-octeon.c| 31 --

[PATCH v3 25/27] Sparc/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/sparc/kernel/pci.c | 14 -- arch/sparc/kernel/pci_impl.h | 12 2 files changed, 24 inserti

[PATCH v3 21/27] Powerpc/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 --- Hi Michael, I dropped the Acked-by , because this version has a lot changes compared to last. So, I guess you may want to check

[PATCH v3 26/27] tile/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/tile/include/asm/pci.h | 10 ++ arch/tile/kernel/pci_gx.c | 13 +++-- 2 files changed, 21 insertions(+

[PATCH v3 18/27] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error

2014-10-14 Thread Yijing Wang
Commit 465665f78a7 ("mips: Kill pointless destroy_irq()") removed the destroy_irq(). So remove the leftover one in xlp_setup_msix() to fix build error. arch/mips/pci/msi-xlp.c: In function 'xlp_setup_msix': arch/mips/pci/msi-xlp.c:447:3: error: implicit declaration of function 'destroy_irq'.. cc1

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

2014-10-14 Thread Yijing Wang
Commit 0e4ccb1505a9 ("PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()") introduced two __weak arch functions arch_msix_mask_irq() and arch_msi_mask_irq() to work around a bug when running xen in x86. These two functions made msi code more complex. This patch reverts the commit and introduces a

[PATCH v3 07/27] PCI: rcar: Save msi chip in pci_sys_data

2014-10-14 Thread Yijing Wang
Save msi chip in pci_sys_data instead of assign msi chip 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/drivers/pci/host/pcie-rcar.c i

[PATCH v3 06/27] PCI: designware: Save msi chip in pci_sys_data

2014-10-14 Thread Yijing Wang
Save msi chip in pci_sys_data instead of assign msi chip 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-designware.c b/drivers/pci/hos

[PATCH v6 1/2] iopoll: Introduce memory-mapped IO polling macros

2014-10-14 Thread Mitchel Humpherys
From: Matt Wagantall It is sometimes necessary to poll a memory-mapped register until its value satisfies some condition. Introduce a family of convenience macros that do this. Tight-looping, sleeping, and timing out can all be accomplished using these macros. Cc: Thierry Reding Cc: Will Deacon

[PATCH v6 0/2] iommu/arm-smmu: hard iova_to_phys

2014-10-14 Thread Mitchel Humpherys
This series introduces support for performing iova-to-phys translations via the ARM SMMU hardware on supported implementations. We also make use of some new generic macros for polling hardware registers. v5..v6: - iopoll: use shift instead of divide - arm-smmu: no changes, resending series du

[PATCH v6 2/2] iommu/arm-smmu: add support for iova_to_phys through ATS1PR

2014-10-14 Thread Mitchel Humpherys
Currently, we provide the iommu_ops.iova_to_phys service by doing a table walk in software to translate IO virtual addresses to physical addresses. On SMMUs that support it, it can be useful to ask the SMMU itself to do the translation. This can be used to warm the TLBs for an SMMU. It can also be

Re: [RFC PATCH v3 6/7] arm: call iommu_init before of_platform_populate

2014-10-14 Thread Laurent Pinchart
Hi Thierry, On Tuesday 14 October 2014 17:05:29 Thierry Reding wrote: > On Tue, Oct 14, 2014 at 06:01:58PM +0300, Laurent Pinchart wrote: > > On Tuesday 14 October 2014 15:37:59 Thierry Reding wrote: > >> On Tue, Oct 14, 2014 at 03:20:46PM +0200, Arnd Bergmann wrote: > >>> On Tuesday 14 October 20

Re: [RFC PATCH v3 6/7] arm: call iommu_init before of_platform_populate

2014-10-14 Thread Thierry Reding
On Tue, Oct 14, 2014 at 06:01:58PM +0300, Laurent Pinchart wrote: > Hi Thierry, > > On Tuesday 14 October 2014 15:37:59 Thierry Reding wrote: > > On Tue, Oct 14, 2014 at 03:20:46PM +0200, Arnd Bergmann wrote: > > > On Tuesday 14 October 2014 16:07:38 Laurent Pinchart wrote: > > >> On Tuesday 23 Se

Re: [RFC PATCH v3 6/7] arm: call iommu_init before of_platform_populate

2014-10-14 Thread Laurent Pinchart
Hi Thierry, On Tuesday 14 October 2014 15:37:59 Thierry Reding wrote: > On Tue, Oct 14, 2014 at 03:20:46PM +0200, Arnd Bergmann wrote: > > On Tuesday 14 October 2014 16:07:38 Laurent Pinchart wrote: > >> On Tuesday 23 September 2014 09:44:25 Arnd Bergmann wrote: > >>> On Tuesday 23 September 2014

Re: [RFC PATCH v3 6/7] arm: call iommu_init before of_platform_populate

2014-10-14 Thread Thierry Reding
On Tue, Oct 14, 2014 at 03:20:46PM +0200, Arnd Bergmann wrote: > On Tuesday 14 October 2014 16:07:38 Laurent Pinchart wrote: > > On Tuesday 23 September 2014 09:44:25 Arnd Bergmann wrote: > > > On Tuesday 23 September 2014 09:02:39 Thierry Reding wrote: > > > > > I see two problems with using defer

Re: [RFC PATCH v3 6/7] arm: call iommu_init before of_platform_populate

2014-10-14 Thread Arnd Bergmann
On Tuesday 14 October 2014 16:07:38 Laurent Pinchart wrote: > On Tuesday 23 September 2014 09:44:25 Arnd Bergmann wrote: > > On Tuesday 23 September 2014 09:02:39 Thierry Reding wrote: > > > > I see two problems with using deferred probing here: > > > > > > > > - we don't actually need to defer th

Re: [RFC PATCH v3 4/7] iommu: provide helper function to configure an IOMMU for an of master

2014-10-14 Thread Laurent Pinchart
Hi Will, On Monday 22 September 2014 18:13:52 Will Deacon wrote: > On Thu, Sep 18, 2014 at 12:13:13PM +0100, Laurent Pinchart wrote: > > Hi Will, > > Hi Laurent, > > > Thank you for the patch. > > Sorry for the delay in replying, I was at Connect last week and the email > has backed up. No wor

Re: [RFC PATCH v3 6/7] arm: call iommu_init before of_platform_populate

2014-10-14 Thread Laurent Pinchart
Hi Arnd, On Tuesday 23 September 2014 09:44:25 Arnd Bergmann wrote: > On Tuesday 23 September 2014 09:02:39 Thierry Reding wrote: > > > I see two problems with using deferred probing here: > > > > > > - we don't actually need to defer the probing but the binding to the > > > driver when no dma

Re: [RFC PATCH v3 5/7] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-10-14 Thread Laurent Pinchart
Hi Will, On Monday 22 September 2014 18:50:27 Will Deacon wrote: > On Mon, Sep 22, 2014 at 10:29:10AM +0100, Thierry Reding wrote: > > On Thu, Sep 18, 2014 at 02:17:33PM +0300, Laurent Pinchart wrote: > >> On Friday 12 September 2014 17:34:53 Will Deacon wrote: > >>> This patch extends of_dma_conf

[git pull] IOMMU Updates for Linux v3.18

2014-10-14 Thread Joerg Roedel
Hi Linus, The following changes since commit fe82dcec644244676d55a1384c958d5f67979adb: Linux 3.17-rc7 (2014-09-28 14:29:07 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-updates-v3.18 for you to fetch changes up to 09

[PATCH v5 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-14 Thread Daniel Kurtz
The rk3288 has several iommus. Each iommu belongs to a single master device. There is one device (ISP) that has two slave iommus, but that case is not yet supported by this driver. At subsys init, the iommu driver registers itself as the iommu driver for the platform bus. The master devices fin

[PATCH v4 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-14 Thread Daniel Kurtz
The rk3288 has several iommus. Each iommu belongs to a single master device. There is one device (ISP) that has two slave iommus, but that case is not yet supported by this driver. At subsys init, the iommu driver registers itself as the iommu driver for the platform bus. The master devices fin