1. 26 11月, 2014 17 次提交
  2. 24 11月, 2014 1 次提交
  3. 23 11月, 2014 22 次提交
    • J
      PCI/MSI: Provide mechanism to alloc/free MSI/MSIX interrupt from irqdomain · 8e047ada
      Jiang Liu 提交于
      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: NJiang 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.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      8e047ada
    • J
      PCI/MSI: Enhance core to support hierarchy irqdomain · 3878eaef
      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: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      3878eaef
    • J
      PCI/MSI: Move cached entry functions to irq core · 38b6a1cf
      Jiang Liu 提交于
      Required to support non PCI based MSI.
      
      [ tglx: Extracted from Jiangs patch series ]
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      38b6a1cf
    • J
      genirq: Provide default callbacks for msi_domain_ops · aeeb5965
      Jiang Liu 提交于
      Extend struct msi_domain_info and provide default callbacks for
      msi_domain_ops.
      Signed-off-by: NJiang 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.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      aeeb5965
    • J
      genirq: Introduce msi_domain_alloc/free_irqs() · d9109698
      Jiang Liu 提交于
      Introduce msi_domain_{alloc|free}_irqs() to alloc/free interrupts
      from generic MSI irqdomain.
      Signed-off-by: NJiang 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.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      d9109698
    • T
      asm-generic: Add msi.h · 926ff9ad
      Thomas Gleixner 提交于
      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: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Cc: 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>
      926ff9ad
    • J
      genirq: Add generic msi irq domain support · f3cf8bb0
      Jiang Liu 提交于
      Implement the basic functions for MSI interrupt support with
      hierarchical interrupt domains.
      
      [ tglx: Extracted and combined from several patches ]
      Signed-off-by: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      f3cf8bb0
    • J
      genirq: Introduce callback irq_chip.irq_write_msi_msg · 9dde55b7
      Jiang Liu 提交于
      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: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      9dde55b7
    • M
      genirq: Work around __irq_set_handler vs stacked domains ordering issues · f86eff22
      Marc Zyngier 提交于
      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: NMarc 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-3-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f86eff22
    • J
      irqdomain: Introduce helper function irq_domain_add_hierarchy() · afb7da83
      Jiang Liu 提交于
      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: NJiang 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Link: http://lkml.kernel.org/r/1416061447-9472-5-git-send-email-jiang.liu@linux.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      afb7da83
    • J
      irqdomain: Implement a method to automatically call parent domains alloc/free · 36d72731
      Jiang Liu 提交于
      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: NJiang 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Link: http://lkml.kernel.org/r/1416061447-9472-4-git-send-email-jiang.liu@linux.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      36d72731
    • J
      genirq: Introduce helper irq_domain_set_info() to reduce duplicated code · 1b537708
      Jiang Liu 提交于
      Signed-off-by: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      1b537708
    • T
      genirq: Split out flow handler typedefs into seperate header file · 75ffc007
      Thomas Gleixner 提交于
      Required to avoid circular include dependencies.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      75ffc007
    • J
      genirq: Add IRQ_SET_MASK_OK_DONE to support stacked irqchip · 2cb62547
      Jiang Liu 提交于
      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: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      2cb62547
    • J
      genirq: Introduce irq_chip.irq_compose_msi_msg() to support stacked irqchip · 515085ef
      Jiang Liu 提交于
      Add callback irq_compose_msi_msg to struct irq_chip, which will be used
      to support stacked irqchip.
      Signed-off-by: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      515085ef
    • Y
      genirq: Add more helper functions to support stacked irq_chip · 56e8abab
      Yingjoe Chen 提交于
      Add more helper function for stacked irq_chip to just call parent's
      function.
      Signed-off-by: NYingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Gran Likely <grant.likely@linaro.org>
      Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
      Cc: <linux-arm-kernel@lists.infradead.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: <srv_heupstream@mediatek.com>
      Cc: <yingjoe.chen@gmail.com>
      Cc: <hc.yen@mediatek.com>
      Cc: <eddie.huang@mediatek.com>
      Cc: <nathan.chung@mediatek.com>
      Cc: <yh.chen@mediatek.com>
      Cc: Sascha Hauer <kernel@pengutronix.de>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Link: http://lkml.kernel.org/r/1415893029-2971-3-git-send-email-yingjoe.chen@mediatek.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      56e8abab
    • J
      genirq: Introduce helper functions to support stacked irq_chip · 85f08c17
      Jiang Liu 提交于
      Now we already support hierarchy irq_data, so introduce several helpers
      to support stacked irq_chips.
      Signed-off-by: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      85f08c17
    • Y
      irqdomain: Do irq_find_mapping and set_type for hierarchy irqdomain in case OF · 0cc01aba
      Yingjoe Chen 提交于
      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: NYingjoe Chen <yingjoe.chen@mediatek.com>
      Signed-off-by: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      0cc01aba
    • J
      irqdomain: Introduce new interfaces to support hierarchy irqdomains · f8264e34
      Jiang Liu 提交于
      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: NJiang 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: NThomas Gleixner <tglx@linutronix.de>
      f8264e34
    • J
      PCI/MSI: Introduce helpers to hide struct msi_desc implementation details · d31eb342
      Jiang Liu 提交于
      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: NJiang 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.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      d31eb342
    • T
      PCI/MSI: Rename mask/unmask_msi_irq treewide · 280510f1
      Thomas Gleixner 提交于
      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: NThomas Gleixner <tglx@linutronix.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: x86@kernel.org
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Murali Karicheri <m-karicheri2@ti.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Mohit Kumar <mohit.kumar@st.com>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      280510f1
    • T
      PCI/MSI: Rename mask/unmask_msi_irq et al · 23ed8d57
      Thomas Gleixner 提交于
      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: NThomas Gleixner <tglx@linutronix.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      23ed8d57