[PATCH 1/2] IOMMU/trivial: Use for_each_drhd_unit() instead of list_for_each_entry()

2013-10-31 Thread Yijing Wang
Use for_each_drhd_unit() instead of list_for_each_entry for better readability. Signed-off-by: Yijing Wang --- drivers/iommu/dmar.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 785675a..da2d0d9 100644 --- a/drivers

[PATCH 2/2] IOMMU: Use list_for_each_entry_safe() for dmar_domain->devices traversal

2013-10-31 Thread Yijing Wang
Replace list_for_each_safe() + list_entry() with the simpler list_for_each_entry_safe(). Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index

[PATCH 1/1] IOMMU: Save pci device id instead of pci_dev* pointer for DMAR devices

2013-11-05 Thread Yijing Wang
on 34] Present field in the IRTE entry is clear Signed-off-by: Yijing Wang --- drivers/iommu/dmar.c| 93 +- drivers/iommu/intel-iommu.c | 155 --- include/linux/dmar.h| 20 -- 3 files changed, 159 inser

Re: [PATCH 1/1] IOMMU: Save pci device id instead of pci_dev* pointer for DMAR devices

2013-11-07 Thread Yijing Wang
HI Bjorn, Thanks for your review and comments very much! >> +list_for_each_entry(dmar_dev, head, list) >> +if (dmar_dev->segment == pci_domain_nr(dev->bus) >> +&& dmar_dev->bus == dev->bus->number >> +&& dmar_dev->devfn

Re: [PATCH 1/1] IOMMU: Save pci device id instead of pci_dev* pointer for DMAR devices

2013-11-10 Thread Yijing Wang
>> Hmmm, this is the thing I am most worried about. If we just only use >> (pci_dev *) poninter in drhd->devices array as a identification. Change >> (pci_dev *) pointer instead of pci device id segment:bus:devfn is safe. >> Or, this is a wrong way to fix this issue. I don't know IOMMU driver much

Re: [PATCH 1/1] IOMMU: Save pci device id instead of pci_dev* pointer for DMAR devices

2013-11-20 Thread Yijing Wang
On 2013/11/20 23:59, David Woodhouse wrote: > On Fri, 2013-11-08 at 08:46 -0700, Bjorn Helgaas wrote: >> >> I don't know the IOMMU drivers well either, but it seems like they >> rely on notifications of device addition and removal (see >> iommu_bus_notifier()). It doesn't seem right for them to al

[PATCH v2] Enhance dmar to support device hotplug

2013-11-21 Thread Yijing Wang
Other, here use list to manage target devices for IOMMU, we can easily use list helper. Yijing Wang (1): IOMMU: enhance dmar to support device hotplug drivers/iommu/dmar.c| 82 +++--- drivers/iommu/intel-iommu.c | 161 +- incl

[PATCH v2] IOMMU: enhance dmar to support device hotplug

2013-11-21 Thread Yijing Wang
reason 34] Present field in the IRTE entry is clear Signed-off-by: Yijing Wang --- drivers/iommu/dmar.c| 82 +++--- drivers/iommu/intel-iommu.c | 161 +- include/linux/dmar.h| 24 -- 3 files changed, 167 insertions

Re: [Patch Part1 V2 01/17] iommu/vt-d: use dedicated bitmap to track remapping entry allocation status

2013-12-01 Thread Yijing Wang
Tested-and-reviewed-by: Yijing Wang On 2013/11/29 16:50, Jiang Liu wrote: > Currently Intel interrupt remapping drivers uses the "present" flag bit > in remapping entry to track whether an entry is allocated or not. > It works as follow: > 1) allocate a remapping entry and

Re: [Patch Part1 V2 02/17] iommu/vt-d: fix PCI device reference leakage on error recovery path

2013-12-01 Thread Yijing Wang
Reviewed-by: Yijing Wang On 2013/11/29 16:50, Jiang Liu wrote: > Function dmar_parse_dev_scope() should release the PCI device reference > count gained in function dmar_parse_one_dev_scope() on error recovery, > otherwise will cause PCI device object leakage. > > This patch

