[PATCH v10 26/29] PCI/xgene: Use pci_scan_root_bus() instead of pci_create_root_bus()

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

[PATCH v10 24/29] PCI/tegra: Remove redundant tegra_pcie_scan_bus()

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

[PATCH v10 28/29] PCI: Remove platform specific pci_domain_nr()

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

[PATCH v10 18/29] ia64/PCI: Refine pci_acpi_scan_root() with generic pci_host_bridge

2015-04-21 Thread Yijing Wang
From: Yijing Wang Signed-off-by: Yijing Wang CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org --- arch/ia64/pci/pci.c | 34 +++--- 1 files changed, 19 insertions(+), 15 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 84f1eb8

[PATCH v10 21/29] sparc/PCI: Use pci_scan_host_bridge() for simplicity

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

[PATCH v10 10/29] PCI: Introduce pci_host_bridge_list to manage host bridges

2015-04-21 Thread Yijing Wang
Introduce pci_host_bridge_list to manage pci host bridges in system, this make us have the ability to check whether the new host would conflict with existing one. Then we could remove bus alreay exist check in __pci_create_root_bus(). Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c

[PATCH v10 02/29] PCI: Remove deprecated pci_scan_bus_parented()

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

[PATCH v10 14/29] PCI: Introduce pci_host_bridge_ops to support host specific operations

2015-04-21 Thread Yijing Wang
: Yijing Wang --- drivers/pci/host-bridge.c |9 - drivers/pci/pci.h |3 ++- drivers/pci/probe.c |8 ++-- include/linux/pci.h |9 + 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host

[PATCH v10 11/29] PCI: Save sysdata in pci_host_bridge drvdata

2015-04-21 Thread Yijing Wang
Save platform specific sysdata in pci_host_bridge drvdata, host bridge specific operation need to access it before the pci bus creation. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |3 ++- drivers/pci/pci.h |2 +- drivers/pci/probe.c | 13 ++--- 3

[PATCH v10 13/29] PCI: Move pcibios_root_bridge_prepare() to pci_create_host_bridge()

2015-04-21 Thread Yijing Wang
Move pcibios_root_bridge_prepare() to pci_create_host_bridge(). Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c | 16 +--- drivers/pci/probe.c |3 --- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host

[PATCH v10 15/29] PCI: Introduce new scan function pci_scan_host_bridge()

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

[PATCH v10 16/29] PCI: Introduce pci_bus_child_max_busnr()

2015-04-21 Thread Yijing Wang
complete. But pci scan functions won't return the actual max bus number. So we could use pci_bus_child_max_busnr() to find that. Signed-off-by: Fengguang Wu Signed-off-by: Yijing Wang --- drivers/pci/hotplug/acpiphp_glue.c | 29 + drivers/pci/pci.c

[PATCH v10 00/29] Refine PCI scan interfaces and make generic pci host bridge

2015-04-21 Thread Yijing Wang
t and io/mem/bus resources but no platform specific pci_host_bridge operations 3. pci_scan_host_bridge() for callers provide its own parent and io/mem/bus resources Arnd Bergmann (1): xen/PCI: Don't use deprecated function pci_scan_bus_parented() Yijing Wang (28): PCI: Remov

[PATCH v10 09/29] PCI: Separate pci_host_bridge creation out of pci_create_root_bus()

2015-04-21 Thread Yijing Wang
This patch separate pci_host_bridge creation out of pci_create_root_bus(), and try to make a generic pci_host_bridge, then we could make it hold host bridge specific operations like pcibios_root_bridge_prepare(). The changes are transparent to platform host bridge drivers. Signed-off-by: Yijing

[PATCH v10 08/29] PCI: Introduce pci_host_assign_domain_nr() to assign domain

2015-04-21 Thread Yijing Wang
Introduce pci_host_assign_domain_nr() to assign domain number for pci_host_bridge. In the later patch, we would assign domain in pci_create_host_bridge, clean up the pci_bus_assign_domain_nr() and move this function into drivers/pci/host-bridge.c. Signed-off-by: Yijing Wang --- drivers/pci

[PATCH v10 05/29] PCI: Remove argument bus for pci_create_root_bus()

2015-04-21 Thread Yijing Wang
All pci_create_root_bus() callers have supplied busn resource, the argument bus is equal to busn_res->start, clean up the redundant argument bus for simplicity. Signed-off-by: Yijing Wang --- arch/ia64/pci/pci.c|3 +-- arch/powerpc/kernel/pci-common.c |2 +- arch/sp

[PATCH v10 03/29] PCI: Save domain in pci_host_bridge

