01 Jan, 2016

1 commit

  • Pull PCI bugfix from Bjorn Helgaas:
    "Here's another fix for v4.4.

    This fixes 32-bit config reads for the HiSilicon driver. Obviously
    the driver is completely broken without this fix (apparently it
    actually was tested internally, but got broken somehow in the process
    of upstreaming it).

    Summary:

    HiSilicon host bridge driver
    Fix 32-bit config reads (Dongdong Liu)"

    * tag 'pci-v4.4-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    PCI: hisi: Fix hisi_pcie_cfg_read() 32-bit reads

    Linus Torvalds
     

10 Dec, 2015

1 commit

  • Pull PCI fixes from Bjorn Helgaas:
    "These are more fixes I'd like to have in v4.4. Several for the Altera
    driver added for v4.4, and one for an MSI domain problem that affects
    several arm64 platforms:

    MSI:
    - Only use the generic MSI layer when domain is hierarchical (Marc
    Zyngier)

    Altera host bridge driver:
    - Fix loop in tlp_read_packet() (Dan Carpenter)
    - Fix Requester ID for config accesses (Ley Foon Tan)
    - Check TLP completion status (Ley Foon Tan)
    - Fix error when INTx is 4 (Ley Foon Tan)"

    * tag 'pci-v4.4-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    PCI: altera: Fix error when INTx is 4
    PCI: altera: Check TLP completion status
    PCI: altera: Fix Requester ID for config accesses
    PCI: altera: Fix loop in tlp_read_packet()
    PCI/MSI: Only use the generic MSI layer when domain is hierarchical

    Linus Torvalds
     

05 Dec, 2015