Re: [Patch Part1 V2 04/17] iommu/vt-d: fix resource leakage on error recovery path in iommu_init_domains()

2013-12-01 Thread Yijing Wang
if (!iommu->domains) { > printk(KERN_ERR "Allocating domain array failed\n"); > + kfree(iommu->domain_ids); > + iommu->domain_ids = NULL; > return -ENOMEM; > } > > Acked-by: Yijing Wang -- Tha

Re: [Patch Part1 V2 07/17] iommu/vt-d. trivial: check suitable flag in function detect_intel_iommu()

2013-12-01 Thread Yijing Wang
This patch is the same as the last.:) On 2013/11/29 16:50, Jiang Liu wrote: > Flag irq_remapping_enabled is only set by intel_enable_irq_remapping(), > which is called after detect_intel_iommu(). So we should check flag > disable_irq_remap instead of irq_remapping_enabled in function > detect_inte

Re: [Patch Part1 V2 07/17] iommu/vt-d, trivial: check suitable flag in function detect_intel_iommu()

2013-12-01 Thread Yijing Wang
2apic && > dmar->flags & 0x1) > pr_info("Queued invalidation will be enabled to support > x2apic and Intr-remapping.\n"); > > Reviewed-by: Yijing Wang -- Thanks! Yijing ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [Patch Part1 V2 12/17] iommu/vt-d: fix invalid memory access when freeing DMAR irq

2013-12-01 Thread Yijing Wang
Reviewed-by: Yijing Wang On 2013/11/29 16:50, Jiang Liu wrote: > In function free_dmar_iommu(), it sets IRQ handler data to NULL > before calling free_irq(), which will cause invalid memory access > because free_irq() will access IRQ handler data when calling > function dmar_msi_mas

[PATCH 2/3] iommu/fsl_pamu: Use dev_is_pci() to check whether it is pci device

2013-12-05 Thread Yijing Wang
Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device. Signed-off-by: Yijing Wang --- drivers/iommu/fsl_pamu_domain.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers

[PATCH 1/3] iommu/amd: Use dev_is_pci() to check whether it is pci device

2013-12-05 Thread Yijing Wang
Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device. Signed-off-by: Yijing Wang --- drivers/iommu/amd_iommu.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu

[PATCH 3/3] iommu/vt-d: Use dev_is_pci() to check whether it is pci device

2013-12-05 Thread Yijing Wang
Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device. Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel

Re: [PATCH v2] Enhance dmar to support device hotplug

2013-12-12 Thread Yijing Wang
On 2013/12/11 1:03, Don Dutile wrote: > On 11/21/2013 03:21 AM, Yijing Wang wrote: >> This is the v2 patch, the v1 link: >> http://marc.info/?l=linux-pci&m=138364004628824&w=2 >> >> v1->v2: keep (pci_dev *) pointer array in dmar_drhd_uni, only use pci devi

Re: [Patch Part2 V1 07/14] iommu/vt-d: fix error in detect ATS capability

2014-01-08 Thread Yijing Wang
This is a issue, our BIOS also supports several ATSR which have the same segment. Good fix :) On 2014/1/7 17:00, Jiang Liu wrote: > Current Intel IOMMU driver only matches a PCIe root port with the first > DRHD unit with the samge segment number. It will report false result > if there are multipl

Re: [Patch Part2 V1 11/14] iommu/vt-d, PCI: update DRHD/RMRR/ATSR device scope caches when PCI hotplug happens

2014-01-09 Thread Yijing Wang
Hi Gerry, This is patch solution is better than mine, it's more reliable. I tested this patch in my huawei RH5885 platform, after applied it, the issue is gone. But I can not test it in the case that bus number changed after hotplug. Anyway, it's a good solution. Thanks! Yijing. On 2014/1/7 17

Re: [PATCH v2] IOMMU: enhance dmar to support device hotplug

