22 Jan, 2016

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "PCI changes for the v4.5 merge window:

    Enumeration:
    - Simplify config space size computation (Bjorn Helgaas)
    - Avoid iterating through ROM outside the resource window (Edward O'Callaghan)
    - Support PCIe devices with short cfg_size (Jason S. McMullan)
    - Add Netronome vendor and device IDs (Jason S. McMullan)
    - Limit config space size for Netronome NFP6000 family (Jason S. McMullan)
    - Add Netronome NFP4000 PF device ID (Simon Horman)
    - Limit config space size for Netronome NFP4000 (Simon Horman)
    - Print warnings for all invalid expansion ROM headers (Vladis Dronov)

    Resource management:
    - Fix minimum allocation address overwrite (Christoph Biedl)

    PCI device hotplug:
    - acpiphp_ibm: Fix null dereferences on null ibm_slot (Colin Ian King)
    - pciehp: Always protect pciehp_disable_slot() with hotplug mutex (Guenter Roeck)
    - shpchp: Constify hpc_ops structure (Julia Lawall)
    - ibmphp: Remove unneeded NULL test (Julia Lawall)

    Power management:
    - Make ASPM sysfs link_state_store() consistent with link_state_show() (Andy Lutomirski)

    Virtualization
    - Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183 (Tim Sander)

    MSI:
    - Remove empty pci_msi_init_pci_dev() (Bjorn Helgaas)
    - Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD (Grygorii Strashko)
    - Initialize MSI capability for all architectures (Guilherme G. Piccoli)
    - Relax msi_domain_alloc() to support parentless MSI irqdomains (Liu Jiang)

    ARM Versatile host bridge driver:
    - Remove unused pci_sys_data structures (Lorenzo Pieralisi)

    Broadcom iProc host bridge driver:
    - Hide CONFIG_PCIE_IPROC (Arnd Bergmann)
    - Do not use 0x in front of %pap (Dmitry V. Krivenok)
    - Update iProc PCIe device tree binding (Ray Jui)
    - Add PAXC interface support (Ray Jui)
    - Add iProc PCIe MSI device tree binding (Ray Jui)
    - Add iProc PCIe MSI support (Ray Jui)

    Freescale i.MX6 host bridge driver:
    - Use gpio_set_value_cansleep() (Fabio Estevam)
    - Add support for active-low reset GPIO (Petr Štetiar)

    HiSilicon host bridge driver:
    - Add support for HiSilicon Hip06 PCIe host controllers (Gabriele Paoloni)

    Intel VMD host bridge driver:
    - Export irq_domain_set_info() for module use (Keith Busch)
    - x86/PCI: Allow DMA ops specific to a PCI domain (Keith Busch)
    - Use 32 bit PCI domain numbers (Keith Busch)
    - Add driver for Intel Volume Management Device (VMD) (Keith Busch)

    Qualcomm host bridge driver:
    - Document PCIe devicetree bindings (Stanimir Varbanov)
    - Add Qualcomm PCIe controller driver (Stanimir Varbanov)
    - dts: apq8064: add PCIe devicetree node (Stanimir Varbanov)
    - dts: ifc6410: enable PCIe DT node for this board (Stanimir Varbanov)

    Renesas R-Car host bridge driver:
    - Add support for R-Car H3 to pcie-rcar (Harunobu Kurokawa)
    - Allow DT to override default window settings (Phil Edworthy)
    - Convert to DT resource parsing API (Phil Edworthy)
    - Revert "PCI: rcar: Build pcie-rcar.c only on ARM" (Phil Edworthy)
    - Remove unused pci_sys_data struct from pcie-rcar (Phil Edworthy)
    - Add runtime PM support to pcie-rcar (Phil Edworthy)
    - Add Gen2 PHY setup to pcie-rcar (Phil Edworthy)
    - Add gen2 fallback compatibility string for pci-rcar-gen2 (Simon Horman)
    - Add gen2 fallback compatibility string for pcie-rcar (Simon Horman)

    Synopsys DesignWare host bridge driver:
    - Simplify control flow (Bjorn Helgaas)
    - Make config accessor override checking symmetric (Bjorn Helgaas)
    - Ensure ATU is enabled before IO/conf space accesses (Stanimir Varbanov)

    Miscellaneous:
    - Add of_pci_get_host_bridge_resources() stub (Arnd Bergmann)
    - Check for PCI_HEADER_TYPE_BRIDGE equality, not bitmask (Bjorn Helgaas)
    - Fix all whitespace issues (Bogicevic Sasa)
    - x86/PCI: Simplify pci_bios_{read,write} (Geliang Tang)
    - Use to_pci_dev() instead of open-coding it (Geliang Tang)
    - Use kobj_to_dev() instead of open-coding it (Geliang Tang)
    - Use list_for_each_entry() to simplify code (Geliang Tang)
    - Fix typos in (Thomas Petazzoni)
    - x86/PCI: Clarify AMD Fam10h config access restrictions comment (Tomasz Nowicki)"

    * tag 'pci-v4.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (58 commits)
    PCI: Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183
    PCI: Limit config space size for Netronome NFP4000
    PCI: Add Netronome NFP4000 PF device ID
    x86/PCI: Add driver for Intel Volume Management Device (VMD)
    PCI/AER: Use 32 bit PCI domain numbers
    x86/PCI: Allow DMA ops specific to a PCI domain
    irqdomain: Export irq_domain_set_info() for module use
    PCI: host: Add of_pci_get_host_bridge_resources() stub
    genirq/MSI: Relax msi_domain_alloc() to support parentless MSI irqdomains
    PCI: rcar: Add Gen2 PHY setup to pcie-rcar
    PCI: rcar: Add runtime PM support to pcie-rcar
    PCI: designware: Make config accessor override checking symmetric
    PCI: ibmphp: Remove unneeded NULL test
    ARM: dts: ifc6410: enable PCIe DT node for this board
    ARM: dts: apq8064: add PCIe devicetree node
    PCI: hotplug: Use list_for_each_entry() to simplify code
    PCI: rcar: Remove unused pci_sys_data struct from pcie-rcar
    PCI: hisi: Add support for HiSilicon Hip06 PCIe host controllers
    PCI: Avoid iterating through memory outside the resource window
    PCI: acpiphp_ibm: Fix null dereferences on null ibm_slot
    ...

    Linus Torvalds
     

20 Dec, 2015

1 commit

  • The Linux kernel already has the concept of IRQ domain, wherein a
    component can expose a set of IRQs which are managed by a particular
    interrupt controller chip or other subsystem. The PCI driver exposes
    the notion of an IRQ domain for Message-Signaled Interrupts (MSI) from
    PCI Express devices. This patch exposes the functions which are
    necessary for creating a MSI IRQ domain within a module.

    [ tglx: Split it into x86 and core irq parts ]

    Signed-off-by: Jake Oshins
    Cc: gregkh@linuxfoundation.org
    Cc: kys@microsoft.com
    Cc: devel@linuxdriverproject.org
    Cc: olaf@aepfle.de
    Cc: apw@canonical.com
    Cc: vkuznets@redhat.com
    Cc: haiyangz@microsoft.com
    Cc: marc.zyngier@arm.com
    Cc: bhelgaas@google.com
    Link: http://lkml.kernel.org/r/1449769983-12948-4-git-send-email-jakeo@microsoft.com
    Signed-off-by: Thomas Gleixner

    Jake Oshins
     

05 Dec, 2015

1 commit

  • 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
     

01 Dec, 2015

1 commit


07 Nov, 2015

1 commit

  • 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
     

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

1 commit

  • …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
     

16 Oct, 2015

4 commits

  • So far, we've always considered that for a given PCI device, its
    MSI controller was either set by the architecture-specific
    pcibios hook, or simply inherited from the host bridge.

    This doesn't cover things like firmware-defined topologies like
    msi-map (DT) or IORT (ACPI), which can provide information about
    which MSI controller to use on a per-device basis.

    This patch adds the necessary hook into the MSI code to allow this
    feature, and provides the msi-map functionnality as a first
    implementation.

    Acked-by: Rob Herring
    Acked-by: Bjorn Helgaas
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • Add pci_msi_domain_get_msi_rid() to return the MSI requester id (RID).
    Initially needed by gic-v3 based systems. It will be used by follow on
    patch to drivers/irqchip/irq-gic-v3-its-pci-msi.c

    Initially supports mapping the RID via OF device tree. In the future,
    this could be extended to use ACPI _IORT tables as well.

    Reviewed-by: Marc Zyngier
    Acked-by: Bjorn Helgaas
    Signed-off-by: David Daney
    Signed-off-by: Marc Zyngier

    David Daney
     
  • When we create a generic MSI domain, that MSI_FLAG_USE_DEF_CHIP_OPS
    is set, and that any of .mask or .unmask are NULL in the irq_chip
    structure, we set them to pci_msi_[un]mask_irq.

    This is a bad idea for at least two reasons:
    - PCI_MSI might not be selected, kernel fails to build (yes, this is
    legitimate, at least on arm64!)
    - This may not be a PCI/MSI domain at all (platform MSI, for example)

    Either way, this looks wrong. Move the overriding of mask/unmask to
    the PCI counterpart, and panic is any of these two methods is not
    set in the core code (they really should be present).

    Signed-off-by: Marc Zyngier
    Cc: Jiang Liu
    Cc: Bjorn Helgaas
    Link: http://lkml.kernel.org/r/1444760085-27857-1-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     
  • irqbalance uses sysfs attributes to populate its internal database, which
    is then used to bind the IRQ to the appropriate NUMA node.

    On a device accepting multiple MSIs and with interrupt remapping enabled,
    only the first IRQ entry is exported in the "msi_irqs" directory. This
    results in irqbalance having no clue of the NUMA affinity for the extra
    IRQs, so it can't bind them to the correct node.

    Export all MSI interrupts as sysfs attributes when relevant.

    [bhelgaas: changelog]
    Signed-off-by: Romain Bezut
    Signed-off-by: Bjorn Helgaas
    Acked-by: Thomas Gleixner

    Romain Bezut
     

14 Oct, 2015

1 commit

  • As we continue to push of_node towards the outskirts of irq domains,
    let's start tackling the case of msi_create_irq_domain and its little
    friends.

    This has limited impact in both PCI/MSI, platform MSI, and a few
    drivers.

    Signed-off-by: Marc Zyngier
    Tested-by: Hanjun Guo
    Tested-by: Lorenzo Pieralisi
    Cc:
    Cc: Tomasz Nowicki
    Cc: Suravee Suthikulpanit
    Cc: Graeme Gregory
    Cc: Jake Oshins
    Cc: Jiang Liu
    Cc: Jason Cooper
    Cc: Rafael J. Wysocki
    Link: http://lkml.kernel.org/r/1444737105-31573-17-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

19 Sep, 2015

1 commit


02 Sep, 2015

1 commit

  • Pull irq updates from Thomas Gleixner:
    "This updated pull request does not contain the last few GIC related
    patches which were reported to cause a regression. There is a fix
    available, but I let it breed for a couple of days first.

    The irq departement provides:

    - new infrastructure to support non PCI based MSI interrupts
    - a couple of new irq chip drivers
    - the usual pile of fixlets and updates to irq chip drivers
    - preparatory changes for removal of the irq argument from interrupt
    flow handlers
    - preparatory changes to remove IRQF_VALID"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (129 commits)
    irqchip/imx-gpcv2: IMX GPCv2 driver for wakeup sources
    irqchip: Add bcm2836 interrupt controller for Raspberry Pi 2
    irqchip: Add documentation for the bcm2836 interrupt controller
    irqchip/bcm2835: Add support for being used as a second level controller
    irqchip/bcm2835: Refactor handle_IRQ() calls out of MAKE_HWIRQ
    PCI: xilinx: Fix typo in function name
    irqchip/gic: Ensure gic_cpu_if_up/down() programs correct GIC instance
    irqchip/gic: Only allow the primary GIC to set the CPU map
    PCI/MSI: pci-xgene-msi: Consolidate chained IRQ handler install/remove
    unicore32/irq: Prepare puv3_gpio_handler for irq argument removal
    tile/pci_gx: Prepare trio_handle_level_irq for irq argument removal
    m68k/irq: Prepare irq handlers for irq argument removal
    C6X/megamode-pic: Prepare megamod_irq_cascade for irq argument removal
    blackfin: Prepare irq handlers for irq argument removal
    arc/irq: Prepare idu_cascade_isr for irq argument removal
    sparc/irq: Use access helper irq_data_get_affinity_mask()
    sparc/irq: Use helper irq_data_get_irq_handler_data()
    parisc/irq: Use access helper irq_data_get_affinity_mask()
    mn10300/irq: Use access helper irq_data_get_affinity_mask()
    irqchip/i8259: Prepare i8259_irq_dispatch for irq argument removal
    ...

    Linus Torvalds
     

29 Aug, 2015

1 commit

  • * pci/enumeration:
    PCI: Set MPS to match upstream bridge
    PCI: Move MPS configuration check to pci_configure_device()
    PCI: Drop references acquired by of_parse_phandle()
    PCI/MSI: Remove unused pcibios_msi_controller() hook
    ARM/PCI: Remove msi_controller from struct pci_sys_data
    ARM/PCI, designware, xilinx: Use pci_scan_root_bus_msi()
    PCI: Add pci_scan_root_bus_msi()
    ARM/PCI: Replace panic with WARN messages on failures
    PCI: generic: Add arm64 support
    PCI: Build setup-irq.o for arm64
    PCI: generic: Remove dependency on ARM-specific struct hw_pci
    ARM/PCI: Set MPS before pci_bus_add_devices()

    * pci/misc:
    PCI: Disable async suspend/resume for JMicron multi-function SATA/AHCI

    Bjorn Helgaas
     

21 Aug, 2015

1 commit


31 Jul, 2015

1 commit

  • Once MSI/MSI-X is enabled by the device driver, a PCI device won't use
    legacy IRQs again until MSI/MSI-X is disabled.

    Call pcibios_free_irq() when enabling MSI/MSI-X and pcibios_alloc_irq()
    when disabling MSI/MSI-X. This allows arch code to manage resources
    associated with the legacy IRQ.

    [bhelgaas: changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Bjorn Helgaas
    Acked-by: Thomas Gleixner

    Jiang Liu
     

30 Jul, 2015

3 commits

  • The only three users of that field are not using the msi_controller
    structure anymore, so drop it altogether.

    Acked-by: Bjorn Helgaas
    Signed-off-by: Marc Zyngier
    Cc:
    Cc: Yijing Wang
    Cc: Ma Jun
    Cc: Lorenzo Pieralisi
    Cc: Duc Dang
    Cc: Hanjun Guo
    Cc: Jiang Liu
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1438091186-10244-20-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     
  • Now that we can easily find which MSI domain a PCI device is
    using, use dev_get_msi_domain as a way to retrieve the information.

    The original code is still used as a fallback.

    Acked-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Signed-off-by: Marc Zyngier
    Cc:
    Cc: Yijing Wang
    Cc: Ma Jun
    Cc: Lorenzo Pieralisi
    Cc: Duc Dang
    Cc: Jiang Liu
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1438091186-10244-8-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     
  • When creating a PCI/MSI domain, tag it with DOMAIN_BUS_PCI_MSI so
    that it can be looked-up using irq_find_matching_host().

    Acked-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Signed-off-by: Marc Zyngier
    Cc:
    Cc: Yijing Wang
    Cc: Ma Jun
    Cc: Lorenzo Pieralisi
    Cc: Duc Dang
    Cc: Jiang Liu
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1438091186-10244-3-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

23 Jul, 2015

6 commits

  • Move alloc_msi_entry() from PCI MSI code into generic MSI code, so it
    can be reused by other generic MSI drivers. Also introduce
    free_msi_entry() for completeness.

    Suggested-by: Stuart Yoder .
    Signed-off-by: Jiang Liu
    Reviewed-by: Marc Zyngier
    Reviewed-by: Yijing Wang
    Acked-by: Bjorn Helgaas
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Grant Likely
    Cc: Borislav Petkov
    Cc: Alexander Gordeev
    Link: http://lkml.kernel.org/r/1436428847-8886-13-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Store 'struct device *' instead of 'struct pci_dev *' in struct msi_desc,
    so struct msi_desc can be reused by non PCI based MSI drivers.

    Signed-off-by: Jiang Liu
    Reviewed-by: Yijing Wang
    Reviewed-by: Marc Zyngier
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Bjorn Helgaas
    Cc: Grant Likely
    Cc: Stuart Yoder
    Cc: Borislav Petkov
    Cc: Alexander Gordeev
    Link: http://lkml.kernel.org/r/1436428847-8886-11-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Move msi_list from struct pci_dev into struct device, so we can
    support non-PCI-device based generic MSI interrupts.

    msi_list is now conditional under CONFIG_GENERIC_MSI_IRQ, which is
    selected from CONFIG_PCI_MSI, so no functional change for PCI MSI
    users.

    Signed-off-by: Jiang Liu
    Reviewed-by: Yijing Wang
    Acked-by: Bjorn Helgaas
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Stuart Yoder
    Cc: Borislav Petkov
    Cc: Greg Kroah-Hartman
    Cc: Joe Perches
    Cc: Dmitry Torokhov
    Cc: Paul Gortmaker
    Cc: Luis R. Rodriguez
    Cc: Rafael J. Wysocki
    Cc: Joerg Roedel
    Cc: Alexander Gordeev
    Link: http://lkml.kernel.org/r/1436428847-8886-10-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Use helper functions to access fields in struct msi_desc, so we could
    easily refine msi_desc later.

    Signed-off-by: Jiang Liu
    Reviewed-by: Yijing Wang
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Bjorn Helgaas
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Stuart Yoder
    Cc: Borislav Petkov
    Cc: Murali Karicheri
    Cc: Jingoo Han
    Cc: Pratyush Anand
    Cc: Michal Simek
    Cc: Soeren Brinkmann
    Cc: Srikanth Thokala
    Cc: Rob Herring
    Link: http://lkml.kernel.org/r/1436428847-8886-9-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Use accessor for_each_pci_msi_entry() to access MSI device list, so we
    could easily move msi_list from struct pci_dev into struct device
    later.

    Signed-off-by: Jiang Liu
    Reviewed-by: Yijing Wang
    Acked-by: Bjorn Helgaas
    Acked-by: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: xen-devel@lists.xenproject.org
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Stuart Yoder
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: David Vrabel
    Link: http://lkml.kernel.org/r/1436428847-8886-7-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Add helper function msi_desc_to_pci_sysdata() to retrieve sysdata from
    an MSI descriptor. To avoid pulling include/linux/pci.h into
    include/linux/msi.h, msi_desc_to_pci_sysdata() is implemented as a normal
    function instead of an inline function.

    Signed-off-by: Jiang Liu
    Reviewed-by: Yijing Wang
    Acked-by: Bjorn Helgaas
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Stuart Yoder
    Cc: Borislav Petkov
    Cc: Alexander Gordeev
    Link: http://lkml.kernel.org/r/1436428847-8886-2-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     

17 Jul, 2015

2 commits


07 May, 2015

3 commits

  • If we enable MSI, then kexec a new kernel, the new kernel may receive MSIs
    it is not prepared for. Commit d5dea7d95c48 ("PCI: msi: Disable msi
    interrupts when we initialize a pci device") prevents this, but only if the
    new kernel is built with CONFIG_PCI_MSI=y.

    Move the "disable MSI" functionality from drivers/pci/msi.c to a new
    pci_msi_setup_pci_dev() in drivers/pci/probe.c so we can disable MSIs when
    we enumerate devices even if the kernel doesn't include full MSI support.

    [bhelgaas: changelog, disable MSIs in pci_setup_device(), put
    pci_msi_setup_pci_dev() at its final destination]
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Bjorn Helgaas

    Michael S. Tsirkin
     
  • Move pci_msi_set_enable() and pci_msix_clear_and_set_ctrl() to
    drivers/pci/pci.h so they're available even when MSI isn't configured
    into the kernel.

    No functional change.

    [bhelgaas: changelog, split into separate patch]
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Fam Zheng

    Michael S. Tsirkin
     
  • Rename msi_set_enable() to pci_msi_set_enable() and
    msix_clear_and_set_ctrl() to pci_msix_clear_and_set_ctrl().

    No functional change.

    [bhelgaas: changelog, split into separate patch]
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Fam Zheng

    Michael S. Tsirkin
     

28 Jan, 2015

1 commit

  • Unlike MSI, which is configured via registers in the MSI capability in
    Configuration Space, MSI-X is configured via tables in Memory Space.
    These MSI-X tables are mapped by a device BAR, and if no Memory Space
    has been assigned to the BAR, MSI-X cannot be used.

    Fail MSI-X setup if no space has been assigned for the BAR.

    Previously, we ioremapped the MSI-X table even if the resource hadn't been
    assigned. In this case, the resource address is undefined (and is often
    zero), which may lead to warnings or oopses in this path:

    pci_enable_msix
    msix_capability_init
    msix_map_region
    ioremap_nocache

    The PCI core sets resource flags to zero when it can't assign space for the
    resource (see reset_resource()). There are also some cases where it sets
    the IORESOURCE_UNSET flag, e.g., pci_reassigndev_resource_alignment(),
    pci_assign_resource(), etc. So we must check for both cases.

    [bhelgaas: changelog]
    Reported-by: Zhang Jukuo
    Tested-by: Zhang Jukuo
    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas

    Yijing Wang
     

11 Dec, 2014

1 commit

  • Pull irq domain updates from Thomas Gleixner:
    "The real interesting irq updates:

    - Support for hierarchical irq domains:

    For complex interrupt routing scenarios where more than one
    interrupt related chip is involved we had no proper representation
    in the generic interrupt infrastructure so far. That made people
    implement rather ugly constructs in their nested irq chip
    implementations. The main offenders are x86 and arm/gic.

    To distangle that mess we have now hierarchical irqdomains which
    seperate the various interrupt chips and connect them via the
    hierarchical domains. That keeps the domain specific details
    internal to the particular hierarchy level and removes the
    criss/cross referencing of chip internals. The resulting hierarchy
    for a complex x86 system will look like this:

    vector mapped: 74
    msi-0 mapped: 2
    dmar-ir-1 mapped: 69
    ioapic-1 mapped: 4
    ioapic-0 mapped: 20
    pci-msi-2 mapped: 45
    dmar-ir-0 mapped: 3
    ioapic-2 mapped: 1
    pci-msi-1 mapped: 2
    htirq mapped: 0

    Neither ioapic nor pci-msi know about the dmar interrupt remapping
    between themself and the vector domain. If interrupt remapping is
    disabled ioapic and pci-msi become direct childs of the vector
    domain.

    In hindsight we should have done that years ago, but in hindsight
    we always know better :)

    - Support for generic MSI interrupt domain handling

    We have more and more non PCI related MSI interrupts, so providing
    a generic infrastructure for this is better than having all
    affected architectures implementing their own private hacks.

    - Support for PCI-MSI interrupt domain handling, based on the generic
    MSI support.

    This part carries the pci/msi branch from Bjorn Helgaas pci tree to
    avoid a massive conflict. The PCI/MSI parts are acked by Bjorn.

    I have two more branches on top of this. The full conversion of x86
    to hierarchical domains and a partial conversion of arm/gic"

    * 'irq-irqdomain-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
    genirq: Move irq_chip_write_msi_msg() helper to core
    PCI/MSI: Allow an msi_controller to be associated to an irq domain
    PCI/MSI: Provide mechanism to alloc/free MSI/MSIX interrupt from irqdomain
    PCI/MSI: Enhance core to support hierarchy irqdomain
    PCI/MSI: Move cached entry functions to irq core
    genirq: Provide default callbacks for msi_domain_ops
    genirq: Introduce msi_domain_alloc/free_irqs()
    asm-generic: Add msi.h
    genirq: Add generic msi irq domain support
    genirq: Introduce callback irq_chip.irq_write_msi_msg
    genirq: Work around __irq_set_handler vs stacked domains ordering issues
    irqdomain: Introduce helper function irq_domain_add_hierarchy()
    irqdomain: Implement a method to automatically call parent domains alloc/free
    genirq: Introduce helper irq_domain_set_info() to reduce duplicated code
    genirq: Split out flow handler typedefs into seperate header file
    genirq: Add IRQ_SET_MASK_OK_DONE to support stacked irqchip
    genirq: Introduce irq_chip.irq_compose_msi_msg() to support stacked irqchip
    genirq: Add more helper functions to support stacked irq_chip
    genirq: Introduce helper functions to support stacked irq_chip
    irqdomain: Do irq_find_mapping and set_type for hierarchy irqdomain in case OF
    ...

    Linus Torvalds
     

24 Nov, 2014

2 commits

  • This can be set by quirks/drivers to be used by the architecture code
    that assigns the MSI addresses.

    We additionally add verification in the core MSI code that the values
    assigned by the architecture do satisfy the limitation in order to fail
    gracefully if they don't (ie. the arch hasn't been updated to deal with
    that quirk yet).

    Signed-off-by: Benjamin Herrenschmidt
    CC:
    Acked-by: Bjorn Helgaas

    Benjamin Herrenschmidt
     
  • With the new stacked irq domains, it becomes pretty tempting to
    allocate an MSI domain per PCI bus, which would remove the requirement
    of either relying on arch-specific code, or a default PCI MSI domain.

    By allowing the msi_controller structure to carry a pointer to an
    irq_domain, we can easily use this in pci_msi_setup_msi_irqs. The
    existing code can still be used as a fallback if the MSI driver does
    not populate the domain field.

    Tested on arm64 with the GICv3 ITS driver.

    Signed-off-by: Marc Zyngier
    Cc: Yingjoe Chen
    Cc: Bjorn Helgaas
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Jiang Liu
    Link: http://lkml.kernel.org/r/1416048553-29289-2-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

23 Nov, 2014

5 commits

  • Provide mechanism to directly alloc/free MSI/MSIX interrupt from
    irqdomain, which will be used to replace arch_setup_msi_irq()/
    arch_setup_msi_irqs()/arch_teardown_msi_irq()/arch_teardown_msi_irqs().

    To kill weak functions, this patch introduce a new weak function
    arch_get_pci_msi_domain(), which is to retrieve the MSI irqdomain
    for a PCI device. This weak function could be killed once we get
    a common way to associate MSI domain with PCI device.

    Signed-off-by: Jiang Liu
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Bjorn Helgaas
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Yijing Wang
    Cc: Yingjoe Chen
    Cc: Borislav Petkov
    Cc: Matthias Brugger
    Cc: Alexander Gordeev
    Link: http://lkml.kernel.org/r/1416061447-9472-10-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Enhance PCI MSI core to support hierarchy irqdomain, so the common
    code can be shared across architectures.

    [ tglx: Extracted and combined from several patches ]

    Signed-off-by: Jiang Liu
    Cc: Bjorn Helgaas
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Yingjoe Chen
    Cc: Yijing Wang
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • Required to support non PCI based MSI.

    [ tglx: Extracted from Jiangs patch series ]

    Signed-off-by: Jiang Liu
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     
  • mask/unmask_msi_irq and __mask_msi/msix_irq are PCI/MSI specific
    functions and should be named accordingly. This is a preparatory patch
    to support MSI on non PCI devices.

    Rename mask/unmask_msi_irq to pci_msi_mask/unmask_irq and document the
    functions. Provide conversion helpers.

    Rename __mask_msi/msix_irq to __pci_msi/msix_desc_mask so its clear
    that they operated on msi_desc. Fixup the only user outside of
    pci/msi.

    Signed-off-by: Thomas Gleixner
    Cc: Bjorn Helgaas
    Cc: Jiang Liu
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Yijing Wang
    Cc: Heiko Carstens

    Thomas Gleixner
     
  • Rename write_msi_msg() to pci_write_msi_msg() to mark it as PCI
    specific.

    Signed-off-by: Jiang Liu
    Cc: Bjorn Helgaas
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Yingjoe Chen
    Cc: Yijing Wang
    Signed-off-by: Thomas Gleixner

    Jiang Liu