aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci
AgeCommit message (Collapse)AuthorFilesLines
2013-10-17Merge tag 'drivers-3.13-2' of git://git.infradead.org/linux-mvebu into ↵Kevin Hilman1-59/+69
next/drivers From Jason Cooper: mvebu driver changes for v3.13 (round 2) - mvebu - pcie - dynamic link up detection - add IO wrappers - declare some local functions static * tag 'drivers-3.13-2' of git://git.infradead.org/linux-mvebu: PCI: mvebu: make local functions static PCI: mvebu: add I/O access wrappers PCI: mvebu: Dynamically detect if the PEX link is up to enable hot plug Signed-off-by: Kevin Hilman <[email protected]>
2013-10-12ACPI / hotplug / PCI: Drop WARN_ON() from acpiphp_enumerate_slots()Rafael J. Wysocki1-3/+4
The WARN_ON() in acpiphp_enumerate_slots() triggers unnecessarily for devices whose bridges are going to be handled by native PCIe hotplug (pciehp) and the simplest way to prevent that from happening is to drop the WARN_ON(). References: https://bugzilla.kernel.org/show_bug.cgi?id=62831 Reported-by: Steven Rostedt <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2013-10-12ACPI / hotplug / PCI: Fix error code path in acpiphp_enumerate_slots()Rafael J. Wysocki1-0/+1
One of the error code paths in acpiphp_enumerate_slots() is missing a pci_dev_put(bridge->pci_dev) call, so add it. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Bjorn Helgaas <[email protected]>
2013-10-09Merge tag 'drivers-3.13' of git://git.infradead.org/linux-mvebu into ↵Kevin Hilman2-35/+88
next/drivers From Jason Cooper: mvebu drivers changes for v3.13 - irqchip - add MSI support for armada-370/XP - pci - add MSI support - add support for Marvell Dove SoCs - mvebu (soc changes depending on the pci and irq changes) - probe mbus windows via DT - probe pcie and clock via DT - docs for mvebu - update gated clock documentation * tag 'drivers-3.13' of git://git.infradead.org/linux-mvebu: ARM: mvebu: fix gated clock documentation ARM: dove: remove legacy pcie and clock init ARM: dove: switch to DT probed mbus address windows PCI: mvebu: add support for Marvell Dove SoCs PCI: mvebu: add support for reset on GPIO PCI: mvebu: remove subsys_initcall PCI: mvebu: increment nports only for registered ports PCI: mvebu: move clock enable before register access PCI: mvebu: add support for MSI irqchip: armada-370-xp: implement MSI support irqchip: armada-370-xp: properly request resources Signed-off-by: Kevin Hilman <[email protected]>
2013-10-09PCI: designware: Add irq_create_mapping()Pratyush Anand2-13/+14
Without irq_create_mapping(), the correct IRQ number cannot be provided. In this case, it makes problems such as NULL dereference. Thus, irq_create_mapping() should be added for MSI. Suggested-by: Kishon Vijay Abraham I <[email protected]> Signed-off-by: Pratyush Anand <[email protected]> Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-10-09PCI: designware: Make dw_pcie_rd_own_conf(), etc., staticBjorn Helgaas2-15/+8
The following variables and functions are used only in pcie-designware.c, so make them static: global_io_offset dw_pcie_rd_own_conf() dw_pcie_wr_own_conf() dw_pcie_setup() dw_pcie_scan_bus() dw_pcie_map_irq() Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Jingoo Han <[email protected]>
2013-10-09PCI: designware: Add header guardsSeungwon Jeon1-0/+5
Add header guards to prevent redundant inclusion. Signed-off-by: Seungwon Jeon <[email protected]> Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-10-08PCI: mvebu: make local functions staticJingoo Han1-6/+6
mvebu_pcie_add_bus(), mvebu_pcie_align_resource() are used only in this file. Thus, these local functions should be staticized in order to fix the following sparse warnings: drivers/pci/host/pci-mvebu.c:684:6: warning: symbol 'mvebu_pcie_add_bus' was not declared. Should it be static? drivers/pci/host/pci-mvebu.c:690:17: warning: symbol 'mvebu_pcie_align_resource' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Acked-by: Thomas Petazzoni <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-10-08PCI: mvebu: add I/O access wrappersSeungwon Jeon1-42/+55
This change adds wrapper functions for MMIO access to PCIe IP block. And some 8/16-bit access are replaced by 32-bit. Signed-off-by: Seungwon Jeon <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-10-08PCI: mvebu: Dynamically detect if the PEX link is up to enable hot plugJason Gunthorpe1-11/+8
Otherwise hotplugging the PEX doesn't work at all since the driver detects the link state at probe time. Simply replacing the two tests of haslink with a register read is enough to fix it. Tested on kirkwood with repeated plug/unplug of the link partner. Signed-off-by: Jason Gunthorpe <[email protected]> Acked-by: Thomas Petazzoni <[email protected]> Tested-by: Thomas Petazzoni <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-10-07PCI/PM: Remove pci_pm_complete()Liu Chuansheng1-9/+0
88d26136 ("PM: Prevent runtime suspend during system resume") removed the pm_runtime_put_sync() from pci_pm_complete() to PM core code device_complete(). Here the pci_pm_complete() is doing the same work which can be done in device_complete(), so we can remove it directly. Signed-off-by: Liu Chuansheng <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]>
2013-10-07PCI: Add pci_dev_show_local_cpu() to simplify codeYijing Wang1-17/+15
local_cpus_show() and local_cpulist_show() are almost the same. This adds a new helper function, pci_dev_show_local_cpu(), to simplify code. The same strategy is already used by cpuaffinity_show() and cpulistaffinity_show(). Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-10-07PCI: Make pci_dev_pm_ops staticSachin Kamat1-1/+1
pci_dev_pm_ops is local to pci-driver.c. Make it static. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-10-07PCI: Make pci_bus_attrs, pci_dev_attrs, dev_rescan_attr, dev_remove_attr, ↵Sachin Kamat1-7/+9
vga_attr static Local variables used only in this file are made static. [bhelgaas: also make pci_dev_attrs[] static (from Fengguang)] Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-10-07PCI: convert bus code to use dev_groupsGreg Kroah-Hartman3-29/+48
The dev_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the PCI bus code to use the correct field. Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-10-07PCI: convert bus code to use drv_groupsGreg Kroah-Hartman1-5/+8
The drv_attrs field of struct bus_type is going away soon, drv_groups should be used instead. This converts the PCI bus code to use the correct field. Cc: Bjorn Helgaas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-07PCI: convert bus code to use bus_groupsGreg Kroah-Hartman3-5/+15
The bus_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the PCI bus code to use the correct field. Cc: Bjorn Helgaas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-04PCI: exynos: Add missing clk_disable_unprepare() on error pathWei Yongjun1-6/+12
Add the missing clk_disable_unprepare() before return from exynos_pcie_probe() in the error handling case. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Jingoo Han <[email protected]>
2013-09-30PCI: mvebu: add support for Marvell Dove SoCsSebastian Hesselbarth2-1/+2
This patch adds a compatible for the PCIe controller found on Marvell Dove SoCs. Binding documentation and Kconfig entry are also updated. Signed-off-by: Sebastian Hesselbarth <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-09-30PCI: mvebu: add support for reset on GPIOSebastian Hesselbarth1-1/+32
This patch adds a check for DT passed reset-gpios property and deasserts/ asserts reset pin on probe/remove with configurable delay. Corresponding binding documentation is also updated. Signed-off-by: Sebastian Hesselbarth <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-09-30PCI: mvebu: remove subsys_initcallSebastian Hesselbarth1-19/+14
This removes the subsys_initcall from the driver and converts it to a normal platform_driver. Also, drvdata is set and a remove functions is added to disable the clock and free resources. As pci driver removal currently is not supported, set .suppress_bind_attrs to permit unbinding. Signed-off-by: Sebastian Hesselbarth <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-09-30PCI: mvebu: increment nports only for registered portsSebastian Hesselbarth1-3/+4
The number of ports is probed by counting the number of available child nodes. Later on, the registration of a port can fail and cause a mismatch between the ->nports counter and registered ports. This patch modifies the counting strategy, to make ->nports represent the number of registered ports instead of the number of available childs. Signed-off-by: Sebastian Hesselbarth <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-09-30PCI: mvebu: move clock enable before register accessSebastian Hesselbarth1-13/+12
The clock passed to PCI controller found on MVEBU SoCs may come from a clock gate. This requires the clock to be enabled before any registers are accessed. Therefore, move the clock enable before register iomap to ensure it is enabled. Signed-off-by: Sebastian Hesselbarth <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-09-30PCI: mvebu: add support for MSIThomas Petazzoni1-0/+26
This commit adds support for Message Signaled Interrupts in the Marvell PCIe host controller. The work is very simple: it simply gets a reference to the msi_chip associated to the PCIe controller thanks to the msi-parent DT property, and stores this reference in the pci_bus structure. This is enough to let the Linux PCI core use the functions of msi_chip to setup and teardown MSIs. Signed-off-by: Thomas Petazzoni <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Signed-off-by: Jason Cooper <[email protected]>
2013-09-29Merge 3.12-rc3 into driver-core-nextGreg Kroah-Hartman1-1/+7
We want the driver core and sysfs fixes in here to make merges and development easier. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-28PCI: Workaround missing pci_set_master in pci driversYinghai Lu1-1/+7
Ben Herrenschmidt found that commit 928bea964827 ("PCI: Delay enabling bridges until they're needed") breaks PCI in some powerpc environments. The reason is that the PCIe port driver will call pci_enable_device() on the bridge, so the device is enabled, but skips pci_set_master because pcie_port_auto and no acpi on powerpc. Because of that, pci_enable_bridge() later on (called as a result of the child device driver doing pci_enable_device) will see the bridge as already enabled and will not call pci_set_master() on it. Fixed by add checking in pci_enable_bridge, and call pci_set_master if driver skip that. That will make the code more robot and wade off problem for missing pci_set_master in drivers. Reported-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Yinghai Lu <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-09-27Merge branch 'pci/misc' into nextBjorn Helgaas8-78/+80
* pci/misc: PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition PCI: acpiphp_ibm: Convert to dynamic debug PCI: acpiphp: Convert to dynamic debug PCI: Remove Intel Haswell D3 delays PCI: Pass type, width, and prefetchability for window alignment PCI: Document reason for using pci_is_root_bus() PCI: Use pci_is_root_bus() to check for root bus PCI: Remove unused "is_pcie" from pci_dev structure PCI: Update pci_find_slot() description in pci.txt [SCSI] qla2xxx: Use standard PCIe Capability Link register field names PCI: Fix comment typo, remove unnecessary !! in pci_is_pcie() PCI: Drop "setting latency timer" messages
2013-09-27Merge branch 'pci/host-tegra' into nextBjorn Helgaas1-2/+2
* pci/host-tegra: PCI: tegra: Add missing __iomem annotation
2013-09-27Merge branch 'pci/host-imx6' into nextBjorn Helgaas3-0/+582
* pci/host-imx6: PCI: imx6: Add support for i.MX6 PCIe controller ARM: imx6q: Add PCIe bits to GPR syscon definition
2013-09-27PCI: imx6: Add support for i.MX6 PCIe controllerSean Cross3-0/+582
Add support for the PCIe port present on the i.MX6 family of controllers. These use the Synopsis Designware core tied to their own PHY. Signed-off-by: Sean Cross <[email protected]> Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Sascha Hauer <[email protected]>
2013-09-27Merge branch 'pci/host-exynos' into nextBjorn Helgaas3-0/+366
* pci/host-exynos: PCI: exynos: Turn off power of phy block when link failed PCI: exynos: Add support for MSI MAINTAINERS: Add Jingoo Han as Samsung Exynos PCIe driver maintainer
2013-09-26PCI: convert bus code to use drv_groupsGreg Kroah-Hartman1-5/+8
The drv_attrs field of struct bus_type is going away soon, drv_groups should be used instead. This converts the PCI bus code to use the correct field. Cc: Bjorn Helgaas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26PCI: convert bus code to use bus_groupsGreg Kroah-Hartman3-5/+15
The bus_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the PCI bus code to use the correct field. Cc: Bjorn Helgaas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-25PCI: acpiphp_ibm: Convert to dynamic debugLan Tianyu1-34/+24
This patch is to use pr_debug/info/warn/err to replace acpiphp_ibm debug functions and remove module's debug param. User interface change: before this patch, boot with the "acpiphp_ibm.debug" kernel parameter to turn on debug. After this patch, set CONFIG_DYNAMIC_DEBUG=y and boot with "acpiphp_ibm.dyndebug=+p" instead. See Documentation/dynamic-debug-howto.txt. [bhelgaas: changelog] Signed-off-by: Lan Tianyu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-25PCI: acpiphp: Convert to dynamic debugLan Tianyu3-40/+30
This patch is to use pr_debug/info/warn/err to replace acpiphp debug functions and remove module's debug param. User interface change: before this patch, boot with the "acpiphp.debug" kernel parameter to turn on debug. After this patch, set CONFIG_DYNAMIC_DEBUG=y and boot with "acpiphp.dyndebug=+p" instead. See Documentation/dynamic-debug-howto.txt. [bhelgaas: changelog] Signed-off-by: Lan Tianyu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-25PCI: tegra: Add missing __iomem annotationJingoo Han1-2/+2
Added missing __iomem annotation in order to fix the following sparse warnings: drivers/pci/host/pci-tegra.c:411:41: warning: incorrect type in return expression (different address spaces) drivers/pci/host/pci-tegra.c:411:41: expected void [noderef] <asn:2>* drivers/pci/host/pci-tegra.c:411:41: got void *addr drivers/pci/host/pci-tegra.c:419:25: warning: incorrect type in return expression (different address spaces) drivers/pci/host/pci-tegra.c:419:25: expected void [noderef] <asn:2>* drivers/pci/host/pci-tegra.c:419:25: got void *addr Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Thierry Reding <[email protected]>
2013-09-25PCI: exynos: Turn off power of phy block when link failedJingoo Han1-0/+68
When link failed, there is no need to turn on phy block. Also, turning on phy block is added, in order to turn on phy block regardless of the default value of phy registers. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-25PCI: exynos: Add support for MSIJingoo Han3-0/+298
This patch adds support for Message Signaled Interrupt in the Exynos PCIe driver using Synopsys designware PCIe core IP. Signed-off-by: Siva Reddy Kallam <[email protected]> Signed-off-by: Srikanth T Shivanand <[email protected]> Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Pratyush Anand <[email protected]> Cc: Mohit KUMAR <[email protected]>
2013-09-25PCI: Remove Intel Haswell D3 delaysTodd E Brandt1-0/+23
The latest Intel Haswell chipsets have a hardware optimization which allows on-chip PCI devices to ignore the 10ms delay before entering or exiting D3 suspend. This patch implements the optimization as a PCI quirk, since we want tight control over which devices use it. This way we can test each device individually to be sure there are no issues before we enable the quirk. The first set of devices are from the Haswell platform, which includes every PCI device that is on the northbridge and southbridge. This patch reduces the Haswell suspend time from 93 ms to 47 ms and resume time from 160 ms to 64 ms. Signed-off-by: Todd Brandt <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]>
2013-09-25PCI: Pass type, width, and prefetchability for window alignmentWei Yang1-1/+1
When calculating window_alignment(), type information like IORESOURCE_MEM and IORESOURCE_PREFETCH may not be enough. For example, on powernv, we need to know whether the window is 64-bit or not. This patch passes the full resource type (res->flags) for window alignment. [bhelgaas: changelog] Signed-off-by: Wei Yang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Gavin Shan <[email protected]>
2013-09-25PCI: Use pci_is_root_bus() to check for root busWei Yang1-1/+1
In __pci_bus_size_bridges() we check whether a bus is a root bus by testing bus->self. As indicated by commit 79af72d7 ("PCI: pci_is_root_bus helper"), bus->self == NULL is not a proper way to check for a root bus. One issue is that "virtual" buses added for SR-IOV (via virtfn_add_bus()) have bus->self == NULL but are not root buses. This patch changes it to pci_is_root_bus() to check whether it is a root bus. [bhelgaas: changelog] Signed-off-by: Wei Yang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-25PCI: Remove unused "is_pcie" from pci_dev structureYijing Wang1-1/+0
No one uses "is_pcie" now; remove this obsolete member. Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-25PCI: Drop "setting latency timer" messagesBjorn Helgaas1-1/+1
This message isn't useful any more, so drop it. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=60636 Reported-by: Oleksil Shevchuk <[email protected]> Reference: http://lkml.kernel.org/r/CALCETrWkr53ZjqdN3t7rTTfr=+ZKZXJoYsuBcwPf0kN_33GfAw@mail.gmail.com Reported-by: Andy Lutomirski <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-24PCI: Export pcie_set_mps() and pcie_get_mps()Yijing Wang1-0/+2
Export pcie_get_mps() and pcie_set_mps() functions so drivers can use them to simplify code. Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-23Merge branch 'pci/yijing-pci_is_pcie-v2' into nextBjorn Helgaas1-2/+1
* pci/yijing-pci_is_pcie-v2: powerpc/pci: Use pci_is_pcie() to simplify code [SCSI] qla2xxx: Use pcie_is_pcie() to simplify code [SCSI] csiostor: Use pcie_capability_clear_and_set_word() to simplify code [SCSI] bfa: Use pcie_set()/get_readrq() to simplify code x86/pci: Use cached pci_dev->pcie_cap to simplify code PCI: Use pci_is_pcie() to simplify code
2013-09-23PCI/ACPI: Name _OSC #defines more consistentlyBjorn Helgaas2-2/+2
Make PCI Host Bridge _OSC #defines more consistent. No functional change. Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]>
2013-09-24pci-acpi: convert acpi_get_handle() to acpi_has_method()Zhang Rui1-2/+1
acpi_has_method() is a new ACPI API introduced to check the existence of an ACPI control method. It can be used to replace acpi_get_handle() in the case that 1. the calling function doesn't need the ACPI handle of the control method. and 2. the calling function doesn't care the reason why the method is unavailable. Convert acpi_get_handle() to acpi_has_method() in drivers/pci/pci-acpi.c in this patch. Signed-off-by: Zhang Rui <[email protected]> CC: Bjorn Helgaas <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2013-09-24acpi_pcihp: convert acpi_get_handle() to acpi_has_method()Zhang Rui1-5/+2
acpi_has_method() is a new ACPI API introduced to check the existence of an ACPI control method. It can be used to replace acpi_get_handle() in the case that 1. the calling function doesn't need the ACPI handle of the control method. and 2. the calling function doesn't care the reason why the method is unavailable. Convert acpi_get_handle() to acpi_has_method() in drivers/pci/hotplug/acpi_pcihp.c in this patch. Signed-off-by: Zhang Rui <[email protected]> CC: Bjorn Helgaas <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2013-09-23PCI: Use pci_is_pcie() to simplify codeYijing Wang1-2/+1
Use pci_is_pcie() instead of pci_find_capability() to simplify code. Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2013-09-20PCI / ACPI / PM: Clear pme_poll for devices in D3cold on wakeupRafael J. Wysocki1-3/+3
Commit 448bd85 (PCI/PM: add PCIe runtime D3cold support) added a piece of code to pci_acpi_wake_dev() causing that function to behave in a special way for devices in D3cold (so that their configuration registers are not accessed before those devices are resumed). However, it didn't take the clearing of the pme_poll flag into account. That has to be done for all devices, even if they are in D3cold, or pci_pme_list_scan() will not know that wakeup has been signaled for the device and will poll its PME Status bit unnecessarily. Fix the problem by moving the clearing of the pme_poll flag in pci_acpi_wake_dev() before the code introduced by commit 448bd85. Reported-and-tested-by: David E. Box <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: 3.6+ <[email protected]> # 3.6+