aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-11-26irqchip: GICv3: ITS: MSI supportMarc Zyngier2-0/+182
Now, the bit of code that allow us to use the ITS as a MSI controller. Both MSI and MSI-X are supported. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26irqchip: GICv3: ITS: device allocation and configurationMarc Zyngier1-0/+74
The ITS has a notion of "device" that can write to it in order to generate an interrupt. Conversly, the driver maintains a per-ITS list of devices, together with their configuration information, and uses this to configure the HW. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26irqchip: GICv3: ITS: tables allocatorsMarc Zyngier1-0/+292
The interrupt translation is driven by a set of tables (device, ITT, and collection) to be in the end delivered to a CPU. Also, the redistributors rely on a couple of tables (configuration, and pending) to deliver the interrupts to the CPUs. This patch adds the required allocators for these tables. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26irqchip: GICv3: ITS: LPI allocatorMarc Zyngier1-0/+103
LPIs are the type of interrupts that are used by the ITS. Given the size of the namespace (anywhere between 16 and 32bit), interrupt IDs are allocated in chunks of 32. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26irqchip: GICv3: ITS: irqchip implementationMarc Zyngier1-0/+77
The usual methods that are used to present an irqchip to the rest of the kernel Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26irqchip: GICv3: ITS command queueMarc Zyngier2-0/+613
The ITS is configured through a number commands that the driver issues to the HW using a memory-based circular buffer. This patch implements the subset of commands that are required for Linux. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26irqchip: GICv3: rework redistributor structureMarc Zyngier2-29/+59
The basic GICv3 driver has almost no use for the redistributor (other than the basic per-CPU interrupts), but the ITS needs a lot more from them. As such, rework the set of data structures. The behaviour of the GICv3 driver is otherwise unaffected. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26irqchip: GICv3: Convert to domain hierarchyMarc Zyngier2-5/+38
In order to start supporting stacked domains, convert the GICv3 code base to the new domain hierarchy framework, which mostly amounts to supporting the new alloc/free callbacks. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-26arm64: PCI/MSI: Use asm-generic/msi.hMarc Zyngier1-0/+1
In order to support CONFIG_GENERIC_MSI_IRQ_DOMAIN, we need to define msi_alloc_info_t. As the generic version exposed in asm-generic/msi.h is perfectly convenient, import this file as asm/msi.h. Acked-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jason Cooper <[email protected]>
2014-11-23PCI/MSI: Allow an msi_controller to be associated to an irq domainMarc Zyngier2-2/+17
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 <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: [email protected] Cc: Jiang Liu <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Provide mechanism to alloc/free MSI/MSIX interrupt from irqdomainJiang Liu2-3/+67
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 <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Enhance core to support hierarchy irqdomainJiang Liu3-0/+187
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 <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Move cached entry functions to irq coreJiang Liu3-18/+14
Required to support non PCI based MSI. [ tglx: Extracted from Jiangs patch series ] Signed-off-by: Jiang Liu <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Provide default callbacks for msi_domain_opsJiang Liu2-13/+140
Extend struct msi_domain_info and provide default callbacks for msi_domain_ops. Signed-off-by: Jiang Liu <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Introduce msi_domain_alloc/free_irqs()Jiang Liu2-0/+104
Introduce msi_domain_{alloc|free}_irqs() to alloc/free interrupts from generic MSI irqdomain. Signed-off-by: Jiang Liu <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23asm-generic: Add msi.hThomas Gleixner1-0/+32
To support MSI irq domains we want a generic data structure for allocation, but we need the option to provide an architecture specific version of it. So instead of playing #ifdef games in linux/msi.h we add a generic header file and let architectures decide whether to include it or to provide their own implementation and provide the required typedef. I know that typedefs are not really nice, but in this case there are no forward declarations required and it's the simplest solution. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Alexander Gordeev <[email protected]>
2014-11-23genirq: Add generic msi irq domain supportJiang Liu4-0/+197
Implement the basic functions for MSI interrupt support with hierarchical interrupt domains. [ tglx: Extracted and combined from several patches ] Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Introduce callback irq_chip.irq_write_msi_msgJiang Liu1-0/+8
Introduce callback irq_chip.irq_write_msi_msg, so we can share common code among MSI alike interrupt controllers, such as HPET and DMAR. Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Work around __irq_set_handler vs stacked domains ordering issuesMarc Zyngier1-1/+24
With the introduction of stacked domains, we have the issue that, depending on where in the stack this is called, __irq_set_handler will succeed or fail: If this is called from the inner irqchip, __irq_set_handler() will fail, as it will look at the outer domain as the (desc->irq_data.chip == &no_irq_chip) test fails (we haven't set the top level yet). This patch implements the following: "If there is at least one valid irqchip in the domain, it will probably sort itself out". This is clearly not ideal, but it is far less confusing then crashing because the top-level domain is not up yet. [ tglx: Added comment and a protection against chained interrupts in that context ] Signed-off-by: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: [email protected] Cc: Jiang Liu <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23irqdomain: Introduce helper function irq_domain_add_hierarchy()Jiang Liu2-0/+40
Introduce helper function irq_domain_add_hierarchy(), which creates a linear irqdomain if parameter 'size' is not zero, otherwise creates a tree irqdomain. Signed-off-by: Jiang Liu <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Matthias Brugger <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23irqdomain: Implement a method to automatically call parent domains alloc/freeJiang Liu2-17/+89
Add a flags to irq_domain.flags to control whether the irqdomain core should automatically call parent irqdomain's alloc/free callbacks. It help to reduce hierarchy irqdomains users' code size. Signed-off-by: Jiang Liu <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Matthias Brugger <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Introduce helper irq_domain_set_info() to reduce duplicated codeJiang Liu2-0/+26
Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Split out flow handler typedefs into seperate header fileThomas Gleixner2-5/+15
Required to avoid circular include dependencies. Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Add IRQ_SET_MASK_OK_DONE to support stacked irqchipJiang Liu2-0/+6
Add IRQ_SET_MASK_OK_DONE in addition to IRQ_SET_MASK_OK and IRQ_SET_MASK_OK_NOCOPY to support stacked irqchip. IRQ_SET_MASK_OK_DONE is the same as IRQ_SET_MASK_OK to irq core. To stacked irqchip, it means that ascendant irqchips have done all the work and no more handling needed in descendant irqchips. Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Introduce irq_chip.irq_compose_msi_msg() to support stacked irqchipJiang Liu2-0/+31
Add callback irq_compose_msi_msg to struct irq_chip, which will be used to support stacked irqchip. Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Add more helper functions to support stacked irq_chipYingjoe Chen2-0/+54
Add more helper function for stacked irq_chip to just call parent's function. Signed-off-by: Yingjoe Chen <[email protected]> Cc: Rob Herring <[email protected]> Cc: Pawel Moll <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Russell King <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Gran Likely <[email protected]> Cc: Boris BREZILLON <[email protected]> Cc: <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Yijing Wang <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Marc Zyngier <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23genirq: Introduce helper functions to support stacked irq_chipJiang Liu2-0/+33
Now we already support hierarchy irq_data, so introduce several helpers to support stacked irq_chips. Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23irqdomain: Do irq_find_mapping and set_type for hierarchy irqdomain in case OFYingjoe Chen1-9/+18
It is possible to call irq_create_of_mapping to create/translate the same IRQ from DT for multiple times. Perform irq_find_mapping check and set_type for hierarchy irqdomain in irq_create_of_mapping() to avoid duplicate these functionality in all outer most irqdomain. Signed-off-by: Yingjoe Chen <[email protected]> Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23irqdomain: Introduce new interfaces to support hierarchy irqdomainsJiang Liu6-16/+581
We plan to use hierarchy irqdomain to suppport CPU vector assignment, interrupt remapping controller, IO-APIC controller, MSI interrupt and hypertransport interrupt etc on x86 platforms. So extend irqdomain interfaces to support hierarchy irqdomain. There are already many clients of current irqdomain interfaces. To minimize the changes, we choose to introduce new version 2 interfaces to support hierarchy instead of extending existing irqdomain interfaces. According to Thomas's suggestion, the most important design decision is to build hierarchy struct irq_data to support hierarchy irqdomain, so hierarchy irqdomain related data could be saved in struct irq_data. With support of hierarchy irq_data, we could also support stacked irq_chips. This is most useful in case of set_affinity(). The new hierarchy irqdomain introduces following interfaces: 1) irq_domain_alloc_irqs()/irq_domain_free_irqs(): allocate/release IRQ and related resources. 2) __irq_domain_alloc_irqs(): a special version to support legacy IRQs. 3) irq_domain_activate_irq()/irq_domain_deactivate_irq(): program interrupt controllers to activate/deactivate interrupt. There are also several help functions to ease irqdomain implemenations: 1) irq_domain_get_irq_data(): get irq_data associated with a specific irqdomain. 2) irq_domain_set_hwirq_and_chip(): save irqdomain specific data into irq_data. 3) irq_domain_alloc_irqs_parent()/irq_domain_free_irqs_parent(): invoke parent irqdomain's alloc/free callbacks. We also changed irq_startup()/irq_shutdown() to invoke irq_domain_activate_irq()/irq_domain_deactivate_irq() to program interrupt controller when start/stop interrupts. [ tglx: Folded parts of the later patch series in ] Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Introduce helpers to hide struct msi_desc implementation detailsJiang Liu1-0/+19
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 <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Rename mask/unmask_msi_irq treewideThomas Gleixner20-56/+56
The PCI/MSI irq chip callbacks mask/unmask_msi_irq have been renamed to pci_msi_mask/unmask_irq to mark them PCI specific. Rename all usage sites. The conversion helper functions are kept around to avoid conflicts in next and will be removed after merging into mainline. Coccinelle assisted conversion. No functional change. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Russell King <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: [email protected] Cc: Jiang Liu <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Murali Karicheri <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Mohit Kumar <[email protected]> Cc: Simon Horman <[email protected]> Cc: Michal Simek <[email protected]> Cc: Yijing Wang <[email protected]>
2014-11-23PCI/MSI: Rename mask/unmask_msi_irq et alThomas Gleixner3-15/+31
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 <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Heiko Carstens <[email protected]>
2014-11-23PCI/MSI: Rename write_msi_msg() to pci_write_msi_msg()Jiang Liu26-35/+45
Rename write_msi_msg() to pci_write_msi_msg() to mark it as PCI specific. Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Rename __read_msi_msg() to __pci_read_msi_msg()Jiang Liu4-12/+6
Rename __read_msi_msg() to __pci_read_msi_msg() and kill unused read_msi_msg(). It's a preparation to separate generic MSI code from PCI core. Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Kill redundant call of irq_set_msi_desc() for MSI-X interruptsJiang Liu1-1/+0
It is the repsonsibility of arch_setup_msi_irq()/arch_setup_msi_irqs() to call irq_set_msi_desc() to associate IRQ descriptors and MSI descriptors. Kill the redundant call of irq_set_msi_desc() for MSI-X interrupts in the PCI MSI core. Signed-off-by: Jiang Liu <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Simplify PCI MSI code by initializing msi_desc.nvec_used earlierJiang Liu2-33/+15
Simplify PCI MSI code by initializing msi_desc.nvec_used and msi_desc.msi_attrib.multiple when creating MSI descriptors. Also remove redundant checks in IRQ remapping drivers, PCI MSI core already guarantees these. Signed-off-by: Jiang Liu <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-23PCI/MSI: Remove unnecessary braces around single statementsJiang Liu1-6/+3
Per Documentation/CodingStyle, don't use braces around single statements. Signed-off-by: Jiang Liu <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Yijing Wang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
2014-11-21ARM/PCI: Remove unused pcibios_add_bus() and pcibios_remove_bus()Yijing Wang2-20/+0
There are no users of the struct hw_pci.add_bus() or .remove_bus() methods, so remove the pointers from hw_pci. That makes pcibios_add_bus() and pcibios_remove_bus() themselves superfluous, so remove them as well. [bhelgaas: changelog] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-21PCI: xilinx: Save MSI controller in pci_sys_dataYijing Wang1-15/+5
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every PCI bus in .add_bus(). [bhelgaas: use xilinx_pcie_msi_chip, not xilinx_pcie_msi_controller] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-21PCI: mvebu: Save MSI controller in pci_sys_dataYijing Wang1-7/+4
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every PCI bus in .add_bus(). Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-21PCI: rcar: Save MSI controller in pci_sys_dataYijing Wang1-10/+3
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every PCI bus in .add_bus(). [bhelgaas: use struct rcar_msi.chip, not ctrl] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-21PCI: designware: Save MSI controller in pci_sys_dataYijing Wang1-11/+5
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every PCI bus in .add_bus(). [bhelgaas: use dw_pcie_msi_chip, not dw_pcie_msi_controller] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-21PCI: tegra: Save MSI controller in pci_sys_dataYijing Wang1-10/+4
Save MSI controller in pci_sys_data instead of assigning MSI controller pointer to every PCI bus in .add_bus(). [bhelgaas: use struct tegra_msi.chip, not ctrl] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-21ARM/PCI: Save MSI controller in pci_sys_dataYijing Wang2-0/+18
Currently ARM associates an MSI controller with a PCI bus by defining pcibios_add_bus() and using it to call a struct hw_pci.add_bus() method. That method sets the struct pci_bus "msi" member. That's unwieldy and unnecessarily couples MSI with the PCI enumeration code. On ARM, all devices under the same PCI host bridge share an MSI controller, so add an msi_controller pointer to the struct pci_sys_data and implement pcibios_msi_controller() to retrieve it. This is a step toward moving the msi_controller pointer into the generic struct pci_host_bridge. [bhelgaas: changelog, take pci_dev instead of pci_bus] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-12PCI/MSI: Add weak pcibios_msi_controller()Yijing Wang1-1/+16
Add pcibios_msi_controller() to get the msi_controller associated with a PCI device. This is to allow arches to store the msi_controller in the arch-specific PCI sysdata. [bhelgaas: changelog, take pci_dev instead of pci_bus] Suggested-by: Bjorn Helgaas <[email protected]> Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-12PCI/MSI: Rename "struct msi_chip" to "struct msi_controller"Yijing Wang14-38/+40
"msi_chip" isn't very descriptive, so rename it to "msi_controller". That tells a little more about what it does and is already used in device tree bindings. No functional change. [bhelgaas: changelog, change *only* the struct name so it's reviewable] Suggested-by: Bjorn Helgaas <[email protected]> Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-11-11s390/MSI: Use __msi_mask_irq() instead of default_msi_mask_irq()Yijing Wang2-4/+2
Now only s390/MSI use default_msi_mask_irq() and default_msix_mask_irq(), replace them with the common MSI mask IRQ functions __msi_mask_irq() and __msix_mask_irq(). Remove default_msi_mask_irq() and default_msix_mask_irq(). Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Sebastian Ott <[email protected]> CC: [email protected]
2014-11-11Revert "PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()"Yijing Wang5-43/+11
The problem fixed by 0e4ccb1505a9 ("PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()") has been fixed in a simpler way by a previous commit ("PCI/MSI: Add pci_msi_ignore_mask to prevent writes to MSI/MSI-X Mask Bits"). The msi_mask_irq() and msix_mask_irq() x86_msi_ops added by 0e4ccb1505a9 are no longer needed, so revert the commit. default_msi_mask_irq() and default_msix_mask_irq() were added by 0e4ccb1505a9 and are still used by s390, so keep them for now. [bhelgaas: changelog] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: David Vrabel <[email protected]> CC: Konrad Rzeszutek Wilk <[email protected]> CC: [email protected]
2014-11-06PCI/MSI: Add pci_msi_ignore_mask to prevent writes to MSI/MSI-X Mask BitsYijing Wang3-1/+9
MSI-X vector Mask Bits are in MSI-X Tables in PCI memory space. Xen PV guests can't write to those tables. MSI vector Mask Bits are in PCI configuration space. Xen PV guests can write to config space, but those writes are ignored. Commit 0e4ccb1505a9 ("PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()") added a way to override default_mask_msi_irqs() and default_mask_msix_irqs() so they can be no-ops in Xen guests, but this is more complicated than necessary. Add "pci_msi_ignore_mask" in the core PCI MSI code. If set, default_mask_msi_irqs() and default_mask_msix_irqs() return without doing anything. This is less flexible, but much simpler. [bhelgaas: changelog] Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: David Vrabel <[email protected]> CC: Konrad Rzeszutek Wilk <[email protected]> CC: [email protected]
2014-10-19Linux 3.18-rc1Linus Torvalds1-2/+2