2014-03-04 Thread Yijing Wang
On 2014/3/4 22:31, Joerg Roedel wrote: > On Thu, Nov 21, 2013 at 04:21:56PM +0800, Yijing Wang wrote: >> @@ -3641,21 +3681,42 @@ static int device_notifier(struct notifier_block *nb, >> struct device *dev = data; >> struct pci_dev *pdev = to_pci_dev(dev); >&

[PATCH 0/6] trivial cleanup for iommu/vt-d

2014-05-20 Thread Yijing Wang
Some cleanup patches for iommu/vt-d. Yijing Wang (6): iommu/vt-d: Use list_for_each_safe() to simplify code iommu/vt-d: move up no_iommu and dmar_disabled check iommu/vt-d: clear the redundant assignment in dmar_enable_qi iommu/vt-d: clear the redundant assignment for domain->nid io

[PATCH 3/6] iommu/vt-d: clear the redundant assignment in dmar_enable_qi

2014-05-20 Thread Yijing Wang
__dmar_enable_qi() will initialize free_head,free_tail and free_cnt for q_inval. Remove the redundant initialization in dmar_enable_qi(). Signed-off-by: Yijing Wang --- drivers/iommu/dmar.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers

[PATCH 4/6] iommu/vt-d: clear the redundant assignment for domain->nid

2014-05-20 Thread Yijing Wang
Alloc_domain() will initialize domain->nid to -1. So the initialization for domain->nid in md_domain_init() is redundant, clear it. Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/iommu/intel-iom

[PATCH 6/6] iommu/vt-d: fix reference count in iommu_prepare_isa

2014-05-20 Thread Yijing Wang
Decrease the device reference count avoid memory leak. Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 455896c..a78a824 100644 --- a/drivers

[PATCH 5/6] iommu/vt-d: use inline function dma_pte_superpage instead of macros

2014-05-20 Thread Yijing Wang
Use inline function dma_pte_superpage() instead of macro for better readability. Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index d1d6636..455896c

[PATCH 2/6] iommu/vt-d: move up no_iommu and dmar_disabled check

2014-05-20 Thread Yijing Wang
Move up the no_iommu and dmar_disabled check, avoid the useless initialization for dmar. Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index

[PATCH 1/6] iommu/vt-d: Use list_for_each_safe() to simplify code

2014-05-20 Thread Yijing Wang
Use list_for_each_entry_safe() instead of list_entry() to simplify code. Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index f256ffc..e020dcf

[PATCH 2/2] iommu/vt-d: suppress compiler warnings

2014-05-26 Thread Yijing Wang
: ‘bridge_bus’ may be used uninitialized in this function drivers/iommu/intel-iommu.c:2217: warning: ‘bridge_devfn’ may be used uninitialized in this function Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a

[PATCH 1/2] iommu/vt-d: remove the useless dma_pte_addr

2014-05-26 Thread Yijing Wang
Signed-off-by: Yijing Wang --- drivers/iommu/intel-iommu.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index f256ffc..7b7127a 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c

Re: [PATCH 1/2] iommu/vt-d: remove the useless dma_pte_addr

2014-06-17 Thread Yijing Wang
ping... On 2014/5/26 20:13, Yijing Wang wrote: > Signed-off-by: Yijing Wang > --- > drivers/iommu/intel-iommu.c |6 ++ > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c > index f256ffc..7

Re: [PATCH 0/6] trivial cleanup for iommu/vt-d

2014-06-17 Thread Yijing Wang
ping... On 2014/5/20 20:37, Yijing Wang wrote: > Some cleanup patches for iommu/vt-d. > > Yijing Wang (6): > iommu/vt-d: Use list_for_each_safe() to simplify code > iommu/vt-d: move up no_iommu and dmar_disabled check > iommu/vt-d: clear the redundant assignment in dmar_e

Re: [PATCH 2/6] iommu/vt-d: move up no_iommu and dmar_disabled check

2014-07-04 Thread Yijing Wang
>> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c >> index e020dcf..6b71608 100644 >> --- a/drivers/iommu/intel-iommu.c >> +++ b/drivers/iommu/intel-iommu.c >> @@ -3948,6 +3948,9 @@ int __init intel_iommu_init(void) >> /* VT-d is required for a TXT/tboot launch, so enfo

Re: [PATCH 0/6] trivial cleanup for iommu/vt-d

2014-07-04 Thread Yijing Wang
On 2014/7/4 17:22, Joerg Roedel wrote: > On Tue, May 20, 2014 at 08:37:46PM +0800, Yijing Wang wrote: >> >> Yijing Wang (6): >> iommu/vt-d: Use list_for_each_safe() to simplify code >> iommu/vt-d: move up no_iommu and dmar_disabled check >> iommu/vt-d:

[PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-10 Thread Yijing Wang
[ 1438.703851] DMAR:[fault reason 02] Present bit in context entry is clear Signed-off-by: Yijing Wang --- arch/x86/include/asm/iommu.h |2 ++ arch/x86/kernel/pci-dma.c|8 drivers/iommu/intel-iommu.c | 41 + 3 files changed, 51 insertions

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-10 Thread Yijing Wang
0003 Rev=0 Len=078 Capabilities: [b70 v1] Vendor Specific Information: ID=0001 Rev=0 Len=010 Thanks! Yijing. > > On 2014/8/11 10:54, Yijing Wang wrote: >> We found some strange devices in HP C7000 and Huawei Server. These devices >> can not be enumerated by OS,

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-11 Thread Yijing Wang
>> extern struct iommu_table_entry __iommu_table[], __iommu_table_end[]; >> >> @@ -146,6 +148,7 @@ void dma_generic_free_coherent(struct device *dev, >> size_t size, void *vaddr, >> */ >> static __init int iommu_setup(char *p) >> { >> +char *end; >> iommu_merge = 1; >> >> if

Re: [PATCH] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-11 Thread Yijing Wang
On 2014/8/12 11:18, Jiang Liu wrote: > On 2014/8/12 9:37, Yijing Wang wrote: >> On 2014/8/11 22:59, Linda Knippers wrote: >>> On 8/11/2014 12:43 AM, Alex Williamson wrote: >>>> On Mon, 2014-08-11 at 10:54 +0800, Yijing Wang wrote: >>>>> We found some

[RFC PATCH 03/20] PCI/MSI: Remove useless bus->msi assignment

2014-08-12 Thread Yijing Wang
Currently, PCI drivers will initialize bus->msi in pcibios_add_bus(). pcibios_add_bus() will be called in every pci bus initialization. So the bus->msi assignment in pci_alloc_child_bus() is useless. Signed-off-by: Yijing Wang CC: Thierry Reding CC: Thomas Petazzoni --- drivers/pci/p

[RFC PATCH 05/20] MSI: Refactor struct msi_chip to become more common

2014-08-12 Thread Yijing Wang
t device" to support future Non-PCI MSI device. Signed-off-by: Yijing Wang CC: Thierry Reding CC: Thomas Petazzoni --- drivers/irqchip/irq-armada-370-xp.c |4 ++-- drivers/pci/host/pci-tegra.c|3 ++- drivers/pci/host/pcie-designware.c |4 ++-- drivers/pci/host/

[RFC PATCH 02/20] MSI: Clean up struct msi_chip argument

2014-08-12 Thread Yijing Wang
: Yijing Wang CC: Thierry Reding CC: Thomas Petazzoni --- drivers/irqchip/irq-armada-370-xp.c | 12 +--- drivers/pci/host/pci-tegra.c|8 +--- drivers/pci/host/pcie-designware.c |4 ++-- drivers/pci/host/pcie-rcar.c|8 +--- drivers/pci/msi.c

[RFC PATCH 04/20] MSI: Remove the redundant irq_set_chip_data()

2014-08-12 Thread Yijing Wang
Currently, pcie-designware, pcie-rcar, pci-tegra drivers use irq chip_data to the msi_chip pointer. They already call irq_set_chip_data() in their own MSI irq map functions. So irq_set_chip_data() in arch_setup_msi_irq() is useless. Signed-off-by: Yijing Wang --- drivers/pci/msi.c |2 -- 1

[RFC PATCH 16/20] arm/iop13xx/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip iop13xx_msi_chip instead of weak arch functions to configure MSI/MSI-X. And associate the pci bus with msi_chip in pcibios_add_bus(). Signed-off-by: Yijing Wang --- arch/arm/mach-iop13xx/include/mach/pci.h |2 ++ arch/arm/mach-iop13xx/iq81340mc.c

[RFC PATCH 00/20] Use msi_chip to configure MSI/MSI-X in all platforms

2014-08-12 Thread Yijing Wang
This series is mainly to use msi_chip instead of currently weak arch functions across all platforms. Also clean up current MSI code and make drivers support MSI easier. Yijing Wang (20): x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq() MSI: Clean up struct msi_chip

[RFC PATCH 18/20] Sparc/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip sparc_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/sparc/kernel/pci.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel

[RFC PATCH 01/20] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()

2014-08-12 Thread Yijing Wang
this is preparation for using struct msi_chip instead of weak arch MSI functions in all platforms. Signed-off-by: Yijing Wang CC: Konrad Rzeszutek Wilk --- arch/x86/include/asm/x86_init.h |3 --- arch/x86/kernel/apic/io_apic.c | 15 +++ arch/x86/kernel/x86_init.c | 10

[RFC PATCH 07/20] x86/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip apic_msi_chip instead of weak arch functions to configure MSI/MSI-X in x86. Signed-off-by: Yijing Wang --- arch/x86/include/asm/pci.h |1 + arch/x86/kernel/apic/io_apic.c | 20 2 files changed, 17 insertions(+), 4 deletions(-) diff

[RFC PATCH 06/20] PCI/MSI: Introduce arch_get_match_msi_chip() to find the match msi_chip

2014-08-12 Thread Yijing Wang
deliver their MSI to PCI hostbridge, if more than one msi_chip found in system, DTS file will report the binding between MSI devices and target msi_chip. So we need a platform implemented interface to do that. Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 30

[RFC PATCH 17/20] IA64/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip ia64_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/ia64/kernel/msi_ia64.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64

[RFC PATCH 10/20] x86/MSI: Remove unused MSI weak arch functions

2014-08-12 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 |3 --- arch/x86/kernel/apic/io_apic.c |2 +- arch/x86/kernel/x86_init.c | 24 3 files changed, 1 insertions(+), 28 deletions(-) diff --git a

[RFC PATCH 15/20] s390/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip zpci_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/s390/pci/pci.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index

[RFC PATCH 12/20] MIPS/Xlp/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip xlp_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/mips/pci/msi-xlp.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/mips/pci/msi-xlp.c b/arch/mips/pci/msi-xlp.c index

[RFC PATCH 09/20] irq_remapping/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip remap_msi_chip instead of weak arch functions to configure irq remapping MSI/MSI-X in x86. Signed-off-by: Yijing Wang --- drivers/iommu/irq_remapping.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/iommu

[RFC PATCH 19/20] tile/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip tile_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/tile/kernel/pci_gx.c | 20 +++- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel

[RFC PATCH 13/20] MIPS/xlr/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip xlr_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/mips/pci/pci-xlr.c | 19 +++ 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci

[RFC PATCH 14/20] Powerpc/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip ppc_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/powerpc/kernel/msi.c | 23 +-- 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc

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

2014-08-12 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 --- drivers/pci/msi.c | 82 1 files changed, 32 insertions(+), 50 deletions(-) diff --git a/drivers

[RFC PATCH 08/20] x86/xen/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip xen_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang CC: Konrad Rzeszutek Wilk --- arch/x86/pci/xen.c | 128 +-- 1 files changed, 73 insertions(+), 55 deletions(-) diff

[RFC PATCH 11/20] MIPS/Octeon/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
Introduce a new struct msi_chip octeon_msi_chip instead of weak arch functions to configure MSI/MSI-X. Signed-off-by: Yijing Wang --- arch/mips/pci/msi-octeon.c | 45 ++- 1 files changed, 19 insertions(+), 26 deletions(-) diff --git a/arch/mips/pci/msi

Re: [Xen-devel] [RFC PATCH 01/20] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()

2014-08-12 Thread Yijing Wang
On 2014/8/12 17:09, David Vrabel wrote: > On 12/08/14 08:25, Yijing Wang wrote: >> Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq() >> and arch_msi_mask_irq() to fix a bug found when running xen in x86. >> Introduced these two funcntions make MSI cod

Re: [RFC PATCH 07/20] x86/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X

2014-08-12 Thread Yijing Wang
On 2014/8/13 3:09, Konrad Rzeszutek Wilk wrote: > On Tue, Aug 12, 2014 at 03:26:00PM +0800, Yijing Wang wrote: >> Introduce a new struct msi_chip apic_msi_chip instead of weak arch >> functions to configure MSI/MSI-X in x86. > > Why not 'x86_msi_ops' (see arch/x8

[PATCH] iommu/vt-d: Add domain field for dmar fault message

2014-08-24 Thread Yijing Wang
Maybe there are the same bus:dev.fn in different domains, so add the domain field for dmar fault message to identify the exact source device. Signed-off-by: Yijing Wang --- drivers/iommu/dmar.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/dmar.c

[PATCH v2] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-24 Thread Yijing Wang
: Yijing Wang --- v1-v2: Documented to kernel-parameter, tested ok in the real broken platforms. --- Documentation/kernel-parameters.txt |2 + arch/x86/include/asm/iommu.h|2 + arch/x86/kernel/pci-dma.c |8 ++ drivers/iommu/intel-iommu.c | 42

Re: [PATCH v2] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-25 Thread Yijing Wang
>> +/* We found some strange devices in HP c7000 and other platforms, they >> + * can not be enumerated by OS, and they did DMA read/write without >> + * driver management. if we open iommu in these platforms, the DMA >> read/write >> + * will be blocked by IOMMU hardware. Currently

Re: [PATCH v2] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-25 Thread Yijing Wang
On 2014/8/25 20:11, Sathya Perla wrote: >> -Original Message- >> From: Yijing Wang [mailto:wangyij...@huawei.com] >> >> On 2014/8/25 17:32, Sathya Perla wrote: >>>> -Original Message- >>>> From: Joerg Roedel [mailto:j...@8bytes.org] &

Re: [PATCH v2] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-25 Thread Yijing Wang
On 2014/8/25 23:04, David Woodhouse wrote: > On Mon, 2014-08-25 at 12:11 +, Sathya Perla wrote: >> >> Hi Wang, from the kernel log I can see that the faulting address >> 0xbdf7 falls in the >> RMRR range the BIOS requested: >> [0.111343] DMAR: RMRR base: 0x00bdf6f000 end: 0x00bd

Re: [PATCH v2] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-08-25 Thread Yijing Wang
On 2014/8/25 17:15, Joerg Roedel wrote: > [Adding the Emulex driver developers to Cc for some input on the device, > and why it might use wrong request ids] Thanks! > > On Mon, Aug 25, 2014 at 02:44:59PM +0800, Yijing Wang wrote: >> We found some strange devices in HP C7000

Re: [PATCH v2] iommu/vt-d: Fix broken device issue when using iommu=pt

2014-09-04 Thread Yijing Wang
>>> Could you also please send the me the FW version (output of "ethtool -i >> eth0") >> >> Hi Sathya, thanks for your help. FW version is 4.6.247.5 driver version is >> 4.4.161.0s > > Hi Wang, this issue (a FW bug) was fixed in the 4.9 FW series. > The HP qualified FW (ver 4.9.416.0) is availa

[PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-05 Thread Yijing Wang
_chip() used in ARM platform, find the MSI chip by pci bus. Signed-off-by: Yijing Wang --- drivers/pci/msi.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index a77e7f7..539c11d 100644 --- a/drivers/pci/msi.c +++ b/driver

[PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()

2014-09-05 Thread Yijing Wang
Currently, pcie-designware, pcie-rcar, 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. So irq_set_chip_data() in arch_setup_msi_irq() is useless. Signed-off-by: Yijing Wang --- drivers/pci/msi.c |2

[PATCH v1 07/21] x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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 |1 + arch/x86/kernel/apic/io_apic.c | 12 2 files changed, 13 insertions

[PATCH v1 11/21] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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/msi-octeon.c | 35 ++- 1 files changed, 22 insertions(+), 13 deletions(-) diff

[PATCH v1 10/21] x86/MSI: Remove unused MSI weak arch functions

2014-09-05 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 |3 --- arch/x86/include/asm/x86_init.h |4 arch/x86/kernel/apic/io_apic.c |2 +- arch/x86/kernel/x86_init.c | 24 drivers/iommu

[PATCH v1 09/21] Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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 |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/iommu

[PATCH v1 00/21] Use MSI chip to configure MSI/MSI-X in all platforms

2014-09-05 Thread Yijing Wang
def 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 (21): PCI/MSI: Clean up struct msi_chip a

[PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()

2014-09-05 Thread Yijing Wang
all platforms. Signed-off-by: Yijing Wang CC: Konrad Rzeszutek Wilk --- arch/x86/include/asm/apic.h |4 arch/x86/include/asm/x86_init.h |3 --- arch/x86/kernel/apic/io_apic.c |2 +- arch/x86/kernel/x86_init.c | 10 -- arch/x86/pci/xen.c |

[PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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 CC: Konrad Rzeszutek Wilk --- arch/x86/pci/xen.c | 46 ++ 1 files changed, 30

[PATCH v1 17/21] arm/iop13xx/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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 |2 ++ arch/arm/mach-iop13xx/iq81340mc.c|1 + arch/arm/mach-iop13xx

[PATCH v1 16/21] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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/s390/pci/pci.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/s390/pci

[PATCH v1 18/21] IA64/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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/kernel/msi_ia64.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/ia64

[PATCH v1 06/21] PCI/MSI: Refactor struct msi_chip to make it become more common

2014-09-05 Thread Yijing Wang
. This patch add .restore_irq() and .setup_irqs() to make it become more common. Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 15 +++ include/linux/msi.h |3 +++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index

[PATCH v1 14/21] MIPS/Xlr/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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 | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/mips/pci

[PATCH v1 12/21] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error

2014-09-05 Thread Yijing Wang
nction 'destroy_irq'.. cc1: some warnings being treated as errors make[1]: *** [arch/mips/pci/msi-xlp.o] Error 1 make: *** [arch/mips/pci/] Error 2 Signed-off-by: Yijing Wang Cc: Thomas Gleixner --- arch/mips/pci/msi-xlp.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)

[PATCH v1 13/21] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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/msi-xlp.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/mips/pci/msi

[PATCH v1 19/21] Sparc/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel

[PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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/powerpc/kernel/msi.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc

[PATCH v1 20/21] tile/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-05 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/kernel/pci_gx.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/tile

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

2014-09-05 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 --- drivers/iommu/irq_remapping.c |2 +- drivers/pci/msi.c | 99 - include/linux/msi.h

[PATCH v1 01/21] PCI/MSI: Clean up struct msi_chip argument

2014-09-05 Thread Yijing Wang
Msi_chip functions setup_irq/teardown_irq rarely use msi_chip argument. We can look up msi_chip pointer by the device pointer or irq number, so clean up msi_chip argument. Signed-off-by: Yijing Wang CC: Thierry Reding CC: Thomas Petazzoni --- drivers/irqchip/irq-armada-370-xp.c | 12

[PATCH v1 02/21] PCI/MSI: Remove useless bus->msi assignment

2014-09-05 Thread Yijing Wang
Currently, PCI drivers will initialize bus->msi in pcibios_add_bus(). pcibios_add_bus() will be called in every pci bus initialization. So the bus->msi assignment in pci_alloc_child_bus() is useless. Signed-off-by: Yijing Wang CC: Thierry Reding CC: Thomas Petazzoni --- drivers/pci/p

Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-08 Thread Yijing Wang
On 2014/9/5 22:29, David Vrabel wrote: > On 05/09/14 11:09, 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. > [...] >> --- a/arch/x86/pci/xen.c >

Re: [Xen-devel] [PATCH v1 04/21] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()

2014-09-10 Thread Yijing Wang
On 2014/9/10 20:36, David Vrabel wrote: > On 05/09/14 11:09, Yijing Wang wrote: >> Commit 0e4ccb150 added two __weak arch functions arch_msix_mask_irq() >> and arch_msi_mask_irq() to fix a bug found when running xen in x86. >> Introduced these two funcntions make MSI code com

Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-10 Thread Yijing Wang
On 2014/9/10 20:38, David Vrabel wrote: > On 09/09/14 03:06, Yijing Wang wrote: >> On 2014/9/5 22:29, David Vrabel wrote: >>> On 05/09/14 11:09, Yijing Wang wrote: >>>> Use MSI chip framework instead of arch MSI functions to configure >>>> MSI/MSI-X irq. S

Re: [Xen-devel] [PATCH v1 08/21] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-10 Thread Yijing Wang
On 2014/9/10 22:59, Konrad Rzeszutek Wilk wrote: > On Wed, Sep 10, 2014 at 01:38:25PM +0100, David Vrabel wrote: >> On 09/09/14 03:06, Yijing Wang wrote: >>> On 2014/9/5 22:29, David Vrabel wrote: >>>> On 05/09/14 11:09, Yijing Wang wrote: >>>>> Use MSI

[PATCH] x86: irq_remapping: Make functions static

2014-09-12 Thread Yijing Wang
Change local functions to static. Signed-off-by: Yijing Wang --- arch/x86/include/asm/irq_remapping.h | 27 +-- drivers/iommu/irq_remapping.c| 34 +- 2 files changed, 18 insertions(+), 43 deletions(-) diff --git a/arch/x86

[PATCH] x86: irq_remapping: Fix the regression of hpet irq remapping

2014-09-12 Thread Yijing Wang
msi() setup_hpet_msi_remapped() intel_setup_hpet_msi() alloc_irte() Currently, we only alloc_irte() for hpet MSI, but have not composed and wrote its msg... Signed-off-by: Yijing Wang --- drivers/iommu/irq_remapping.c |9 -

Re: [PATCH] x86: irq_remapping: Make functions static

2014-09-12 Thread Yijing Wang
1/554 That's nice, I'm preparing to look at it. Joerg, please drop this trivial patch. Thanks! Yijing. > Regards! > Gerry > > On 2014/9/12 17:05, Yijing Wang wrote: >> Change local functions to static. >> >> Signed-off-by: Yiji

Re: [PATCH] x86: irq_remapping: Fix the regression of hpet irq remapping

2014-09-12 Thread Yijing Wang
On 2014/9/12 17:02, Jiang Liu wrote: > > > On 2014/9/12 17:05, Yijing Wang wrote: >> Commit 71054d8841b4 introduced x86_msi_ops.setup_hpet_msi >> to setup hpet MSI irq when irq remapping enabled. >> This caused a regression of hpet MSI irq remapping. >> &g

Re: [Patch Part3 V5 2/8] iommu/vt-d: Dynamically allocate and free seq_id for DMAR units

2014-09-12 Thread Yijing Wang
On 2014/9/12 10:10, Jiang Liu wrote: > Introduce functions to support dynamic IOMMU seq_id allocating and > releasing, which will be used to support DMAR hotplug. > > Also rename IOMMU_UNITS_SUPPORTED as DMAR_UNITS_SUPPORTED. Reviewed-by: Yijing Wang > > Signed

Re: [Patch Part3 V5 1/8] iommu/vt-d: Introduce helper function dmar_walk_resources()

2014-09-12 Thread Yijing Wang
On 2014/9/12 10:10, Jiang Liu wrote: > Introduce helper function dmar_walk_resources to walk resource entries > in DMAR table and ACPI buffer object returned by ACPI _DSM method > for IOMMU hot-plug. > > Signed-off-by: Jiang Liu Hi Gerry. some comments below. > --- > drivers/iommu/dmar.c

  1   2   3   >