Re: [PATCH v2 02/22] PCI/MSI: Remove useless bus->msi assignment

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:06, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:12AM +0800, Yijing Wang wrote: >> Currently, PCI drivers will initialize bus->msi in >> pcibios_add_bus(). pcibios_add_bus() will be called >> in every pci bus initialization. So the b

Re: [PATCH v2 01/22] PCI/MSI: Clean up struct msi_chip argument

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:15, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:11AM +0800, Yijing Wang wrote: >> Msi_chip functions setup_irq/teardown_irq rarely use msi_chip >> argument. > > That's not true. Out of the four drivers that you modify two use the > para

Re: [PATCH v2 03/22] MSI: Remove the redundant irq_set_chip_data()

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:19, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:13AM +0800, Yijing Wang wrote: >> 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

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:26, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:16AM +0800, Yijing Wang wrote: >> Introduce weak arch_find_msi_chip() to find the match msi_chip. >> Currently, MSI chip associates pci bus to msi_chip. Because in >> ARM platform, there may be more th

Re: [PATCH v2 12/22] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:34, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:22AM +0800, Yijing Wang wrote: > [...] >> diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c > [...] >> @@ -132,12 +132,12 @@ msi_irq_allocated: >> /* Make sure the sear

Re: [PATCH v2 14/22] MIPS/Xlp/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:36, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:24AM +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. > > Nit: s/irq/IRQ/ in the ab

Re: [PATCH v2 15/22] MIPS/Xlr/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:37, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:25AM +0800, Yijing Wang wrote: > [...] >> diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c > [...] >> @@ -214,11 +214,11 @@ static int get_irq_vector(const struct pci_dev *dev)

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

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:38, Thierry Reding wrote: > On Thu, Sep 25, 2014 at 11:14:27AM +0800, Yijing Wang wrote: > [...] >> diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c > [...] >> @@ -358,7 +358,7 @@ static void zpci_irq_handler(struct airq_struct *airq) >>

Re: [PATCH v2 01/22] PCI/MSI: Clean up struct msi_chip argument

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:20, Thomas Gleixner wrote: > On Thu, 25 Sep 2014, Thierry Reding wrote: > >> On Thu, Sep 25, 2014 at 11:14:11AM +0800, Yijing Wang wrote: >>> Msi_chip functions setup_irq/teardown_irq rarely use msi_chip >>> argument. >> >> That's no

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:38, Thomas Gleixner wrote: > On Thu, 25 Sep 2014, Yijing Wang wrote: > >> Introduce weak arch_find_msi_chip() to find the match msi_chip. >> Currently, MSI chip associates pci bus to msi_chip. Because in >> ARM platform, there may be more than one

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:38, Thomas Gleixner wrote: > On Thu, 25 Sep 2014, Yijing Wang wrote: > >> Introduce weak arch_find_msi_chip() to find the match msi_chip. >> Currently, MSI chip associates pci bus to msi_chip. Because in >> ARM platform, there may be more than one

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Yijing Wang
On 2014/9/25 22:23, Konrad Rzeszutek Wilk wrote: > On Thu, Sep 25, 2014 at 11:14:10AM +0800, Yijing Wang wrote: >> This series is based Bjorn's pci/msi branch >> git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/msi > > Is there a git tree for these p

Re: [PATCH v2 04/22] x86/xen/MSI: Eliminate arch_msix_mask_irq() and arch_msi_mask_irq()

2014-09-25 Thread Yijing Wang
On 2014/9/25 22:33, Konrad Rzeszutek Wilk wrote: > On Thu, Sep 25, 2014 at 11:14:14AM +0800, 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 thes

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Yijing Wang
>> I am actually in disagreement with you, Thierry. I don't like the general >> direction >> of the patches, or at least I don't like the fact that we don't have a >> portable >> way of setting up the msi_chip without having to rely on weak architectural >> hooks. > > Oh, good. That's actually

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-25 Thread Yijing Wang
>> The PCI core can already deal with that. An MSI chip can be set per bus >> and the weak pcibios_add_bus() can be used to set that. Often it might >> not even be necessary to do it via pcibios_add_bus() if you create the >> root bus directly, since you can attach the MSI chip at that time. > > B

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

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-27 Thread Yijing Wang
What I would like to see is a way of creating the pci_host_bridge structure outside the pci_create_root_bus(). That would then allow us to pass this sort of platform details like associated msi_chip into the host bridge and the child busses will have an easy wa

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-27 Thread Yijing Wang
On 2014/9/26 17:05, Thierry Reding wrote: > On Fri, Sep 26, 2014 at 10:54:32AM +0200, Thierry Reding wrote: > [...] >> At least for Tegra it's trivial to just hook it up in tegra_pcie_scan_bus() >> directly (patch attached). > > Really attached this time. > > Thierry > It looks good to me, so I

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-27 Thread Yijing Wang
>> MSI chip in this series is to setup MSI irq, including IRQ allocation, Map, >> compose MSI msg ..., in different platform, many arch specific MSI irq >> details in it. >> It's difficult to extract the common data and code. >> >> I have a plan to rework MSI related irq_chips in kernel, PCI and N

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-27 Thread Yijing Wang
On 2014/9/28 10:32, Yijing Wang wrote: > On 2014/9/26 17:05, Thierry Reding wrote: >> On Fri, Sep 26, 2014 at 10:54:32AM +0200, Thierry Reding wrote: >> [...] >>> At least for Tegra it's trivial to just hook it up in tegra_pcie_scan_bus() >>> directly (patch

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-28 Thread Yijing Wang
On 2014/9/28 19:21, Liviu Dudau wrote: > On Sun, Sep 28, 2014 at 10:16:12AM +0800, Yijing Wang wrote: >>>>>> What I would like to see is a way of creating the pci_host_bridge >>>>>> structure outside >>>>>> the pci_create_root_bus(). That

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-29 Thread Yijing Wang
>>> Not necessarily. What I have in mind is something like this: >> >> This is a good idea, what I'm worried is this series is already large, so I >> think we need to post >> another series to do it. > > I wasn't asking to do it here, I was just offering a suggestion (and sharing > some experien

Re: [PATCH v2 00/22] Use MSI chip framework to configure MSI/MSI-X in all platforms

2014-09-29 Thread Yijing Wang
On 2014/9/29 16:37, Lucas Stach wrote: > Am Sonntag, den 28.09.2014, 14:11 +0800 schrieb Yijing Wang: >> On 2014/9/28 10:32, Yijing Wang wrote: >>> On 2014/9/26 17:05, Thierry Reding wrote: >>>> On Fri, Sep 26, 2014 at 10:54:32AM +0200, Thierry Reding wrote: >&

Re: [Patch Part3 V5 3/8] iommu/vt-d: Implement DMAR unit hotplug framework

2014-09-14 Thread Yijing Wang
method for > DMAR unit hotplug. It also implements state machines for DMAR unit > hot-addition and hot-removal. > > The PCI host bridge hotplug driver should call dmar_hotplug_hotplug() > before scanning PCI devices connected for hot-addition and after > destroying all PCI dev

Re: [Patch Part3 V5 4/8] iommu/vt-d: Search for ACPI _DSM method for DMAR hotplug

2014-09-14 Thread Yijing Wang
subtree starting from the > ACPI object representing the PCI host bridge. Reviewed-by: Yijing Wang > > Signed-off-by: Jiang Liu > --- > drivers/iommu/dmar.c | 35 +++ > 1 file changed, 31 insertions(+), 4 deletions(-) > > diff --git a/dr

Re: [Patch Part3 V5 5/8] iommu/vt-d: Enhance intel_irq_remapping driver to support DMAR unit hotplug

2014-09-14 Thread Yijing Wang
> +static void ir_remove_ioapic_hpet_scope(struct intel_iommu *iommu) > +{ > + int i; > > - ir_parse_one_hpet_scope(scope, iommu); > - } > - start += scope->length; > - } > + for (i = 0; i < MAX_HPET_TBS; i++) > + if (ir_hpet[i].

Re: [Patch Part3 V5 6/8] iommu/vt-d: Enhance error recovery in function intel_enable_irq_remapping()

2014-09-14 Thread Yijing Wang
gt;ecap)) { > + iommu_disable_irq_remapping(iommu); > + intel_teardown_irq_remapping(iommu); > + } > > if (x2apic_present) > pr_warn("Failed to enable irq remapping. You are vulnerable to > irq-injection

Re: [Patch Part3 V5 7/8] iommu/vt-d: Enhance intel-iommu driver to support DMAR unit hotplug

2014-09-14 Thread Yijing Wang
On 2014/9/12 10:10, Jiang Liu wrote: > Implement required callback functions for intel-iommu driver > to support DMAR unit hotplug. > Reviewed-by: Yijing Wang > Signed-off-by: Jiang Liu > --- > drivers/iommu/intel-iommu.c | 206 > +++-

Re: [Patch Part3 V5 8/8] pci, ACPI, iommu: Enhance pci_root to support DMAR device hotplug

2014-09-14 Thread Yijing Wang
On 2014/9/12 10:10, Jiang Liu wrote: > Finally enhance pci_root driver to support DMAR device hotplug when > hot-plugging PCI host bridges. Reviewed-by: Yijing Wang > > Signed-off-by: Jiang Liu > --- > drivers/acpi/pci_root.c | 16 ++-- > 1 file changed

Re: [Patch Part3 V5 0/8] Enable support of Intel DMAR device hotplug

2014-09-15 Thread Yijing Wang
I built and boot this series in Huawei RH5885 (Intel(R) Xeon(R) CPU E7- 4807, two IOHs and two IOMMUs), It works fine, IRQ remap and DMA remap are both look good. But because my platform BIOS has no _DSM, so I didn't test the hotplug case yet. Thanks! Yijing. On 2014/9/12 10:10, Jiang Liu wrote

Re: [Patch Part3 V5 5/8] iommu/vt-d: Enhance intel_irq_remapping driver to support DMAR unit hotplug

2014-09-16 Thread Yijing Wang
On 2014/9/16 15:00, Jiang Liu wrote: > On 2014/9/15 10:20, Yijing Wang wrote: >>> +static void ir_remove_ioapic_hpet_scope(struct intel_iommu *iommu) >>> +{ >>> + int i; >>> >>> - ir_parse_one_hpet_scope(scope, iommu); >>

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

2014-09-16 Thread Yijing Wang
>>> #include "irq_remapping.h" >>> >>> +typedef int (*dmar_res_handler_t)(struct acpi_dmar_header *, void *); >>> +struct dmar_res_callback { >>> + dmar_res_handler_t cb[ACPI_DMAR_TYPE_RESERVED]; >>> + void*arg[ACPI_DMAR_TYPE_RESERVED]; >>> + bool

[PATCH 06/13] powerpc/PCI: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- arch/powerpc/kernel/pci-hotplug.c |3 +-- arch/powerpc/kernel/pci_of_scan.c |3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/pci-hotplug.c b

[PATCH 10/13] PCI, cpcihp: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- drivers/pci/hotplug/cpci_hotplug_pci.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c

[PATCH 11/13] PCI, acpiphp: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- drivers/pci/hotplug/acpiphp_glue.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index

[PATCH 13/13] PCI, pciehp: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- drivers/pci/hotplug/pciehp_pci.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index 1b53306

[PATCH 05/13] IA64/PCI: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- arch/ia64/pci/fixup.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index eee069a..1fe9aa5 100644 --- a/arch/ia64/pci

[PATCH 09/13] PCI, shpchp: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- drivers/pci/hotplug/shpchp_pci.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c index 2bf69fe

[PATCH 03/13] PCI: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- drivers/pci/pci-acpi.c |8 +--- drivers/pci/probe.c |3 +-- drivers/pci/setup-bus.c |4 +--- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/pci/pci

[PATCH 01/13] PCI: rename pci_is_bridge() to pci_has_subordinate()

2014-04-25 Thread Yijing Wang
to pci_has_subordinate(). Signed-off-by: Yijing Wang --- drivers/pci/pci-driver.c |8 drivers/pci/pci.h|2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index d911e0c..b7850cb 100644 --- a/drivers/pci

[PATCH 07/13] sparc/PCI: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. 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 b/arch/sparc/kernel/pci.c index 1555bbc..857ad77 100644 --- a/arch/sparc

[PATCH 12/13] PCI, pcmcia: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- drivers/pcmcia/cardbus.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 8bde619..4fe4cc4 100644 --- a/drivers

[PATCH 00/13] Refactor pci_is_brdige() to simplify code

2014-04-25 Thread Yijing Wang
This patchset rename the current pci_is_bridge() to pci_has_subordinate(), and introduce a new pci_is_bridge() which determine pci bridge by check dev->hdr_type. The new one is more accurate. PCIe Spec define the pci device is a bridge by the dev->hdr_type = 0x01 || 0x02. Yijing Wang (13):

[PATCH 02/13] PCI: Introduce new pci_is_bridge() helper function

2014-04-25 Thread Yijing Wang
PCIe Spec define the PCI bridge is the PCI device which header type(bit 0 through 6) is 0x1(PCI bridge) or 0x2(CardBus bridge). Signed-off-by: Yijing Wang --- include/linux/pci.h |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/linux/pci.h b/include/linux

[PATCH 08/13] PCI, rpaphp: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- drivers/pci/hotplug/rpadlpar_core.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index

[PATCH 04/13] x86/PCI: Use new pci_is_bridge() to simplify code

2014-04-25 Thread Yijing Wang
Now we can use new pci_is_bridge() helper function to simplify code. Signed-off-by: Yijing Wang --- arch/x86/pci/fixup.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 94ae9ae..e5f000c 100644 --- a/arch/x86/pci

Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code

2014-04-25 Thread Yijing Wang
On 2014/4/25 17:42, David Laight wrote: > From: Yijing Wang >> This patchset rename the current pci_is_bridge() to pci_has_subordinate(), >> and introduce a new pci_is_bridge() which determine pci bridge by check >> dev->hdr_type. The new one is more accurate. PCIe Spec def

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

Re: [PATCH] IA64, sba_iommu: fix section mismatch

2014-02-16 Thread Yijing Wang
> -static int __init > +static int > acpi_sba_ioc_add(struct acpi_device *device, >const struct acpi_device_id *not_used) > { > Hi Gerry, ioc_init() and sba_map_ioc_to_node() in this function seems also have the __init annotate. -- Thanks! Yijing -- To unsubscribe from t

Re: [PATCH part1 v6 0/7] Introduce PCIe Device Serial Number capability support

2014-02-17 Thread Yijing Wang
Hi Bjorn, Sorry to bother you, any comment about this series? Thanks! Yijing. On 2014/2/12 10:52, Yijing Wang wrote: > v5->v6: Add is_frozen flag to protect pci bus from double frozen. > > This series is based on Bjorn's pci-next branch. > Currently, more and more PCIe

Re: [PATCH] arm64: Add architecture support for PCI

2014-02-17 Thread Yijing Wang
> +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > + > +/* > + * Return the domain number for this bus > + */ > +int pci_domain_nr(struct pci_bus *bus) > +{ > + struct pci_host_bridge *bridge = to_pci_host_bridge(bus->bridge); Here

Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code

2014-05-03 Thread Yijing Wang
e, even if there is no subordinate bus. When do we even > have a bridge with no subordinate bus? This is the sort of stuff you > need to explain so we know why we should apply these patches. > Hi Bjorn, sorry forgot to cc pci list, will resend the v2 patchset with some new descriptio

[RFC PATCH 01/11] PCI/MSI: Use pci_dev->msi_cap instead of msi_desc->msi_attrib.pos

2014-07-25 Thread Yijing Wang
PCI devices save the msi and msix capability offset in pci_dev->msi_cap and pci_dev->msix_cap. When we access PCI device MSI and MSIX registers, we can use msi_cap and msix_cap in pci_dev directly. Remove the pos member in msi_attrib. Signed-off-by: Yijing Wang --- arch/mips/pci/msi-oc

[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver

2014-07-25 Thread Yijing Wang
Use struct msi_ops to hook PCI MSI operations, and use struct msi_irqs to refactor PCI MSI drvier. Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 351 ++- include/linux/msi.h | 14 +- include/linux/pci.h | 11 +- 3 files changed, 222

[RFC PATCH 07/11] PCI/MSI: Mask MSI-X entry in msix_setup_entries()

2014-07-25 Thread Yijing Wang
Save the MSI-X entry initial mask status in msix_setup_entries(), also mask the entry. This is preparation for generic MSI. Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 21 +++-- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/pci/msi.c b/drivers

[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file

2014-07-25 Thread Yijing Wang
and used to translate legacy interrupt to MSI. So for support Non-PCI MSI device, generic MSI driver is needed. Split the generic MSI code into new location, drivers/msi/msi.c. Then MSI driver does not depend PCI anymore. Signed-off-by: Yijing Wang --- drivers/Kconfig |1 + drivers

[RFC PATCH 11/11] x86/MSI: Refactor x86 MSI code

2014-07-25 Thread Yijing Wang
Signed-off-by: Yijing Wang --- arch/x86/include/asm/io_apic.h |2 +- arch/x86/include/asm/irq_remapping.h |4 +- arch/x86/include/asm/pci.h |6 ++-- arch/x86/include/asm/x86_init.h | 10 +++--- arch/x86/kernel/apic/io_apic.c | 23 +++ arch

[RFC PATCH 08/11] PCI/MSI: Introduce new struct msi_irqs and struct msi_ops

2014-07-25 Thread Yijing Wang
: Yijing Wang --- include/linux/msi.h | 30 +- include/linux/pci.h |7 +-- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/include/linux/msi.h b/include/linux/msi.h index 3ad8416..5a672d3 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h

[RFC PATCH 03/11] PCI/MSI: Refactor pci_dev_msi_enabled()

2014-07-25 Thread Yijing Wang
Pci_dev_msi_enabled() is used to check whether device MSI/MSIX enabled. Refactor this function to suuport checking only device MSI or MSIX enabled. Signed-off-by: Yijing Wang --- arch/cris/arch-v32/drivers/pci/bios.c |2 +- arch/frv/mb93090-mb00/pci-vdk.c |2 +- arch/ia64

[RFC PATCH 05/11] PCI/MSI: Move populate_msi_sysfs() out of msi_capability_init()

2014-07-25 Thread Yijing Wang
Because some Non-PCI devices don't need to create sysfs object, so move populate_msi_sysfs() out of generic MSI function msi/x_capability_init(). Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 31 ++- 1 files changed, 18 insertions(+), 13 deletions(-)

[RFC PATCH 02/11] PCI/MSI: Use new MSI type macro instead of PCI MSI flags

2014-07-25 Thread Yijing Wang
Add new MSI type marco(MSI_TYPE and MSIX_TYPE) to support the future generic MSI driver. The coming generic MSI driver will be used by PCI and Non-PCI devices that have MSI capability. Signed-off-by: Yijing Wang --- arch/mips/pci/msi-octeon.c |4 ++-- arch/powerpc/kernel/msi.c

[RFC PATCH 04/11] PCI/MSI: Move MSIX table address mapping out of msix_capability_init

2014-07-25 Thread Yijing Wang
MSI drvier. Suggested-by: Yun Wu Signed-off-by: Yijing Wang --- drivers/pci/msi.c | 25 + 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index d5c8e56..116383c 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c

[RFC PATCH 00/11] Refactor MSI to support Non-PCI device

2014-07-25 Thread Yijing Wang
This series only did compile test, we will test it in x86 and arm platform later. Any comments are welcome. Thanks! Yijing. Yijing Wang (11): PCI/MSI: Use pci_dev->msi_cap instead of msi_desc->msi_attrib.pos PCI/MSI: Use new MSI type macro instead of PCI MSI flags PCI/MS

[RFC PATCH 06/11] PCI/MSI: Save MSI irq in PCI MSI layer

2014-07-25 Thread Yijing Wang
Save MSI irq in PCI MSI layer, this is preparation for generic MSI. Signed-off-by: Yijing Wang --- drivers/pci/msi.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 21b16e0..f96dd38 100644 --- a/drivers/pci/msi.c +++ b

Re: [PATCH 2/2] PCI/MSI: Remove arch_msi_check_device()

2014-07-13 Thread Yijing Wang
> /** > - * pci_msi_check_device - check whether MSI may be enabled on a device > + * msi_check_device - check whether MSI may be enabled on a device > * @dev: pointer to the pci_dev data structure of MSI device function > * @nvec: how many MSIs have been requested ? > - * @type: are we checki

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:

Re: [PATCH 3.4 214/214] HID: logitech: dont use stack based dj_report structures

2014-06-05 Thread Yijing Wang
>> - dj_report.report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES; >> - return logi_dj_recv_send_report(djrcv_dev, &dj_report); >> + dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL); > > This patch was unfortunately incorrect as is - it needs to allocate > sizeof(struct dj_report

Re: [PATCH 3.4 47/88] mm: add kmap_to_page()

2014-06-10 Thread Yijing Wang
>> +struct page *kmap_to_page(void *vaddr) >> +{ >> +unsigned long addr = (unsigned long)vaddr; >> + >> +if (addr >= PKMAP_ADDR(0) && addr <= PKMAP_ADDR(LAST_PKMAP)) { >> +int i = (addr - PKMAP_ADDR(0)) >> PAGE_SHIFT; >> +return pte_page(pkmap_page_table[i]); >> +

NTB driver support in haswell platform?

2014-06-11 Thread Yijing Wang
Hi Jon, I have a Intel Haswell platform in hand, and our team want to use NTB in this platform. I checked the current intel NTB driver in Linux kernel, I found the Haswell NTB pci device id is not contained in ntb_pci_tbl[]. I want to know whether current kernel ntb driver can support the ntb

Re: NTB driver support in haswell platform?

2014-06-11 Thread Yijing Wang
Hi Jon, Thanks for your detailed explanation. Now I have a clearer understanding of it. Thanks! :) Yijing. On 2014/6/12 1:18, Jon Mason wrote: > On Wed, Jun 11, 2014 at 05:03:38PM +0800, Yijing Wang wrote: >> Hi Jon, >>I have a Intel Haswell platform in hand, and our team wan

Re: [BUGREPORT] Tasklet scheduled issue in Linux 3.4.x-rt

2014-03-28 Thread Yijing Wang
On 2014/3/29 0:37, Sebastian Andrzej Siewior wrote: > * Yijing Wang | 2014-03-03 17:24:39 [+0800]: > >> [2012-03-26 18:55:43][ 929.252312] WARNING: at kernel/softirq.c:773 >> __tasklet_action+0x51/0x1a0() >> [2012-03-27 03:41:06][ 3647.886005] WARNING: at kernel/softirq.c:7

Re: [BUGREPORT] Tasklet scheduled issue in Linux 3.4.x-rt

2014-03-31 Thread Yijing Wang
>> Because this patch does not exist in the latest Linus kernel, so I >> have not reported this issue to kernel bugzilla. > > This patch exists in all -RT releases up to 3.12. If there is an issue > with it, it should be solved. > > If the sched bit set is and you can't get lock later then the ta

Re: [BUGREPORT] Tasklet scheduled issue in Linux 3.4.x-rt

2014-03-31 Thread Yijing Wang
Hi Thomas, Thanks for your reply! >> nf_defrag_ipv4 xt_state nf_conntrack usr_cache(O) acpi_cpufreq mperf >> processor thermal_sys sg hwmon iptable_filter ip_tables x_tables ixgbe(O) >> igb(O) bonding(O) tg(O) netmgmt(O) drvinstall(PO) dal(PO) dca usb_storage(O) >> uhci_hcd ehci_hcd usbcor

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 1/9] PCI: Use dev_is_pci() to check whether it is pci device

2013-12-09 Thread Yijing Wang
On 2013/12/10 8:01, Bjorn Helgaas wrote: > [+cc arch lists] > > On Thu, Dec 05, 2013 at 07:52:53PM +0800, Yijing Wang wrote: >> Use dev_is_pci() instead of directly compare >> pci_bus_type to check whether it is pci device. >> >> Signed-off-by: Yijing Wang &

Re: [PATCH v4 20/28] x86, irq: More strict checking about registering ioapic

2013-10-21 Thread Yijing Wang
> int mp_find_ioapic_pin(int ioapic, u32 gsi) > { > struct mp_ioapic_gsi *gsi_cfg; > @@ -3888,6 +3894,11 @@ void __init mp_register_ioapic(int id, u32 address, > u32 gsi_base) > if (bad_ioapic(address)) > return; > > + /* already registered ? */ > + idx = __mp

Re: [PATCH v4 27/28] PCI, x86, ACPI: Enable ioapic hotplug support with acpi host bridge.

2013-10-21 Thread Yijing Wang
> diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c > index 5917839..7577175 100644 > --- a/drivers/acpi/pci_root.c > +++ b/drivers/acpi/pci_root.c > @@ -532,6 +532,8 @@ static int acpi_pci_root_add(struct acpi_device *device, > pci_enable_bridges(root->bus); > } H

Re: [3.11.4] Thunderbolt/PCI unplug oops in pci_pme_list_scan

2013-11-18 Thread Yijing Wang
> The pcie_portdrv .probe() method calls pci_enable_device() once, in > pcie_port_device_register(), but the .remove() method calls > pci_disable_device() twice, in pcie_port_device_remove() and in > pcie_portdrv_remove(). > > That causes a "disabling already-disabled device" warning when removing

[Update][PATCH 1/2] clocksource: Remove outdated comments

2014-02-09 Thread Yijing Wang
clocksource_register() and __clocksource_register_scale() always return 0, so the comment is just pointless, it's outdated, remove it. Signed-off-by: Yijing Wang --- kernel/time/clocksource.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/kernel/time/clocksourc

[Update][PATCH 2/2] clocksource: Make clocksource register functions void

2014-02-09 Thread Yijing Wang
Currently, clocksource_register() and __clocksource_register_scale() functions always return 0, it's pointless, make functions void. And remove the dead code that check the clocksource_register_hz() return value. Acked-by: Hans-Christian Egtvedt Acked-by: Tony Prisk Signed-off-by: Yijing

[PATCH part1 v5 7/7] PCI: pciehp: Don't enable/disable slot on resume unless status changed

2014-02-09 Thread Yijing Wang
to do anything. [bhelgaas: changelog] Tested-by: Paul Bolle Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas Cc: "Rafael J. Wysocki" Cc: Oliver Neukum Cc: Gu Zheng --- drivers/pci/hotplug/pciehp_core.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --gi

[PATCH part1 v5 3/7] PCI: Add support for Device Serial Number capability

2014-02-09 Thread Yijing Wang
eviewed-by: Gu Zheng Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas Cc: Paul Bolle Cc: "Rafael J. Wysocki" Cc: Oliver Neukum Cc: Gu Zheng --- drivers/pci/pci.c | 30 ++ drivers/pci/pci.h |2 +- drivers/pci/probe.c |2 ++ includ

[PATCH part1 v5 4/7] PCI: Introduce pci_serial_number_changed()

2014-02-09 Thread Yijing Wang
Sometimes OS do not know the physical device swap, for instance, some device hotplug during system suspend. Interrupt can not deliver to OS in some platform. So we can use pci serial number capability to detect this issue if device supports serial number. Signed-off-by: Yijing Wang Cc: Paul

[PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-09 Thread Yijing Wang
Pci_dummy_ops does nothing when we use it to read/write pci_device. So we can isolate pci device by replace its bus pci_ops by pci_dummy_ops. This is preparation for the later patch. Signed-off-by: Yijing Wang --- drivers/pci/pci.c | 54

[PATCH part1 v5 2/7] PCI: introduce pci_bus_find_ext_capability()

2014-02-09 Thread Yijing Wang
Sometimes we need to find PCI EXT CAP before pci_dev set up. So introduce pci_bus_find_ext_capability(), it will be used to get PCI EXT DSN before pci_dev set up. Signed-off-by: Yijing Wang --- drivers/pci/pci.c | 31 +++ include/linux/pci.h |1 + 2 files

[PATCH part1 v5 6/7] PCI: Check pci device serial number when scan device

2014-02-09 Thread Yijing Wang
: Yijing Wang --- drivers/pci/probe.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 27d3e6f..370b25c 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1383,11 +1383,22 @@ void pci_device_add(struct

[PATCH part1 v5 1/7] PCI: rework pci_find_next_ext_capability()

2014-02-09 Thread Yijing Wang
Rework pci_find_next_ext_capability(), use pci_bus_read_config_xxx() instead of pci_read_config_xxx(). So we can use this function before pci_dev setup. Signed-off-by: Yijing Wang --- drivers/pci/pci.c | 17 + include/linux/pci.h |2 +- 2 files changed, 10 insertions

[PATCH part1 v5 0/7] Introduce PCIe Device Serial Number capability support

2014-02-09 Thread Yijing Wang
tring "0123456789". Rework PCI VPD code to support device identification is not an easy work. Plan to do it in part2. Yijing Wang (7): PCI: rework pci_find_next_ext_capability() PCI: introduce pci_bus_find_ext_capability() PCI: Add support for Device Serial Number capability

Re: [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-10 Thread Yijing Wang
Hi Oliver, Thanks for your review and comments! >> +static DEFINE_SPINLOCK(pci_freeze_lock); > > The lock is used only here. Also be used in pci_bus_unfreeze_device(); > >> +/** >> + * pci_bus_freeze_device - freeze pci bus to access pci device >> + * @bus: the pci bus to freeze >> + * >> +

Re: [PATCH v2 2/4] pciehp: Use link change notifications for hot-plug and removal

2013-12-05 Thread Yijing Wang
On 2013/12/4 6:32, Rajat Jain wrote: > A lot of systems do not have the fancy buttons and LEDs, and instead > want to rely only on the Link state change events to drive the hotplug > and removal state machinery. > (http://www.spinics.net/lists/hotplug/msg05802.html) > > This patch adds support for

[PATCH 1/2] usb: 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/usb/host/ehci-dbg.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host

[PATCH 2/2] uwb: 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/uwb/umc-bus.c |2 +- include/linux/uwb/umc.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/uwb/umc

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