2015-04-21 Thread Yijing Wang
, so we pass meaningless -1 as the domain number. 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/bios32.c |2 +- arch/arm/mach-dove/pcie.c

[PATCH v10 20/29] PCI: Remove pcibios_root_bridge_prepare() and pcibos_set_root_bus_speed()

2015-04-21 Thread Yijing Wang
Now no one use weak pcibios_root_bridge_prepare() and pcibios_set_root_bus_speed, we could clean up them. Signed-off-by: Yijing Wang --- drivers/pci/host-bridge.c |4 drivers/pci/probe.c | 18 +- include/linux/pci.h |2 -- 3 files changed, 1 insertions

[PATCH v10 25/29] PCI/designware: Use pci_scan_root_bus() for simplicity

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

[PATCH v10 19/29] powerpc/pci: Use pci_scan_host_bridge() for simplicity

2015-04-21 Thread Yijing Wang
Now we could use pci_scan_host_bridge() to scan pci buses, provide powerpc specific pci_host_bridge_ops. Tested-by: Daniel Axtens Signed-off-by: Yijing Wang Reviewed-by: Daniel Axtens CC: Benjamin Herrenschmidt CC: linuxppc-...@lists.ozlabs.org --- arch/powerpc/kernel/pci-common.c | 62

[PATCH v10 06/29] PCI: Alloc busn resource dynamically for pci_scan_bus()

2015-04-21 Thread Yijing Wang
resource instead of default global one, and add a flag to pci_host_bridge, so when pci_host_bridge go to free, the dynamic busn resource could also be freed properly. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 27 +++ include/linux/pci.h |1 + 2 files changed

[PATCH v10 12/29] powerpc/PCI: Rename pcibios_root_bridge_prepare() to pcibios_set_root_bus_speed()

2015-04-21 Thread Yijing Wang
d add pci_host_bridge_ops to do the same thing in later patch. Signed-off-by: Yijing Wang --- arch/powerpc/include/asm/machdep.h |2 +- arch/powerpc/kernel/pci-common.c |8 +++- arch/powerpc/platforms/pseries/pci.c |8 arch/powerpc/platforms/pseries/pser

[PATCH v10 07/29] PCI: Allocate busn resource for pci_scan_root_bus()

2015-04-21 Thread Yijing Wang
add it to pci_host_bridge, in the later patch, it would be easy to check whether new pci_host_bridge busn resource conflict. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 43 ++- 1 files changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/pci

[PATCH v10 04/29] PCI: Move pci_bus_assign_domain_nr() declaration into drivers/pci/pci.h

2015-04-21 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 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

[PATCH 0/1] IOMMU: Enhance IOMMU to support device hotplug

2013-11-05 Thread Yijing Wang
orporation 82801JIB (ICH10) LPC Interface Controller +-1f.2 Intel Corporation 82801JI (ICH10 Family) SATA AHCI Controller \-1f.3 Intel Corporation 82801JI (ICH10 Family) SMBus Controller Yijing Wang (1): IOMMU: Save pci device id instead of pci_dev* pointer for D

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); >&

Re: [PATCH v5 3/7] pci: Create pci_host_bridge before its associated bus in pci_create_root_bus.

2014-03-04 Thread Yijing Wang
On 2014/3/4 23:50, Liviu Dudau wrote: > Before commit 7b5436635800 the pci_host_bridge was created before the root > bus. > As that commit has added a needless dependency on the bus for > pci_alloc_host_bridge() > the creation order has been changed for no good reason. Revert the order of > creat

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

2014-03-03 Thread Yijing Wang
Hi list, I found a tasklet related issue in linux-stable-rt 3.4. And after I revert following commit, the test result seems ok(test lasted 40hours). commit 0d9f73fc1e7270a3f8709c59c913408153d9d9f8 Author: Ingo Molnar Date: Tue Nov 29 20:18:22 2011 -0500 tasklet: Prevent tasklets from

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

2014-02-10 Thread Yijing Wang
+ spin_lock_irqsave(&pci_freeze_lock, flags); + ops = pci_bus_set_ops(bus, &pci_dummy_ops); + bus->save_ops = ops; + spin_unlock_irqrestore(&pci_freeze_lock, flags); >>> >>> Against what exactly are you locking here? >> >> I want to use this spin lock to serialize freeze dev

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

2014-02-10 Thread Yijing Wang
On 2014/2/10 18:21, Oliver Neukum wrote: > > On Mon, 2014-02-10 at 12:04 +0800, Yijing Wang wrote: >> +static u64 pci_device_serial_number(struct pci_bus *bus, int devfn) >> +{ >> + int pos; >> + u32 lo, hi; >> + >> + if (!pci_bus_

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

2014-02-11 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 v6 1/7] PCI: rework pci_find_next_ext_capability()

2014-02-11 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 v6 2/7] PCI: introduce pci_bus_find_ext_capability()