6 commits

  • For 32-bit config reads (size == 4), hisi_pcie_cfg_read() returned success
    but never filled in the data we read.

    Return the register data for 32-bit config reads.

    Without this fix, PCI doesn't work at all because enumeration depends on
    32-bit config reads. The driver was tested internally, but got broken in
    the process of upstreaming, so this fixes the breakage.

    Fixes: 500a1d9a43e0 ("PCI: hisi: Add HiSilicon SoC Hip05 PCIe driver")
    Signed-off-by: Dongdong Liu
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Zhou Wang

    Dongdong Liu
     
  • PCI interrupt lines start at 1, not at 0. So, creates additional one
    interrupt when register for irq domain.

    Error when PCIe devices have 4 INTx:

    WARNING: CPU: 1 PID: 1 at kernel/irq/irqdomain.c:280
    irq_domain_associate+0x17c/0x1cc()
    error: hwirq 0x4 is too large for dummy

    Tested on Ethernet adapter card with multi-functions.

    Signed-off-by: Ley Foon Tan
    Signed-off-by: Bjorn Helgaas

    Ley Foon Tan
     
  • Check TLP packet successful completion status. This fix the issue when
    accessing multi-function devices in enumeration process, TLP will return
    error when accessing non-exist function number. Returns PCI error code
    instead of generic errno.

    Tested on Ethernet adapter card with multi-functions.

    [bhelgaas: simplify completion status checking code]
    Signed-off-by: Ley Foon Tan
    Signed-off-by: Bjorn Helgaas

    Ley Foon Tan
     
  • The Requester ID should use the Root Port devfn and it should be always 0.
    Previously we constructed the Requester ID using the *Completer* devfn,
    i.e., the devfn of the Function we expect to respond to the config access.
    This causes issues when accessing configuration space for devices other
    than the Root Port.

    Build the Requester ID using the Root Port devfn.

    Tested on Ethernet adapter card with multi-functions.

    Signed-off-by: Ley Foon Tan
    Signed-off-by: Bjorn Helgaas

    Ley Foon Tan
     
  • TLP_LOOP is 500 and the "loop" variable was a u8 so "loop < TLP_LOOP" is
    always true. We only need this condition to work if there is a problem so
    it would have been easy to miss this in testing.

    Make it a normal for loop with "int i" instead of over thinking things and
    making it complicated.

    Fixes: 6bb4dd154ae8 ("PCI: altera: Add Altera PCIe host controller driver")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Bjorn Helgaas
    Acked-by: Ley Foon Tan

    Dan Carpenter
     
  • Since d8a1cb757550 ("PCI/MSI: Let pci_msi_get_domain use struct
    device::msi_domain"), we use the MSI domain associated with the PCI device.

    But finding an MSI domain doesn't mean that the domain is implemented using
    the generic MSI domain API, and a number of MSI controllers are still using
    arch_setup_msi_irq() and arch_teardown_msi_irqs().

    Check that the domain we just obtained is hierarchical. If it is, we can
    use the new generic MSI stuff. Otherwise we have to fall back to the old
    arch_setup_msi_irq() and arch_teardown_msi_irqs() interfaces.

    This avoids an oops in msi_domain_alloc_irqs() on systems with R-Car,
    Tegra, Armada 370, and probably other DesignWare-based host controllers.

    Fixes: d8a1cb757550 ("PCI/MSI: Let pci_msi_get_domain use struct device::msi_domain")
    Reported-by: Phil Edworthy
    Tested-by: Phil Edworthy
    Signed-off-by: Marc Zyngier
    Signed-off-by: Bjorn Helgaas
    Acked-by: Thomas Gleixner
    CC: stable@vger.kernel.org # v4.3+

    Marc Zyngier
     

02 Dec, 2015

1 commit

  • The runtime PM core doesn't treat EBUSY and EAGAIN retvals from the driver
    suspend hooks as errors, but they still show up as errors in dmesg. Tune
    them down. See rpm_suspend() for details of handling these return values.

    Note that we use dev_dbg() for the retryable retvals, so after this
    change you'll need either CONFIG_DYNAMIC_DEBUG or CONFIG_PCI_DEBUG
    for them to show up in the log.

    One problem caused by this was noticed by Daniel: the i915 driver
    returns EAGAIN to signal a temporary failure to suspend and as a request
    towards the RPM core for scheduling a suspend again. This is a normal
    event, but the resulting error message flags a breakage during the
    driver's automated testing which parses dmesg and picks up the error.

    Reported-by: Daniel Vetter
    Link: https://bugs.freedesktop.org/show_bug.cgi?id=92992
    Signed-off-by: Imre Deak
    Acked-by: Bjorn Helgaas
    Signed-off-by: Rafael J. Wysocki

    Imre Deak
     

26 Nov, 2015

1 commit

  • Commit b3a72384fe29 ("ARM/PCI: Replace pci_sys_data->align_resource with
    global function pointer") introduced an ARM-specific align_resource()
    function pointer. This is not portable to other arches and doesn't work
    for platforms with two different PCIe host bridge controllers.

    Move the function pointer to the pci_host_bridge structure so each host
    bridge driver can specify its own align_resource() function.

    Signed-off-by: Gabriele Paoloni
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Arnd Bergmann

    Gabriele Paoloni
     

25 Nov, 2015

3 commits

  • The hisi_pcie_probe() function is incorrectly marked as __init, as Kconfig
    tells us:

    WARNING: drivers/pci/host/built-in.o(.data+0x7780): Section mismatch in reference from the variable hisi_pcie_driver to the function .init.text:hisi_pcie_probe()

    If the probe for this device gets deferred past the point where __init
    functions are removed, or the device is unbound and then reattached to the
    driver, we branch into uninitialized memory, which is bad.

    Remove the __init annotation from hisi_pcie_probe() and
    hisi_add_pcie_port().

    Fixes: 500a1d9a43e0 ("PCI: hisi: Add HiSilicon SoC Hip05 PCIe driver")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Acked-by: Zhou Wang

    Arnd Bergmann
     
  • "pp->io" is an I/O resource, e.g., "[io 0x0000-0xffff]"; "pp->io_base" is
    the CPU physical address of a region where the host bridge converts CPU
    memory accesses into PCI I/O transactions.

    Corrupting pp->io_base by assigning pp->io->start to it breaks access to
    the PCI I/O space, as reported by Kishon.

    Remove the invalid assignment.

    [bhelgaas: changelog]
    Fixes: 0021d22b73d6 ("PCI: designware: Use of_pci_get_host_bridge_resources() to parse DT")
    Reported-and-tested-by: Kishon Vijay Abraham I
    Signed-off-by: Stanimir Varbanov
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Arnd Bergmann

    Stanimir Varbanov
     
  • Commit 1266963170f5 ("PCI: Prevent out of bounds access in numa_node
    override") missed that the user-provided node could also be negative.
    Handle this case as well to avoid out-of-bounds accesses to the
    node_states[] array. However, allow the special value -1, i.e.
    NUMA_NO_NODE, to be able to set the 'no specific node' configuration.

    Fixes: 1266963170f5 ("PCI: Prevent out of bounds access in numa_node override")
    Fixes: 63692df103e9 ("PCI: Allow numa_node override via sysfs")
    Signed-off-by: Mathias Krause
    Signed-off-by: Bjorn Helgaas
    CC: Sasha Levin
    CC: Prarit Bhargava
    CC: stable@vger.kernel.org # v3.19+

    Mathias Krause
     

20 Nov, 2015

2 commits

  • * acpi-smbus:
    Revert "ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook"
    ACPI / SMBus: Fix boot stalls / high CPU caused by reentrant code

    * acpi-ec:
    ACPI-EC: Drop unnecessary check made before calling acpi_ec_delete_query()

    * acpi-pci:
    PCI: Fix OF logic in pci_dma_configure()

    Rafael J. Wysocki
     
  • This patch fixes a bug introduced by previous commit,
    which incorrectly checkes the of_node of the end-point device.
    Instead, it should check the of_node of the host bridge.

    Fixes: 50230713b639 ("PCI: OF: Move of_pci_dma_configure() to pci_dma_configure()")
    Reported-by: Robin Murphy
    Signed-off-by: Suravee Suthikulpanit
    Acked-by: Arnd Bergmann
    Signed-off-by: Rafael J. Wysocki

    Suravee Suthikulpanit
     

13 Nov, 2015

1 commit

  • Pull more power management and ACPI updates from Rafael Wysocki:
    "The only new feature in this batch is support for the ACPI _CCA device
    configuration object, which it a pre-requisite for future ACPI PCI
    support on ARM64, but should not affect the other architectures.

    The rest is fixes and cleanups, mostly in cpufreq (including
    intel_pstate), the Operating Performace Points (OPP) framework and
    tools (cpupower and turbostat).

    Specifics:

    - Support for the ACPI _CCA configuration object intended to tell the
    OS whether or not a bus master device supports hardware managed
    cache coherency and a new set of functions to allow drivers to
    check the cache coherency support for devices in a platform
    firmware interface agnostic way (Suravee Suthikulpanit, Jeremy
    Linton).

    - ACPI backlight quirks for ESPRIMO Mobile M9410 and Dell XPS L421X
    (Aaron Lu, Hans de Goede).

    - Fixes for the arm_big_little and s5pv210-cpufreq cpufreq drivers
    (Jon Medhurst, Nicolas Pitre).

    - kfree()-related fixup for the recently introduced CPPC cpufreq
    frontend (Markus Elfring).

    - intel_pstate fix reducing kernel log noise on systems where
    P-states are managed by hardware (Prarit Bhargava).

    - intel_pstate maintainers information update (Srinivas Pandruvada).

    - cpufreq core optimization related to the handling of delayed work
    items used by governors (Viresh Kumar).

    - Locking fixes and cleanups of the Operating Performance Points
    (OPP) framework (Viresh Kumar).

    - Generic power domains framework cleanups (Lina Iyer).

    - cpupower tool updates (Jacob Tanenbaum, Sriram Raghunathan, Thomas
    Renninger).

    - turbostat tool updates (Len Brown)"

    * tag 'pm+acpi-4.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
    PCI: ACPI: Add support for PCI device DMA coherency
    PCI: OF: Move of_pci_dma_configure() to pci_dma_configure()
    of/pci: Fix pci_get_host_bridge_device leak
    device property: ACPI: Remove unused DMA APIs
    device property: ACPI: Make use of the new DMA Attribute APIs
    device property: Adding DMA Attribute APIs for Generic Devices
    ACPI: Adding DMA Attribute APIs for ACPI Device
    device property: Introducing enum dev_dma_attr
    ACPI: Honor ACPI _CCA attribute setting
    cpufreq: CPPC: Delete an unnecessary check before the function call kfree()
    PM / OPP: Add opp_rcu_lockdep_assert() to _find_device_opp()
    PM / OPP: Hold dev_opp_list_lock for writers
    PM / OPP: Protect updates to list_dev with mutex
    PM / OPP: Propagate error properly from dev_pm_opp_set_sharing_cpus()
    cpufreq: s5pv210-cpufreq: fix wrong do_div() usage
    MAINTAINERS: update for intel P-state driver
    Creating a common structure initialization pattern for struct option
    cpupower: Enable disabled Cstates if they are below max latency
    cpupower: Remove debug message when using cpupower idle-set -D switch
    cpupower: cpupower monitor reports uninitialized values for offline cpus
    ...

    Linus Torvalds
     

07 Nov, 2015

4 commits

  • * acpi-pci:
    PCI: ACPI: Add support for PCI device DMA coherency
    PCI: OF: Move of_pci_dma_configure() to pci_dma_configure()
    of/pci: Fix pci_get_host_bridge_device leak
    device property: ACPI: Remove unused DMA APIs
    device property: ACPI: Make use of the new DMA Attribute APIs
    device property: Adding DMA Attribute APIs for Generic Devices
    ACPI: Adding DMA Attribute APIs for ACPI Device
    device property: Introducing enum dev_dma_attr
    ACPI: Honor ACPI _CCA attribute setting

    Conflicts:
    drivers/crypto/ccp/ccp-platform.c

    Rafael J. Wysocki
     
  • This patch adds support for setting up PCI device DMA coherency from
    ACPI _CCA object that should normally be specified in the DSDT node
    of its PCI host bridge.

    Signed-off-by: Suravee Suthikulpanit
    Acked-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Suthikulpanit, Suravee
     
  • This patch move of_pci_dma_configure() to a more generic
    pci_dma_configure(), which can be extended by non-OF code (e.g. ACPI).

    This has no functional change.

    Signed-off-by: Suravee Suthikulpanit
    Acked-by: Rob Herring
    Acked-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Suthikulpanit, Suravee
     
  • Pull PCI updates from Bjorn Helgaas:
    "Resource management:
    - Add support for Enhanced Allocation devices (Sean O. Stalley)
    - Add Enhanced Allocation register entries (Sean O. Stalley)
    - Handle IORESOURCE_PCI_FIXED when sizing resources (David Daney)
    - Handle IORESOURCE_PCI_FIXED when assigning resources (David Daney)
    - Handle Enhanced Allocation capability for SR-IOV devices (David Daney)
    - Clear IORESOURCE_UNSET when reverting to firmware-assigned address (Bjorn Helgaas)
    - Make Enhanced Allocation bitmasks more obvious (Bjorn Helgaas)
    - Expand Enhanced Allocation BAR output (Bjorn Helgaas)
    - Add of_pci_check_probe_only to parse "linux,pci-probe-only" (Marc Zyngier)
    - Fix lookup of linux,pci-probe-only property (Marc Zyngier)
    - Add sparc mem64 resource parsing for root bus (Yinghai Lu)

    PCI device hotplug:
    - pciehp: Queue power work requests in dedicated function (Guenter Roeck)

    Driver binding:
    - Add builtin_pci_driver() to avoid registration boilerplate (Paul Gortmaker)

    Virtualization:
    - Set SR-IOV NumVFs to zero after enumeration (Alexander Duyck)
    - Remove redundant validation of SR-IOV offset/stride registers (Alexander Duyck)
    - Remove VFs in reverse order if virtfn_add() fails (Alexander Duyck)
    - Reorder pcibios_sriov_disable() (Alexander Duyck)
    - Wait 1 second between disabling VFs and clearing NumVFs (Alexander Duyck)
    - Fix sriov_enable() error path for pcibios_enable_sriov() failures (Alexander Duyck)
    - Enable SR-IOV ARI Capable Hierarchy before reading TotalVFs (Ben Shelton)
    - Don't try to restore VF BARs (Wei Yang)

    MSI:
    - Don't alloc pcibios-irq when MSI is enabled (Joerg Roedel)
    - Add msi_controller setup_irqs() method for special multivector setup (Lucas Stach)
    - Export all remapped MSIs to sysfs attributes (Romain Bezut)
    - Disable MSI on SiS 761 (Ondrej Zary)

    AER:
    - Clear error status registers during enumeration and restore (Taku Izumi)

    Generic host bridge driver:
    - Fix lookup of linux,pci-probe-only property (Marc Zyngier)
    - Allow multiple hosts with different map_bus() methods (David Daney)
    - Pass starting bus number to pci_scan_root_bus() (David Daney)
    - Fix address window calculation for non-zero starting bus (David Daney)

    Altera host bridge driver:
    - Add msi.h to ARM Kbuild (Ley Foon Tan)
    - Add Altera PCIe host controller driver (Ley Foon Tan)
    - Add Altera PCIe MSI driver (Ley Foon Tan)

    APM X-Gene host bridge driver:
    - Remove msi_controller assignment (Duc Dang)

    Broadcom iProc host bridge driver:
    - Fix header comment "Corporation" misspelling (Florian Fainelli)
    - Fix code comment to match code (Ray Jui)
    - Remove unused struct iproc_pcie.irqs[] (Ray Jui)
    - Call pci_fixup_irqs() for ARM64 as well as ARM (Ray Jui)
    - Fix PCIe reset logic (Ray Jui)
    - Improve link detection logic (Ray Jui)
    - Update PCIe device tree bindings (Ray Jui)
    - Add outbound mapping support (Ray Jui)

    Freescale i.MX6 host bridge driver:
    - Return real error code from imx6_add_pcie_port() (Fabio Estevam)
    - Add PCIE_PHY_RX_ASIC_OUT_VALID definition (Fabio Estevam)

    Freescale Layerscape host bridge driver:
    - Remove ls_pcie_establish_link() (Minghuan Lian)
    - Ignore PCIe controllers in Endpoint mode (Minghuan Lian)
    - Factor out SCFG related function (Minghuan Lian)
    - Update ls_add_pcie_port() (Minghuan Lian)
    - Remove unused fields from struct ls_pcie (Minghuan Lian)
    - Add support for LS1043a and LS2080a (Minghuan Lian)
    - Add ls_pcie_msi_host_init() (Minghuan Lian)

    HiSilicon host bridge driver:
    - Add HiSilicon SoC Hip05 PCIe driver (Zhou Wang)

    Marvell MVEBU host bridge driver:
    - Return zero for reserved or unimplemented config space (Russell King)
    - Use exact config access size; don't read/modify/write (Russell King)
    - Use of_get_available_child_count() (Russell King)
    - Use for_each_available_child_of_node() to walk child nodes (Russell King)
    - Report full node name when reporting a DT error (Russell King)
    - Use port->name rather than "PCIe%d.%d" (Russell King)
    - Move port parsing and resource claiming to separate function (Russell King)
    - Fix memory leaks and refcount leaks (Russell King)
    - Split port parsing and resource claiming from port setup (Russell King)
    - Use gpio_set_value_cansleep() (Russell King)
    - Use devm_kcalloc() to allocate an array (Russell King)
    - Use gpio_desc to carry around gpio (Russell King)
    - Improve clock/reset handling (Russell King)
    - Add PCI Express root complex capability block (Russell King)
    - Remove code restricting accesses to slot 0 (Russell King)

    NVIDIA Tegra host bridge driver:
    - Wrap static pgprot_t initializer with __pgprot() (Ard Biesheuvel)

    Renesas R-Car host bridge driver:
    - Build pci-rcar-gen2.c only on ARM (Geert Uytterhoeven)
    - Build pcie-rcar.c only on ARM (Geert Uytterhoeven)
    - Make PCI aware of the I/O resources (Phil Edworthy)
    - Remove dependency on ARM-specific struct hw_pci (Phil Edworthy)
    - Set root bus nr to that provided in DT (Phil Edworthy)
    - Fix I/O offset for multiple host bridges (Phil Edworthy)

    ST Microelectronics SPEAr13xx host bridge driver:
    - Fix dw_pcie_cfg_read/write() usage (Gabriele Paoloni)

    Synopsys DesignWare host bridge driver:
    - Make "clocks" and "clock-names" optional DT properties (Bhupesh Sharma)
    - Use exact access size in dw_pcie_cfg_read() (Gabriele Paoloni)
    - Simplify dw_pcie_cfg_read/write() interfaces (Gabriele Paoloni)
    - Require config accesses to be naturally aligned (Gabriele Paoloni)
    - Make "num-lanes" an optional DT property (Gabriele Paoloni)
    - Move calculation of bus addresses to DRA7xx (Gabriele Paoloni)
    - Replace ARM pci_sys_data->align_resource with global function pointer (Gabriele Paoloni)
    - Factor out MSI msg setup (Lucas Stach)
    - Implement multivector MSI IRQ setup (Lucas Stach)
    - Make get_msi_addr() return phys_addr_t, not u32 (Lucas Stach)
    - Set up high part of MSI target address (Lucas Stach)
    - Fix PORT_LOGIC_LINK_WIDTH_MASK (Zhou Wang)
    - Revert "PCI: designware: Program ATU with untranslated address" (Zhou Wang)
    - Use of_pci_get_host_bridge_resources() to parse DT (Zhou Wang)
    - Make driver arch-agnostic (Zhou Wang)

    Miscellaneous:
    - Make x86 pci_subsys_init() static (Alexander Kuleshov)
    - Turn off Request Attributes to avoid Chelsio T5 Completion erratum (Hariprasad Shenai)"

    * tag 'pci-v4.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (94 commits)
    PCI: altera: Add Altera PCIe MSI driver
    PCI: hisi: Add HiSilicon SoC Hip05 PCIe driver
    PCI: layerscape: Add ls_pcie_msi_host_init()
    PCI: layerscape: Add support for LS1043a and LS2080a
    PCI: layerscape: Remove unused fields from struct ls_pcie
    PCI: layerscape: Update ls_add_pcie_port()
    PCI: layerscape: Factor out SCFG related function
    PCI: layerscape: Ignore PCIe controllers in Endpoint mode
    PCI: layerscape: Remove ls_pcie_establish_link()
    PCI: designware: Make "clocks" and "clock-names" optional DT properties
    PCI: designware: Make driver arch-agnostic
    ARM/PCI: Replace pci_sys_data->align_resource with global function pointer
    PCI: designware: Use of_pci_get_host_bridge_resources() to parse DT
    Revert "PCI: designware: Program ATU with untranslated address"
    PCI: designware: Move calculation of bus addresses to DRA7xx
    PCI: designware: Make "num-lanes" an optional DT property
    PCI: designware: Require config accesses to be naturally aligned
    PCI: designware: Simplify dw_pcie_cfg_read/write() interfaces
    PCI: designware: Use exact access size in dw_pcie_cfg_read()
    PCI: spear: Fix dw_pcie_cfg_read/write() usage
    ...

    Linus Torvalds
     

05 Nov, 2015

1 commit

  • Pull power management and ACPI updates from Rafael Wysocki:
    "Quite a new features are included this time.

    First off, the Collaborative Processor Performance Control interface
    (version 2) defined by ACPI will now be supported on ARM64 along with
    a cpufreq frontend for CPU performance scaling.

    Second, ACPI gets a new infrastructure for the early probing of IRQ
    chips and clock sources (along the lines of the existing similar
    mechanism for DT).

    Next, the ACPI core and the generic device properties API will now
    support a recently introduced hierarchical properties extension of the
    _DSD (Device Specific Data) ACPI device configuration object. If the
    ACPI platform firmware uses that extension to organize device
    properties in a hierarchical way, the kernel will automatically handle
    it and make those properties available to device drivers via the
    generic device properties API.

    It also will be possible to build the ACPICA's AML interpreter
    debugger into the kernel now and use that to diagnose AML-related
    problems more efficiently. In the future, this should make it
    possible to single-step AML execution and do similar things.
    Interesting stuff, although somewhat experimental at this point.

    Finally, the PM core gets a new mechanism that can be used by device
    drivers to distinguish between suspend-to-RAM (based on platform
    firmware support) and suspend-to-idle (or other variants of system
    suspend the platform firmware is not involved in) and possibly
    optimize their device suspend/resume handling accordingly.

    In addition to that, some existing features are re-organized quite
    substantially.

    First, the ACPI-based handling of PCI host bridges on x86 and ia64 is
    unified and the common code goes into the ACPI core (so as to reduce
    code duplication and eliminate non-essential differences between the
    two architectures in that area).

    Second, the Operating Performance Points (OPP) framework is
    reorganized to make the code easier to find and follow.

    Next, the cpufreq core's sysfs interface is reorganized to get rid of
    the "primary CPU" concept for configurations in which the same
    performance scaling settings are shared between multiple CPUs.

    Finally, some interfaces that aren't necessary any more are dropped
    from the generic power domains framework.

    On top of the above we have some minor extensions, cleanups and bug
    fixes in multiple places, as usual.

    Specifics:

    - ACPICA update to upstream revision 20150930 (Bob Moore, Lv Zheng).

    The most significant change is to allow the AML debugger to be
    built into the kernel. On top of that there is an update related
    to the NFIT table (the ACPI persistent memory interface) and a few
    fixes and cleanups.

    - ACPI CPPC2 (Collaborative Processor Performance Control v2) support
    along with a cpufreq frontend (Ashwin Chaugule).

    This can only be enabled on ARM64 at this point.

    - New ACPI infrastructure for the early probing of IRQ chips and
    clock sources (Marc Zyngier).

    - Support for a new hierarchical properties extension of the ACPI
    _DSD (Device Specific Data) device configuration object allowing
    the kernel to handle hierarchical properties (provided by the
    platform firmware this way) automatically and make them available
    to device drivers via the generic device properties interface
    (Rafael Wysocki).

    - Generic device properties API extension to obtain an index of
    certain string value in an array of strings, along the lines of
    of_property_match_string(), but working for all of the supported
    firmware node types, and support for the "dma-names" device
    property based on it (Mika Westerberg).

    - ACPI core fix to parse the MADT (Multiple APIC Description Table)
    entries in the order expected by platform firmware (and mandated by
    the specification) to avoid confusion on systems with more than 255
    logical CPUs (Lukasz Anaczkowski).

    - Consolidation of the ACPI-based handling of PCI host bridges on x86
    and ia64 (Jiang Liu).

    - ACPI core fixes to ensure that the correct IRQ number is used to
    represent the SCI (System Control Interrupt) in the cases when it
    has been re-mapped (Chen Yu).

    - New ACPI backlight quirk for Lenovo IdeaPad S405 (Hans de Goede).

    - ACPI EC driver fixes (Lv Zheng).

    - Assorted ACPI fixes and cleanups (Dan Carpenter, Insu Yun, Jiri
    Kosina, Rami Rosen, Rasmus Villemoes).

    - New mechanism in the PM core allowing drivers to check if the
    platform firmware is going to be involved in the upcoming system
    suspend or if it has been involved in the suspend the system is
    resuming from at the moment (Rafael Wysocki).

    This should allow drivers to optimize their suspend/resume handling
    in some cases and the changes include a couple of users of it (the
    i8042 input driver, PCI PM).

    - PCI PM fix to prevent runtime-suspended devices with PME enabled
    from being resumed during system suspend even if they aren't
    configured to wake up the system from sleep (Rafael Wysocki).

    - New mechanism to report the number of a wakeup IRQ that woke up the
    system from sleep last time (Alexandra Yates).

    - Removal of unused interfaces from the generic power domains
    framework and fixes related to latency measurements in that code
    (Ulf Hansson, Daniel Lezcano).

    - cpufreq core sysfs interface rework to make it handle CPUs that
    share performance scaling settings (represented by a common cpufreq
    policy object) more symmetrically (Viresh Kumar).

    This should help to simplify the CPU offline/online handling among
    other things.

    - cpufreq core fixes and cleanups (Viresh Kumar).

    - intel_pstate fixes related to the Turbo Activation Ratio (TAR)
    mechanism on client platforms which causes the turbo P-states range
    to vary depending on platform firmware settings (Srinivas
    Pandruvada).

    - intel_pstate sysfs interface fix (Prarit Bhargava).

    - Assorted cpufreq driver (imx, tegra20, powernv, integrator) fixes
    and cleanups (Bai Ping, Bartlomiej Zolnierkiewicz, Shilpasri G
    Bhat, Luis de Bethencourt).

    - cpuidle mvebu driver cleanups (Russell King).

    - OPP (Operating Performance Points) framework code reorganization to
    make it more maintainable (Viresh Kumar).

    - Intel Broxton support for the RAPL (Running Average Power Limits)
    power capping driver (Amy Wiles).

    - Assorted power management code fixes and cleanups (Dan Carpenter,
    Geert Uytterhoeven, Geliang Tang, Luis de Bethencourt, Rasmus
    Villemoes)"

    * tag 'pm+acpi-4.4-rc1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (108 commits)
    cpufreq: postfix policy directory with the first CPU in related_cpus
    cpufreq: create cpu/cpufreq/policyX directories
    cpufreq: remove cpufreq_sysfs_{create|remove}_file()
    cpufreq: create cpu/cpufreq at boot time
    cpufreq: Use cpumask_copy instead of cpumask_or to copy a mask
    cpufreq: ondemand: Drop unnecessary locks from update_sampling_rate()
    PM / Domains: Merge measurements for PM QoS device latencies
    PM / Domains: Don't measure ->start|stop() latency in system PM callbacks
    PM / clk: Fix broken build due to non-matching code and header #ifdefs
    ACPI / Documentation: add copy_dsdt to ACPI format options
    ACPI / sysfs: correctly check failing memory allocation
    ACPI / video: Add a quirk to force native backlight on Lenovo IdeaPad S405
    ACPI / CPPC: Fix potential memory leak
    ACPI / CPPC: signedness bug in register_pcc_channel()
    ACPI / PAD: power_saving_thread() is not freezable
    ACPI / PM: Fix incorrect wakeup IRQ setting during suspend-to-idle
    ACPI: Using correct irq when waiting for events
    ACPI: Use correct IRQ when uninstalling ACPI interrupt handler
    cpuidle: mvebu: disable the bind/unbind attributes and use builtin_platform_driver
    cpuidle: mvebu: clean up multiple platform drivers
    ...

    Linus Torvalds
     

04 Nov, 2015

1 commit

  • Pull irq updates from Thomas Gleixner:
    "The irq departement delivers:

    - Rework the irqdomain core infrastructure to accomodate ACPI based
    systems. This is required to support ARM64 without creating
    artificial device tree nodes.

    - Sanitize the ACPI based ARM GIC initialization by making use of the
    new firmware independent irqdomain core

    - Further improvements to the generic MSI management

    - Generalize the irq migration on CPU hotplug

    - Improvements to the threaded interrupt infrastructure

    - Allow the migration of "chained" low level interrupt handlers

    - Allow optional force masking of interrupts in disable_irq[_nosysnc]

    - Support for two new interrupt chips - Sigh!

    - A larger set of errata fixes for ARM gicv3

    - The usual pile of fixes, updates, improvements and cleanups all
    over the place"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits)
    Document that IRQ_NONE should be returned when IRQ not actually handled
    PCI/MSI: Allow the MSI domain to be device-specific
    PCI: Add per-device MSI domain hook
    of/irq: Use the msi-map property to provide device-specific MSI domain
    of/irq: Split of_msi_map_rid to reuse msi-map lookup
    irqchip/gic-v3-its: Parse new version of msi-parent property
    PCI/MSI: Use of_msi_get_domain instead of open-coded "msi-parent" parsing
    of/irq: Use of_msi_get_domain instead of open-coded "msi-parent" parsing
    of/irq: Add support code for multi-parent version of "msi-parent"
    irqchip/gic-v3-its: Add handling of PCI requester id.
    PCI/MSI: Add helper function pci_msi_domain_get_msi_rid().
    of/irq: Add new function of_msi_map_rid()
    Docs: dt: Add PCI MSI map bindings
    irqchip/gic-v2m: Add support for multiple MSI frames
    irqchip/gic-v3: Fix translation of LPIs after conversion to irq_fwspec
    irqchip/mxs: Add Alphascale ASM9260 support
    irqchip/mxs: Prepare driver for hardware with different offsets
    irqchip/mxs: Panic if ioremap or domain creation fails
    irqdomain: Documentation updates
    irqdomain/msi: Use fwnode instead of of_node
    ...

    Linus Torvalds
     

03 Nov, 2015

18 commits

  • * pci/host-layerscape:
    PCI: layerscape: Add ls_pcie_msi_host_init()
    PCI: layerscape: Add support for LS1043a and LS2080a
    PCI: layerscape: Remove unused fields from struct ls_pcie
    PCI: layerscape: Update ls_add_pcie_port()
    PCI: layerscape: Factor out SCFG related function
    PCI: layerscape: Ignore PCIe controllers in Endpoint mode
    PCI: layerscape: Remove ls_pcie_establish_link()

    Bjorn Helgaas
     
  • * pci/host-hisi:
    PCI: hisi: Add HiSilicon SoC Hip05 PCIe driver

    Bjorn Helgaas
     
  • …i/host-imx6', 'pci/host-iproc', 'pci/host-mvebu', 'pci/host-rcar', 'pci/host-tegra' and 'pci/host-xgene' into next

    * pci/host-altera:
    PCI: altera: Add Altera PCIe MSI driver
    PCI: altera: Add Altera PCIe host controller driver
    ARM: Add msi.h to Kbuild

    * pci/host-designware:
    PCI: designware: Make "clocks" and "clock-names" optional DT properties
    PCI: designware: Make driver arch-agnostic
    ARM/PCI: Replace pci_sys_data->align_resource with global function pointer
    PCI: designware: Use of_pci_get_host_bridge_resources() to parse DT
    Revert "PCI: designware: Program ATU with untranslated address"
    PCI: designware: Move calculation of bus addresses to DRA7xx
    PCI: designware: Make "num-lanes" an optional DT property
    PCI: designware: Require config accesses to be naturally aligned
    PCI: designware: Simplify dw_pcie_cfg_read/write() interfaces
    PCI: designware: Use exact access size in dw_pcie_cfg_read()
    PCI: spear: Fix dw_pcie_cfg_read/write() usage
    PCI: designware: Set up high part of MSI target address
    PCI: designware: Make get_msi_addr() return phys_addr_t, not u32
    PCI: designware: Implement multivector MSI IRQ setup
    PCI: designware: Factor out MSI msg setup
    PCI: Add msi_controller setup_irqs() method for special multivector setup
    PCI: designware: Fix PORT_LOGIC_LINK_WIDTH_MASK

    * pci/host-generic:
    PCI: generic: Fix address window calculation for non-zero starting bus
    PCI: generic: Pass starting bus number to pci_scan_root_bus()
    PCI: generic: Allow multiple hosts with different map_bus() methods
    arm64: dts: Drop linux,pci-probe-only from the Seattle DTS
    powerpc/PCI: Fix lookup of linux,pci-probe-only property
    PCI: generic: Fix lookup of linux,pci-probe-only property
    of/pci: Add of_pci_check_probe_only to parse "linux,pci-probe-only"

    * pci/host-imx6:
    PCI: imx6: Add PCIE_PHY_RX_ASIC_OUT_VALID definition
    PCI: imx6: Return real error code from imx6_add_pcie_port()

    * pci/host-iproc:
    PCI: iproc: Fix header comment "Corporation" misspelling
    PCI: iproc: Add outbound mapping support
    PCI: iproc: Update PCIe device tree bindings
    PCI: iproc: Improve link detection logic
    PCI: iproc: Fix PCIe reset logic
    PCI: iproc: Call pci_fixup_irqs() for ARM64 as well as ARM
    PCI: iproc: Remove unused struct iproc_pcie.irqs[]
    PCI: iproc: Fix code comment to match code

    * pci/host-mvebu:
    PCI: mvebu: Remove code restricting accesses to slot 0
    PCI: mvebu: Add PCI Express root complex capability block
    PCI: mvebu: Improve clock/reset handling
    PCI: mvebu: Use gpio_desc to carry around gpio
    PCI: mvebu: Use devm_kcalloc() to allocate an array
    PCI: mvebu: Use gpio_set_value_cansleep()
    PCI: mvebu: Split port parsing and resource claiming from port setup
    PCI: mvebu: Fix memory leaks and refcount leaks
    PCI: mvebu: Move port parsing and resource claiming to separate function
    PCI: mvebu: Use port->name rather than "PCIe%d.%d"
    PCI: mvebu: Report full node name when reporting a DT error
    PCI: mvebu: Use for_each_available_child_of_node() to walk child nodes
    PCI: mvebu: Use of_get_available_child_count()
    PCI: mvebu: Use exact config access size; don't read/modify/write
    PCI: mvebu: Return zero for reserved or unimplemented config space

    * pci/host-rcar:
    PCI: rcar: Fix I/O offset for multiple host bridges
    PCI: rcar: Set root bus nr to that provided in DT
    PCI: rcar: Remove dependency on ARM-specific struct hw_pci
    PCI: rcar: Make PCI aware of the I/O resources
    PCI: rcar: Build pcie-rcar.c only on ARM
    PCI: rcar: Build pci-rcar-gen2.c only on ARM

    * pci/host-tegra:
    PCI: tegra: Wrap static pgprot_t initializer with __pgprot()

    * pci/host-xgene:
    PCI/MSI: xgene: Remove msi_controller assignment

    Bjorn Helgaas
     
  • Add Altera PCIe MSI driver. This soft IP supports a configurable number of
    vectors, which is a DTS parameter.

    [bhelgaas: Kconfig depend on PCIE_ALTERA, typos, whitespace]
    Signed-off-by: Ley Foon Tan
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Marc Zyngier
    Acked-by: Rob Herring

    Ley Foon Tan
     
  • …nd 'pci/virtualization' into next

    * pci/aer:
    PCI/AER: Clear error status registers during enumeration and restore

    * pci/hotplug:
    PCI: pciehp: Queue power work requests in dedicated function

    * pci/misc:
    PCI: Turn off Request Attributes to avoid Chelsio T5 Completion erratum
    x86/PCI: Make pci_subsys_init() static
    PCI: Add builtin_pci_driver() to avoid registration boilerplate
    PCI: Remove unnecessary "if" statement

    * pci/msi:
    x86/PCI: Don't alloc pcibios-irq when MSI is enabled
    PCI/MSI: Export all remapped MSIs to sysfs attributes
    PCI: Disable MSI on SiS 761

    * pci/resource:
    sparc/PCI: Add mem64 resource parsing for root bus
    PCI: Expand Enhanced Allocation BAR output
    PCI: Make Enhanced Allocation bitmasks more obvious
    PCI: Handle Enhanced Allocation capability for SR-IOV devices
    PCI: Add support for Enhanced Allocation devices
    PCI: Add Enhanced Allocation register entries
    PCI: Handle IORESOURCE_PCI_FIXED when assigning resources
    PCI: Handle IORESOURCE_PCI_FIXED when sizing resources
    PCI: Clear IORESOURCE_UNSET when reverting to firmware-assigned address

    * pci/virtualization:
    PCI: Fix sriov_enable() error path for pcibios_enable_sriov() failures
    PCI: Wait 1 second between disabling VFs and clearing NumVFs
    PCI: Reorder pcibios_sriov_disable()
    PCI: Remove VFs in reverse order if virtfn_add() fails
    PCI: Remove redundant validation of SR-IOV offset/stride registers
    PCI: Set SR-IOV NumVFs to zero after enumeration
    PCI: Enable SR-IOV ARI Capable Hierarchy before reading TotalVFs
    PCI: Don't try to restore VF BARs

    Bjorn Helgaas
     
  • Add PCIe host support for HiSilicon SoC Hip05, related DT binding
    documentation, and maintainer update.

    [bhelgaas: changelog, 32-bit only config write warning text]
    Signed-off-by: Zhou Wang
    Signed-off-by: Gabriele Paoloni
    Signed-off-by: liudongdong
    Signed-off-by: Bjorn Helgaas
    Acked-by: Rob Herring (DT binding)

    Zhou Wang
     
  • Layerscape PCIe has its own MSI implementation.

    Register ls_pcie_msi_host_init() to avoid using DesignWare's MSI.

    [bhelgaas: add comment]
    Signed-off-by: Minghuan Lian
    Signed-off-by: Bjorn Helgaas

    Minghuan Lian
     
  • Both LS1043a and LS2080a are based on ARMv8 64-bit architecture and have
    similar PCIe implementation. LUT is added to controller.

    Add LS1043a and LS2080a support.

    [bhelgaas: move unused field removal into separate patch, include DT update]
    Signed-off-by: Bhupesh Sharma (DT update)
    Signed-off-by: Minghuan Lian
    Signed-off-by: Bjorn Helgaas
    Acked-by: Arnd Bergmann (DT update)

    Minghuan Lian
     
  • Removed unused node, dev, and bus fields from struct ls_pcie.

    [bhelgaas: split into separate patch]
    Signed-off-by: Minghuan Lian
    Signed-off-by: Bjorn Helgaas

    Minghuan Lian
     
  • Update the ls_add_pcie_port() signature to keep it consistent with the
    other DesignWare-based host drivers.

    Signed-off-by: Minghuan Lian
    Signed-off-by: Bjorn Helgaas

    Minghuan Lian
     
  • For the LS1021a PCIe controller, some status registers are located in SCFG,
    unlike other Layerscape devices.

    Move SCFG-related code to ls1021_pcie_host_init() and rename
    ls_pcie_link_up() to ls1021_pcie_link_up() because LTSSM status is also in
    SCFG.

    Signed-off-by: Minghuan Lian
    Signed-off-by: Bjorn Helgaas

    Minghuan Lian
     
  • Layerscape PCIe controller supports root complex (RC) and endpoint (EP)
    modes, which can be set by RCW.

    If not in RC mode, return -ENODEV without claiming the controller.

    Signed-off-by: Minghuan Lian
    Signed-off-by: Bjorn Helgaas

    Minghuan Lian
     
  • ls_pcie_establish_link() does not do any real operation, except to wait for
    the linkup establishment. In fact, this is not necessary. Moreover, each
    PCIe controller not inserted device will increase the Linux startup time
    about 200ms.

    Remove ls_pcie_establish_link().

    Signed-off-by: Minghuan Lian
    Signed-off-by: Bjorn Helgaas

    Minghuan Lian
     
  • Previously, dw_pcie_host_init() created the PCI host bridge with
    pci_common_init_dev(), an ARM-specific function that supplies the ARM-
    specific pci_sys_data structure as the PCI "sysdata".

    Make pcie-designware.c arch-agnostic by reimplementing the functionality of
    pci_common_init_dev() directly in dw_pcie_host_init().

    Note that this changes the bridge sysdata from the ARM pci_sys_data to the
    DesignWare pcie_port structure. This doesn't affect the ARM sysdata users
    because they are all specific to non-DesignWare host bridges, which will
    still have pci_sys_data.

    [bhelgaas: changelog]
    Tested-by: James Morse
    Tested-by: Gabriel Fernandez
    Tested-by: Minghuan Lian
    Signed-off-by: Zhou Wang
    Signed-off-by: Gabriele Paoloni
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Helgaas
    Acked-by: Pratyush Anand

    Zhou Wang
     
  • Use the new of_pci_get_host_bridge_resources() API in place of the PCI OF
    DT parser.

    [bhelgaas: changelog]
    Tested-by: James Morse
    Tested-by: Gabriel Fernandez
    Tested-by: Minghuan Lian
    Signed-off-by: Zhou Wang
    Signed-off-by: Gabriele Paoloni
    Signed-off-by: Bjorn Helgaas
    Acked-by: Pratyush Anand

    Zhou Wang
     
  • Revert f4c55c5a3f7f ("PCI: designware: Program ATU with untranslated
    address").

    Note that dra7xx_pcie_host_init() now modifies pp->io_base, but we still
    need the original value for dw_pcie_setup() in the path below, so this adds
    a new io_base_tmp member. It will be removed later when dw_pcie_setup() is
    removed.

    dra7xx_add_pcie_port
    dw_pcie_host_init
    pp->io_base = range.cpu_addr
    pp->io_base_tmp = range.cpu_addr # ops->host_init
    dra7xx_pcie_host_init # ops->host_init
    pp->io_base &= DRA7XX_CPU_TO_BUS_ADDR # setup
    dw_pcie_setup # hw_pci.setup
    pci_ioremap_io(..., pp->io_base_tmp) #
    Tested-by: Gabriel Fernandez
    Tested-by: Minghuan Lian
    Signed-off-by: Zhou Wang
    Signed-off-by: Gabriele Paoloni
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Helgaas
    Acked-by: Pratyush Anand

    Zhou Wang
     
  • Commit f4c55c5a3f7f ("PCI: designware: Program ATU with untranslated
    address") added the calculation of PCI bus addresses in pcie-designware.c,
    storing them in new fields added in struct pcie_port. This calculation is
    done for every DesignWare user even though it only applies to DRA7xx.

    Move the calculation of the bus addresses to the DRA7xx driver to allow the
    rework of DesignWare to use the new DT parsing API.

    Signed-off-by: Gabriele Paoloni
    Signed-off-by: Zhou Wang
    Signed-off-by: Bjorn Helgaas
    Acked-by: Pratyush Anand

    Gabriele Paoloni
     
  • Currently "num-lanes" is read in dw_pcie_host_init(), but it is only used
    if we call dw_pcie_setup_rc() while bringing up the link. If the link has
    already been brought up by firmware, we need not call dw_pcie_setup_rc(),
    and "num-lanes" is unnecessary.

    Only complain about "num-lanes" if we actually need it and we didn't find a
    valid value.

    [bhelgaas: changelog]
    Signed-off-by: Gabriele Paoloni
    Signed-off-by: Bjorn Helgaas

    Gabriele Paoloni