J. German Rivera
550308e48c
fsl-mc: msi: Added FSL-MC-specific member to the msi_desc's union
...
FSL-MC is a bus type different from PCI and platform, so it needs
its own member in the msi_desc's union.
Signed-off-by: J. German Rivera <German.Rivera@freescale.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2016-02-07 19:10:12 -08:00
Linus Torvalds
d43421565b
Merge tag 'pci-v4.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
...
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 <linux/msi.h> (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
...
2016-01-21 11:52:16 -08:00
Thomas Petazzoni
1d1e8cdc82
PCI/MSI: Fix typos in <linux/msi.h>
...
Fix two comment typos in the <linux/msi.h> header.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
2016-01-07 11:46:31 -06:00
Marc Zyngier
552c494a76
platform-msi: Allow creation of a MSI-based stacked irq domain
...
We almost have all the needed bits requiredable to create a irq domain
on top of a MSI domain.
For this, we enable a few things:
- the virq is stored in the msi_desc
- device, msi_alloc_info and domain-specific data
are stored in the platform_priv_data structure
- we introduce a new API for platform-msi:
/* Create a MSI-based domain */
struct irq_domain *
platform_msi_create_device_domain(struct device *dev,
unsigned int nvec,
irq_write_msi_msg_t write_msi_msg,
const struct irq_domain_ops *ops,
void *host_data);
/* Allocate MSIs in an MSI domain */
int platform_msi_domain_alloc(struct irq_domain *domain,
unsigned int virq,
unsigned int nr_irqs);
/* Free MSIs from an MSI domain */
void platform_msi_domain_free(struct irq_domain *domain,
unsigned int virq,
unsigned int nvec);
/* Obtain the host data passed to platform_msi_create_device_domain */
void *platform_msi_get_host_data(struct irq_domain *domain);
platform_msi_create_device_domain() is a hybrid of irqdomain creation
and interrupt allocation, creating a domain backed by the MSIs associated
to a device. IRQs can then be allocated in that domain using
platform_msi_domain_alloc().
This now allows a wired irq to MSI bridge to be created.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
2015-12-16 15:29:44 +00:00
Marc Zyngier
2145ac9310
genirq/msi: Add msi_domain_populate_irqs
...
To be able to allocate interrupts from the MSI layer down,
add a new msi_domain_populate_irqs entry point.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
2015-12-16 15:29:44 +00:00
Marc Zyngier
b2eba39bca
genirq/msi: Make the .prepare callback reusable
...
The .prepare callbacks are so far only called from msi_domain_alloc_irqs.
In order to reuse that code, split that code and create a
msi_domain_prepare_irqs function that the existing code can call into.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
2015-12-16 15:29:44 +00:00
Linus Torvalds
3c87b79188
Merge tag 'pci-v4.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
...
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
...
2015-11-06 11:29:53 -08:00
Marc Zyngier
54fa97eeb9
PCI/MSI: Allow the MSI domain to be device-specific
...
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 <robh@kernel.org >
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
2015-10-16 13:07:16 +01:00
David Daney
b6eec9b717
PCI/MSI: Add helper function pci_msi_domain_get_msi_rid().
...
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 <marc.zyngier@arm.com >
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Signed-off-by: David Daney <david.daney@cavium.com >
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
2015-10-16 13:07:12 +01:00
Marc Zyngier
be5436c83a
irqdomain/msi: Use fwnode instead of of_node
...
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 <marc.zyngier@arm.com >
Tested-by: Hanjun Guo <hanjun.guo@linaro.org >
Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: <linux-arm-kernel@lists.infradead.org >
Cc: Tomasz Nowicki <tomasz.nowicki@linaro.org >
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com >
Cc: Graeme Gregory <graeme@xora.org.uk >
Cc: Jake Oshins <jakeo@microsoft.com >
Cc: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Rafael J. Wysocki <rjw@rjwysocki.net >
Link: http://lkml.kernel.org/r/1444737105-31573-17-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-10-13 19:01:25 +02:00
Lucas Stach
339e5b44ed
PCI: Add msi_controller setup_irqs() method for special multivector setup
...
Add a msi_controller setup_irqs() method so MSI chip providers can
implement their own multivector MSI setup.
[bhelgaas: changelog]
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Reviewed-by: Pratyush Anand <pratyush.anand@gmail.com >
2015-09-18 13:58:34 -05:00
Marc Zyngier
f075915ac0
PCI/MSI: Drop domain field from msi_controller
...
The only three users of that field are not using the msi_controller
structure anymore, so drop it altogether.
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
Cc: <linux-arm-kernel@lists.infradead.org >
Cc: Yijing Wang <wangyijing@huawei.com >
Cc: Ma Jun <majun258@huawei.com >
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: Duc Dang <dhdang@apm.com >
Cc: Hanjun Guo <hanjun.guo@linaro.org >
Cc: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Jason Cooper <jason@lakedaemon.net >
Link: http://lkml.kernel.org/r/1438091186-10244-20-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-07-30 00:14:39 +02:00
Marc Zyngier
c09fcc4b2b
drivers/base: Add MSI domain support for non-PCI devices
...
With the msi_list and the msi_domain properties now being at the
generic device level, it is starting to be relatively easy to offer
a generic way of providing non-PCI MSIs.
The two major hurdles with this idea are:
- Lack of global ID that identifies a device: this is worked around by
having a global ID allocator for each device that gets enrolled in
the platform MSI subsystem
- Lack of standard way to write the message in the generating device.
This is solved by mandating driver code to provide a write_msg
callback, so that everyone can have their own square wheel
Apart from that, the API is fairly straightforward:
- platform_msi_create_irq_domain creates an MSI domain that gets
tagged with DOMAIN_BUS_PLATFORM_MSI
- platform_msi_domain_alloc_irqs allocate MSIs for a given device,
populating the msi_list
- platform_msi_domain_free_irqs does what is written on the tin
[ tglx: Created a seperate struct platform_msi_desc and added
kerneldoc entries ]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
Cc: <linux-arm-kernel@lists.infradead.org >
Cc: Yijing Wang <wangyijing@huawei.com >
Cc: Ma Jun <majun258@huawei.com >
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
Cc: Duc Dang <dhdang@apm.com >
Cc: Hanjun Guo <hanjun.guo@linaro.org >
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Jason Cooper <jason@lakedaemon.net >
Link: http://lkml.kernel.org/r/1438091186-10244-10-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-07-30 00:14:38 +02:00
Jiang Liu
aa48b6f708
genirq/MSI: Move alloc_msi_entry() from PCI into generic MSI code
...
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 <stuart.yoder@freescale.com >.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com >
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com >
Reviewed-by: Yijing Wang <wangyijing@huawei.com >
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1436428847-8886-13-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-07-22 18:37:44 +02:00
Jiang Liu
fc88419cfa
genirq/MSI: Reorginize struct msi_desc to prepare for support of generic MSI
...
Reorganize struct msi_desc so it could be reused by other MSI
drivers. We have the following layout now:
struct msi_desc {
/* Shared device/bus independent data */
...
union {
/* PCI specific data */
struct {
...
};
};
};
We need to have anonymous union and a anonymous structure for the PCI
fields, otherwise we would have to change all instances using these
fields.
For non PCI devices we will enforce a proper namespace and a non
anonymous structure.
[ tglx: Added proper comments to the structure and massaged changelog ]
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com >
Reviewed-by: Yijing Wang <wangyijing@huawei.com >
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Stuart Yoder <stuart.yoder@freescale.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1436428847-8886-12-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-07-22 18:37:44 +02:00
Jiang Liu
25a98bd4ff
genirq/MSI: Store 'struct device' instead of 'struct pci_dev' in struct msi_desc
...
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 <jiang.liu@linux.intel.com >
Reviewed-by: Yijing Wang <wangyijing@huawei.com >
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Stuart Yoder <stuart.yoder@freescale.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1436428847-8886-11-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-07-22 18:37:43 +02:00
Jiang Liu
4a7cc83167
genirq/MSI: Move msi_list from struct pci_dev to struct device
...
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 <jiang.liu@linux.intel.com >
Reviewed-by: Yijing Wang <wangyijing@huawei.com >
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Stuart Yoder <stuart.yoder@freescale.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Joe Perches <joe@perches.com >
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com >
Cc: Paul Gortmaker <paul.gortmaker@windriver.com >
Cc: Luis R. Rodriguez <mcgrof@suse.com >
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1436428847-8886-10-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-07-22 18:37:43 +02:00
Jiang Liu
c179c9b978
PCI: Add helper function msi_desc_to_pci_sysdata()
...
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 <jiang.liu@linux.intel.com >
Reviewed-by: Yijing Wang <wangyijing@huawei.com >
Acked-by: Bjorn Helgaas <bhelgaas@google.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Stuart Yoder <stuart.yoder@freescale.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1436428847-8886-2-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2015-07-22 18:37:42 +02:00
Marc Zyngier
020c312658
PCI/MSI: Allow an msi_controller to be associated to an irq domain
...
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 <marc.zyngier@arm.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jiang Liu <jiang.liu@linux.intel.com >
Link: http://lkml.kernel.org/r/1416048553-29289-2-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 17:14:43 +01:00
Jiang Liu
8e047adae9
PCI/MSI: Provide mechanism to alloc/free MSI/MSIX interrupt from irqdomain
...
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 <jiang.liu@linux.intel.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Yijing Wang <wangyijing@huawei.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Matthias Brugger <matthias.bgg@gmail.com >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1416061447-9472-10-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 13:01:47 +01:00
Jiang Liu
3878eaefb8
PCI/MSI: Enhance core to support hierarchy irqdomain
...
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 <jiang.liu@linux.intel.com >
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Yijing Wang <wangyijing@huawei.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 13:01:47 +01:00
Jiang Liu
aeeb59657c
genirq: Provide default callbacks for msi_domain_ops
...
Extend struct msi_domain_info and provide default callbacks for
msi_domain_ops.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Yijing Wang <wangyijing@huawei.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Matthias Brugger <matthias.bgg@gmail.com >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1416061447-9472-8-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 13:01:47 +01:00
Jiang Liu
d9109698be
genirq: Introduce msi_domain_alloc/free_irqs()
...
Introduce msi_domain_{alloc|free}_irqs() to alloc/free interrupts
from generic MSI irqdomain.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Yijing Wang <wangyijing@huawei.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Matthias Brugger <matthias.bgg@gmail.com >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1416061447-9472-7-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 13:01:47 +01:00
Jiang Liu
f3cf8bb0d6
genirq: Add generic msi irq domain support
...
Implement the basic functions for MSI interrupt support with
hierarchical interrupt domains.
[ tglx: Extracted and combined from several patches ]
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Yijing Wang <wangyijing@huawei.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 13:01:47 +01:00
Jiang Liu
d31eb34240
PCI/MSI: Introduce helpers to hide struct msi_desc implementation details
...
Introduce helpers to hide struct msi_desc implementation details,
so we could easily support non-PCI-compliant MSI devices later by
moving msi_list into struct device.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Yijing Wang <wangyijing@huawei.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Matthias Brugger <matthias.bgg@gmail.com >
Cc: Alexander Gordeev <agordeev@redhat.com >
Link: http://lkml.kernel.org/r/1416061447-9472-6-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 13:01:45 +01:00