2014-02-11 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 | 32 include/linux/pci.h |1 + 2 files

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

2014-02-11 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 v6 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-11 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 | 62

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

2014-02-11 Thread Yijing Wang
devices which support VPD SN cap report the meaningless same string "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_capab

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

2014-02-11 Thread Yijing Wang
eviewed-by: Gu Zheng Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas Cc: Paul Bolle Cc: Oliver Neukum Cc: Gu Zheng --- drivers/pci/pci.c | 30 ++ drivers/pci/pci.h |2 +- drivers/pci/probe.c |2 ++ include/linux/pci.h |1 + 4 files c

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

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

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

2014-02-11 Thread Yijing Wang
>> + * pci_serial_number_changed - check the device SN is changed > > How about the name “pci_device_changed”? I think it's more readable, > though the judgement is according to SN. Ah, it's nice, will update in next version. Thanks! Yijing. > > Regards, > Gu > >> + * @pdev: the PCI device >>

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

2014-02-12 Thread Yijing Wang
>> +void pci_bus_unfreeze_device(struct pci_bus *bus) >> +{ >> +unsigned long flags; >> + >> +BUG_ON(!bus->save_ops); >> +spin_lock_irqsave(&pci_freeze_lock, flags); >> +if (!bus->is_frozen) >> +goto out; > > It seems that the BUG_ON() should placed here, otherwise it w

Re: [PATCH] frv: replace now removed pci_bus_b() causing build failure

2014-02-20 Thread Yijing Wang
nstance of its usage was missed. > > Replace it in the same fashion that the original commit did. > > Cc: Yijing Wang > Cc: Bjorn Helgaas > Signed-off-by: Paul Gortmaker > --- > > [Note: commit ID referenced above is from linux-next and will > be invalid if the PCI

Re: [PATCH] clocksource: fix some comments typo in clocksource.c

2014-01-22 Thread Yijing Wang
On 2014/1/23 5:05, Thomas Gleixner wrote: > On Thu, 2 Jan 2014, Yijing Wang wrote: > >> Fix some trivial comments typo in kernel/time/clocksource.c > > That's not a typo. Thats a left over. The function simply cannot fail > anymore. So the subject of that patc

Re: [PATCH v4] ACPI: Fix acpi_evaluate_object() return value check

2014-01-22 Thread Yijing Wang
On 2014/1/23 5:37, Bjorn Helgaas wrote: > On Mon, Jan 20, 2014 at 7:46 PM, Yijing Wang wrote: >> Since acpi_evaluate_object() returns acpi_status and not plain int, >> ACPI_FAILURE() should be used for checking its return value. >> >> Reviewed-by: Jani Nikula &g

[PATCH v5] ACPI: Fix acpi_evaluate_object() return value check

2014-01-22 Thread Yijing Wang
Since acpi_evaluate_object() returns acpi_status and not plain int, ACPI_FAILURE() should be used for checking its return value. Also add some detailed debug info when acpi_evaluate_object() failed. Reviewed-by: Jani Nikula Acked-by: Bjorn Helgaas Signed-off-by: Yijing Wang --- v4->v5:

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

[PATCH] timekeeper: fix comment typo for tk_setup_internals()

2013-11-28 Thread Yijing Wang
Fix trivial comment typo for tk_setup_internals(). Signed-off-by: Yijing Wang --- kernel/time/timekeeping.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 3abf534..5c02cf9 100644 --- a/kernel/time

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: [3.11.4] Thunderbolt/PCI unplug oops in pci_pme_list_scan

2013-11-19 Thread Yijing Wang
>>> [bhelgaas: changelog, tag for stable] >>> Reported-by: David Bulkow >>> Reported-by: Mika Westerberg >>> Signed-off-by: Yinghai Lu >>> Signed-off-by: Bjorn Helgaas >>> CC: sta...@vger.kernel.org # v2.6.32+ >> >> Hi Bjorn, >>This issue in X86 seems to be introduced after commit 928bea9

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

2013-11-19 Thread Yijing Wang
On 2013/11/20 9:20, Bjorn Helgaas wrote: > On Tue, Nov 19, 2013 at 6:14 PM, Yijing Wang wrote: >>>>> [bhelgaas: changelog, tag for stable] >>>>> Reported-by: David Bulkow >>>>> Reported-by: Mika Westerberg >>>>> Signed-off-by

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

Re: [PATCH v2 3/6] powerpc/pci: use pci_is_pcie() to simplify code

2013-10-10 Thread Yijing Wang
On 2013/10/11 13:49, Benjamin Herrenschmidt wrote: > On Fri, 2013-09-06 at 14:30 -0600, Bjorn Helgaas wrote: >> On Thu, Sep 05, 2013 at 03:55:27PM +0800, Yijing Wang wrote: >>> Use pci_is_pcie() to simplify code. >>> >>> Acked-by: Kumar Gala >>> Revie

Re: [PATCH v2 3/6] powerpc/pci: use pci_is_pcie() to simplify code

2013-10-10 Thread Yijing Wang
On 2013/10/11 14:16, Gavin Shan wrote: > On Fri, Oct 11, 2013 at 04:49:56PM +1100, Benjamin Herrenschmidt wrote: >> On Fri, 2013-09-06 at 14:30 -0600, Bjorn Helgaas wrote: >>> On Thu, Sep 05, 2013 at 03:55:27PM +0800, Yijing Wang wrote: >>>> Use pci_is_pcie() to sim

Re: [PATCH v2 3/6] powerpc/pci: use pci_is_pcie() to simplify code

2013-10-11 Thread Yijing Wang
On 2013/10/11 14:53, Gavin Shan wrote: > On Fri, Oct 11, 2013 at 02:33:58PM +0800, Yijing Wang wrote: >> On 2013/10/11 14:16, Gavin Shan wrote: >>> On Fri, Oct 11, 2013 at 04:49:56PM +1100, Benjamin Herrenschmidt wrote: >>>> On Fri, 2013-09-06 at 14:30 -0600, Bjorn He

Re: [PATCH v2 3/6] powerpc/pci: use pci_is_pcie() to simplify code

2013-10-11 Thread Yijing Wang
>> In my idea, dev->pcie_cap(here is pci_dev->pcie_cap) will update in >> set_pcie_port_type() function, >> and this function always be called after allocate pci device. We get pci_dev >> by eeh_dev_to_pci_dev(), >> I think pci_dev has been initialized completely. >> >>> This function has possibi

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

2013-10-30 Thread Yijing Wang
>>> Bisection points to 928bea964827d7824b548c1f8e06eccbbc4d0d7d . >> >> This is "PCI: Delay enabling bridges until they're needed" by Yinghai. > > that double disabling should be addressed by: > > https://lkml.org/lkml/2013/4/25/608 > > [PATCH] PCI: Remove duplicate pci_disable_device for pcie

[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

Re: A simple question of a linux kernel beginner

2013-10-31 Thread Yijing Wang
On 2013/10/31 19:31, 韩磊 wrote: > May I can use the ''double" as a basic variables? > > When I define the "double" as a function return type in linux kernel,the error > is "error: SSE register return with SSE disabled". > > How to fix it?? no float in kernel! > -- > To unsubscribe from this li

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 -- Thanks! Yiji

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 -- To unsubscribe from this list: s

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

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

2013-12-16 Thread Yijing Wang
s to related maillist, some of them (David, Greg )has been accepted, and other is not. :) eg. http://article.gmane.org/gmane.linux.kernel/1608341/match=dev_is_pci Thanks! Yijing. > > On Thu, Dec 05, 2013 at 08:01:20PM +0800, Yijing Wang wrote: >> Use PCI standard marco dev_is_

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

2014-07-29 Thread Yijing Wang
On 2014/7/29 22:08, Arnd Bergmann wrote: > On Saturday 26 July 2014 11:08:37 Yijing Wang wrote: >> The series is a draft of generic MSI driver that supports PCI >> and Non-PCI device which have MSI capability. If you're not interested >> it, sorry for the noise.

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

2014-07-30 Thread Yijing Wang
On 2014/7/30 14:47, Jiang Liu wrote: > > > On 2014/7/30 10:45, Yijing Wang wrote: >> On 2014/7/29 22:08, Arnd Bergmann wrote: >>> On Saturday 26 July 2014 11:08:37 Yijing Wang wrote: >>>> The series is a draft of generic MSI driver that supports PCI &g

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

2014-09-18 Thread Yijing Wang
On 2014/9/19 13:18, 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 Reviewed-by: Yijing Wang > --- >

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

2014-09-18 Thread Yijing Wang
On 2014/9/19 13:18, Jiang Liu wrote: > Implement required callback functions for intel_irq_remapping driver > to support DMAR unit hotplug. > > Signed-off-by: Jiang Liu Reviewed-by: Yijing Wang > --- > drivers/iommu/intel_irq_remapping.c | 226 > +++

[PATCH v2] ACPI: Fix acpi_evaluate_object() return value check

2014-01-16 Thread Yijing Wang
Fix acpi_evaluate_object() return value check, shoud acpi_status not int. Signed-off-by: Yijing Wang --- v1->v2: Add CC to the related subsystem MAINTAINERS. --- drivers/gpu/drm/i915/intel_acpi.c | 13 +++-- drivers/gpu/drm/nouveau/core/subdev/mxm/base.c |

Re: [PATCH v2] ACPI: Fix acpi_evaluate_object() return value check

2014-01-16 Thread Yijing Wang
>> diff --git a/drivers/gpu/drm/i915/intel_acpi.c >> b/drivers/gpu/drm/i915/intel_acpi.c >> index dfff090..7ea00e5 100644 >> --- a/drivers/gpu/drm/i915/intel_acpi.c >> +++ b/drivers/gpu/drm/i915/intel_acpi.c >> @@ -35,7 +35,7 @@ static int intel_dsm(acpi_handle handle, int func) >> union acpi

[PATCH v3] ACPI: Fix acpi_evaluate_object() return value check

2014-01-16 Thread Yijing Wang
Fix acpi_evaluate_object() return value check, shoud acpi_status not int. Signed-off-by: Yijing Wang --- v2->v3: Fix compile error pointed out by Hanjun. v1->v2: Add CC to related subsystem MAINTAINERS --- drivers/gpu/drm/i915/intel_acpi.c | 24 ++-- d

[PATCH v4] ACPI: Fix acpi_evaluate_object() return value check

2014-01-20 Thread Yijing Wang
Since acpi_evaluate_object() returns acpi_status and not plain int, ACPI_FAILURE() should be used for checking its return value. Reviewed-by: Jani Nikula Signed-off-by: Yijing Wang --- v3->v4: Fix spell error, add Jani Nikula reviewed-by. v2->v3: Fix compile error pointed out by Hanjun.

[PATCH v2 18/22] arm/iop13xx/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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 v2 19/22] IA64/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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 v2 21/22] tile/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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 v2 20/22] Sparc/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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 v2 08/22] x86/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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 v2 05/22] s390/MSI: Use __msi_mask_irq() instead of default_msi_mask_irq()

