1. 31 3月, 2016 1 次提交
  2. 10 3月, 2016 1 次提交
  3. 25 2月, 2016 1 次提交
  4. 26 1月, 2016 1 次提交
    • M
      irqdomain: Allow domain lookup with DOMAIN_BUS_WIRED token · 530cbe10
      Marc Zyngier 提交于
      Let's take the (outlandish) example of an interrupt controller
      capable of handling both wired interrupts and PCI MSIs.
      
      With the current code, the PCI MSI domain is going to be tagged
      with DOMAIN_BUS_PCI_MSI, and the wired domain with DOMAIN_BUS_ANY.
      
      Things get hairy when we start looking up the domain for a wired
      interrupt (typically when creating it based on some firmware
      information - DT or ACPI).
      
      In irq_create_fwspec_mapping(), we perform the lookup using
      DOMAIN_BUS_ANY, which is actually used as a wildcard. This gives
      us one chance out of two to end up with the wrong domain, and
      we try to configure a wired interrupt with the MSI domain.
      Everything grinds to a halt pretty quickly.
      
      What we really need to do is to start looking for a domain that
      would uniquely identify a wired interrupt domain, and only use
      DOMAIN_BUS_ANY as a fallback.
      
      In order to solve this, let's introduce a new DOMAIN_BUS_WIRED
      token, which is going to be used exactly as described above.
      Of course, this depends on the irqchip to setup the domain
      bus_token, and nobody had to implement this so far.
      
      Only so far.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Link: http://lkml.kernel.org/r/1453816347-32720-2-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      530cbe10
  5. 16 1月, 2016 1 次提交
  6. 21 12月, 2015 1 次提交
  7. 20 12月, 2015 1 次提交
  8. 16 12月, 2015 1 次提交
  9. 14 10月, 2015 8 次提交
  10. 16 9月, 2015 1 次提交
  11. 30 7月, 2015 1 次提交
    • M
      genirq/irqdomain: Allow irq domain aliasing · ad3aedfb
      Marc Zyngier 提交于
      It is not uncommon (at least with the ARM stuff) to have a piece
      of hardware that implements different flavours of "interrupts".
      A typical example of this is the GICv3 ITS, which implements
      standard PCI/MSI support, but also some form of "generic MSI".
      
      So far, the PCI/MSI domain is registered using the ITS device_node,
      so that irq_find_host can return it. On the contrary, the raw MSI
      domain is not registered with an device_node, making it impossible
      to be looked up by another subsystem (obviously, using the same
      device_node twice would only result in confusion, as it is not
      defined which one irq_find_host would return).
      
      A solution to this is to "type" domains that may be aliasing, and
      to be able to lookup an device_node that matches a given type.
      For this, we introduce irq_find_matching_host() as a superset
      of irq_find_host:
      
      struct irq_domain *irq_find_matching_host(struct device_node *node,
                                      enum irq_domain_bus_token bus_token);
      
      where bus_token is the "type" we want to match the domain against
      (so far, only DOMAIN_BUS_ANY is defined). This result in some
      moderately invasive changes on the PPC side (which is the only
      user of the .match method).
      
      This has otherwise no functionnal change.
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NMarc 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: 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-2-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      ad3aedfb
  12. 12 6月, 2015 2 次提交
  13. 18 5月, 2015 1 次提交
  14. 23 11月, 2014 5 次提交
    • 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
    • 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
  15. 22 6月, 2014 1 次提交
  16. 27 5月, 2014 1 次提交
  17. 27 2月, 2014 1 次提交
  18. 24 10月, 2013 1 次提交
  19. 25 6月, 2013 1 次提交
  20. 24 6月, 2013 4 次提交
    • K
      irq: fix checkpatch error · 798f0fd1
      Kefeng Wang 提交于
      ERROR: space required before the open parenthesis '('
      WARNING: Prefer pr_warn(... to pr_warning(...
      Just fix above 2 issue.
      Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      798f0fd1
    • G
      irqdomain: make irq_linear_revmap() a fast path again · d3dcb436
      Grant Likely 提交于
      Over the years, irq_linear_revmap() gained tests and checks to make sure
      callers were using it safely, which while important, also make it less
      of a fast path. After the irqdomain refactoring done recently, it is now
      possible to make irq_linear_revmap() a fast path again. This patch moves
      irq_linear_revmap() to the header file and makes it a static inline so
      that interrupt controller drivers using a linear mapping can decode the
      virq from a hwirq in just a couple of instructions.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      d3dcb436
    • G
      irqdomain: remove irq_domain_generate_simple() · 56a3d5ac
      Grant Likely 提交于
      Nobody calls it; remove the function
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      56a3d5ac
    • G
      irqdomain: Refactor irq_domain_associate_many() · ddaf144c
      Grant Likely 提交于
      Originally, irq_domain_associate_many() was designed to unwind the
      mapped irqs on a failure of any individual association. However, that
      proved to be a problem with certain IRQ controllers. Some of them only
      support a subset of irqs, and will fail when attempting to map a
      reserved IRQ. In those cases we want to map as many IRQs as possible, so
      instead it is better for irq_domain_associate_many() to make a
      best-effort attempt to map irqs, but not fail if any or all of them
      don't succeed. If a caller really cares about how many irqs got
      associated, then it should instead go back and check that all of the
      irqs is cares about were mapped.
      
      The original design open-coded the individual association code into the
      body of irq_domain_associate_many(), but with no longer needing to
      unwind associations, the code becomes simpler to split out
      irq_domain_associate() to contain the bulk of the logic, and
      irq_domain_associate_many() to be a simple loop wrapper.
      
      This patch also adds a new error check to the associate path to make
      sure it isn't called for an irq larger than the controller can handle,
      and adds locking so that the irq_domain_mutex is held while setting up a
      new association.
      
      v3: Fixup missing change to irq_domain_add_tree()
      v2: Fixup x86 warning. irq_domain_associate_many() no longer returns an
          error code, but reports errors to the printk log directly. In the
          majority of cases we don't actually want to fail if there is a
          problem, but rather log it and still try to boot the system.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      
      irqdomain: Fix flubbed irq_domain_associate_many refactoring
      
      commit d39046ec72, "irqdomain: Refactor irq_domain_associate_many()" was
      missing the following hunk which causes a boot failure on anything using
      irq_domain_add_tree() to allocate an irq domain.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
      Cc: Thomas Gleixner <tglx@linutronix.de>,
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      ddaf144c
  21. 18 6月, 2013 1 次提交
  22. 10 6月, 2013 4 次提交
    • G
      irqdomain: Beef up debugfs output · 1400ea86
      Grant Likely 提交于
      This patch increases the amount of output produced by the
      irq_domain_mapping debugfs file by first listing all of the registered
      irq domains at the beginning of the output, and then by including all
      mapped IRQs in the output, not just the active ones. It is very useful
      when debugging irqdomain issues to be able to see the entire list of
      mapped irqs, not just the ones that happen to be connected to devices.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      1400ea86
    • G
      irqdomain: Clean up aftermath of irq_domain refactoring · fa40f377
      Grant Likely 提交于
      After refactoring the irqdomain code, there are a number of API
      functions that are merely empty wrappers around core code. Drop those
      wrappers out of the C file and replace them with static inlines in the
      header.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      fa40f377
    • G
      irqdomain: Eliminate revmap type · 1aa0dd94
      Grant Likely 提交于
      The NOMAP irq_domain type is only used by a handful of interrupt
      controllers and it unnecessarily complicates the code by adding special
      cases on how to look up mappings and different revmap functions are used
      for each type which need to validate the correct type is passed to it
      before performing the reverse map. Eliminating the revmap_type and
      making a single reverse mapping function simplifies the code. It also
      shouldn't be any slower than having separate revmap functions because
      the type of the revmap needed to be checked anyway.
      
      The linear and tree revmap types were already merged in a previous
      patch. This patch rolls the NOMAP or direct mapping behaviour into the
      same domain code making is possible for an irq domain to do any mapping
      type; linear, tree or direct; and that the mapping will be transparent
      to the interrupt controller driver.
      
      With this change, direct mappings will get stored in the linear or tree
      mapping for consistency. Reverse mapping from the hwirq to virq will go
      through the normal lookup process. However, any controller using a
      direct mapping can take advantage of knowing that hwirq==virq for any
      mapped interrupts skip doing a revmap lookup when handling IRQs.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      1aa0dd94
    • G
      irqdomain: merge linear and tree reverse mappings. · cef5075c
      Grant Likely 提交于
      Keeping them separate makes irq_domain more complex and adds a lot of
      code (as proven by the diffstat).  Merging them simplifies the whole
      scheme.  This change makes it so both the tree and linear methods can be
      used by the same irq_domain instance.  If the hwirq is less than the
      ->linear_size, then the linear map is used to reverse map the hwirq.
      Otherwise the radix tree is used.  The test for which map to use is no
      more expensive that the existing code, so the performance of fast path
      is preserved.
      
      It also means that complex interrupt controllers can use both the
      linear map and a tree in the same domain.  This may be useful for an
      interrupt controller with a base set of core irqs and a large number
      of GPIOs which might be used as irqs.  The linear map could cover the
      core irqs, and the tree used for thas irqs.  The linear map could
      cover the core irqs, and the tree used for the gpios.
      
      v2: Drop reorganization of revmap data
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Rob Herring <rob.herring@calxeda.com>
      cef5075c