2014-09-24 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 v2 22/22] PCI/MSI: Clean up unused MSI arch functions

2014-09-24 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 Reviewed-by: Lucas Stach --- drivers/iommu/irq_remapping.c |2 +- drivers/pci/msi.c | 100 +++- include

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

2014-09-24 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: Sebastian Ott --- arch/s390/pci/pci.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff

[PATCH v2 16/22] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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: Michael Ellerman --- arch/powerpc/kernel/msi.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions

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

2014-09-24 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 v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-24 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 5f8f3af..3acbe65 100644 --- a/drivers/pci/msi.c +++ b/driver

[PATCH v2 13/22] MIPS/Xlp: Remove the dead function destroy_irq() to fix build error

2014-09-24 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 v2 12/22] MIPS/Octeon/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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 v2 07/22] PCI/MSI: Refactor struct msi_chip to make it become more common

2014-09-24 Thread Yijing Wang
. This patch add .restore_irq() 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 |3 +++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/pci/msi.c b

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

2014-09-24 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 v2 01/22] PCI/MSI: Clean up struct msi_chip argument

2014-09-24 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 |8

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

2014-09-24 Thread Yijing Wang
et_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 (22): PCI/MSI: Clean up struct msi_chip argument PCI/MSI: Remove useless bus->msi assignment MSI: Remove the redundant irq_set_chip_data() x86

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

2014-09-24 Thread Yijing Wang
all platforms. Keep default_msi_mask_irq() and default_msix_mask_irq() in linux/msi.h to make s390 MSI code compile happy, they wiil be removed in the later patch. Tested-by: Konrad Rzeszutek Wilk Signed-off-by: Yijing Wang Acked-by: David Vrabel Reviewed-by: Konrad Rzeszutek Wilk CC: Konrad Rzeszu

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

2014-09-24 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 |5

[PATCH v2 11/22] x86/MSI: Remove unused MSI weak arch functions

2014-09-24 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 v2 02/22] PCI/MSI: Remove useless bus->msi assignment

2014-09-24 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

[PATCH v2 10/22] Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq

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

[PATCH v2 09/22] x86/xen/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-24 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. Tested-by: Konrad Rzeszutek Wilk Signed-off-by: Yijing Wang Acked-by: David Vrabel Reviewed-by: Konrad Rzeszutek Wilk CC: Konrad Rzeszutek Wilk --- arch

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