1. 22 6月, 2014 1 次提交
  2. 27 5月, 2014 1 次提交
  3. 27 2月, 2014 1 次提交
  4. 24 10月, 2013 1 次提交
  5. 25 6月, 2013 1 次提交
  6. 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
  7. 18 6月, 2013 1 次提交
  8. 10 6月, 2013 7 次提交
    • 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
    • G
      irqdomain: Add a name field · 0bb4afb4
      Grant Likely 提交于
      This patch adds a name field to the irq_domain structure to help mere
      mortals understand the mappings between irq domains and virqs. It also
      converts a number of places that have open-coded some kind of fudging
      an irqdomain name to use the new field. This means a more consistent
      display of names in irq domain log messages and debugfs output.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      0bb4afb4
    • G
      irqdomain: Replace LEGACY mapping with LINEAR · 9bbf877d
      Grant Likely 提交于
      The LEGACY mapping unnecessarily complicates the irqdomain code and
      can easily be implemented with a linear mapping.  By ripping it out
      and replacing it with the LINEAR mapping the object size of
      irqdomain.c shrinks by about 330 bytes (ARMv7) which offsets the
      additional allocation required by the linear map.  It also makes it
      possible for current LEGACY map users to pre-allocate irq_descs for a
      subset of the hwirqs and dynamically allocate the rest as needed.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      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>
      9bbf877d
    • G
      irqdomain: Relax failure path on setting up mappings · 5e1cda5b
      Grant Likely 提交于
      Commit 98aa468e, "irqdomain: Support for static IRQ mapping and
      association" introduced an API for directly associating blocks of hwirqs
      to linux irqs. However, if any irq in that block failed to map (say if
      the mapping functions returns an error because the irq is already
      mapped) then the whole thing will fail and roll back. This is probably
      too aggressive since there are valid reasons why a mapping may fail.
      ie. Firmware may have a particular IRQ marked as unusable.
      
      This patch drops the error path out of irq_domain_associate(). If a
      mapping fails, then it is simply skipped. There is no reason to fail the
      entire allocation.
      
      v2: Still output an information message on failed mappings and make sure
          attempted mapping gets cleared out of the irq_data structure.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      5e1cda5b
  9. 09 6月, 2013 3 次提交
  10. 29 5月, 2013 1 次提交
    • T
      genirq: Generic chip: Add linear irq domain support · 088f40b7
      Thomas Gleixner 提交于
      Provide infrastructure for irq chip implementations which work on
      linear irq domains.
      
      - Interface to allocate multiple generic chips which are associated to
        the irq domain.
      
      - Interface to get the generic chip pointer for a particular hardware
        interrupt in the domain.
      
      - irq domain mapping function to install the chip for a particular
        interrupt.
      
      Note: This lacks a removal function for now.
      
      [ Sebastian Hesselbarth: Mask cache and pointer math fixups ]
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jean-Francois Moine <moinejf@free.fr>
      Cc: devicetree-discuss@lists.ozlabs.org
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Cc: Gregory Clement <gregory.clement@free-electrons.com>
      Cc: Gerlando Falauto <gerlando.falauto@keymile.com>
      Cc: Rob Landley <rob@landley.net>
      Acked-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
      Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Link: http://lkml.kernel.org/r/20130506142539.450634298@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      088f40b7
  11. 06 5月, 2013 1 次提交
    • B
      irqdomain: Allow quiet failure mode · 5fe0c1f2
      Benjamin Herrenschmidt 提交于
      Some interrupt controllers refuse to map interrupts marked as
      "protected" by firwmare. Since we try to map everyting in the
      device-tree on some platforms, we end up with a lot of nasty
      WARN's in the boot log for what is a normal situation on those
      machines.
      
      This defines a specific return code (-EPERM) from the host map()
      callback which cause irqdomain to fail silently.
      
      MPIC is updated to return this when hitting a protected source
      printing only a single line message for diagnostic purposes.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5fe0c1f2
  12. 30 11月, 2012 1 次提交
  13. 10 10月, 2012 1 次提交
    • L
      irqdomain: augment add_simple() to allocate descs · 2854d167
      Linus Walleij 提交于
      Currently we rely on all IRQ chip instances to dynamically
      allocate their IRQ descriptors unless they use the linear
      IRQ domain. So for irqdomain_add_legacy() and
      irqdomain_add_simple() the caller need to make sure that
      descriptors are allocated.
      
      Let's slightly augment the yet unused irqdomain_add_simple()
      to also allocate descriptors as a means to simplify usage
      and avoid code duplication throughout the kernel.
      
      We warn if descriptors cannot be allocated, e.g. if a
      platform has the bad habit of hogging descriptors at boot
      time.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Lee Jones <lee.jones@linaro.org>
      Reviewed-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2854d167
  14. 25 7月, 2012 2 次提交
    • M
      irqdomain: Improve diagnostics when a domain mapping fails · f5a1ad05
      Mark Brown 提交于
      When the map operation fails log the error code we get and add a WARN_ON()
      so we get a backtrace (which should help work out which interrupt is the
      source of the issue).
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      f5a1ad05
    • G
      irqdomain: eliminate slow-path revmap lookups · 4c0946c4
      Grant Likely 提交于
      With the current state of irq_domain, the reverse map is always updated
      when new IRQs get mapped.  This means that the irq_find_mapping() function
      can be simplified to execute the revmap lookup functions unconditionally
      
      This patch adds lookup functions for the revmaps that don't yet have one
      and removes the slow path lookup code path.
      
      v8: Broke out unrelated changes into separate patches.  Rebased on Paul's irq
          association patches.
      v7: Rebased to irqdomain/next for v3.4 and applied before the removal of 'hint'
      v6: Remove the slow path entirely.  The only place where the slow path
          could get called is for a linear mapping if the hwirq number is larger
          than the linear revmap size.  There shouldn't be any interrupt
          controllers that do that.
      v5: rewrite to not use a ->revmap() callback.  It is simpler, smaller,
          safer and faster to open code each of the revmap lookups directly into
          irq_find_mapping() via a switch statement.
      v4: Fix build failure on incorrect variable reference.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      4c0946c4
  15. 11 7月, 2012 7 次提交
    • G
      irqdomain: Fix irq_create_direct_mapping() to test irq_domain type. · 9844a552
      Grant Likely 提交于
      irq_create_direct_mapping can only be used with the NOMAP type.  Make
      the function test to ensure it is passed the correct type of
      irq_domain.
      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>
      9844a552
    • G
      irqdomain: Eliminate dedicated radix lookup functions · d6b0d1f7
      Grant Likely 提交于
      In preparation to remove the slow revmap path, eliminate the public
      radix revmap lookup functions.  This simplifies the code and makes the
      slowpath removal patch a lot simpler.
      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>
      d6b0d1f7
    • G
      irqdomain: Support for static IRQ mapping and association. · 98aa468e
      Grant Likely 提交于
      This adds a new strict mapping API for supporting creation of linux IRQs
      at existing positions within the domain. The new routines are as follows:
      
      For dynamic allocation and insertion to specified ranges:
      
      	- irq_create_identity_mapping()
      	- irq_create_strict_mappings()
      
      These will allocate and associate a range of linux IRQs at the specified
      location. This can be used by controllers that have their own static linux IRQ
      definitions to map a hwirq range to, as well as for platforms that wish to
      establish 1:1 identity mapping between linux and hwirq space.
      
      For insertion to specified ranges by platforms that do their own irq_desc
      management:
      
      	- irq_domain_associate()
      	- irq_domain_associate_many()
      
      These in turn call back in to the domain's ->map() routine, for further
      processing by the platform. Disassociation of IRQs get handled through
      irq_dispose_mapping() as normal.
      
      With these in place it should be possible to begin migration of legacy IRQ
      domains to linear ones, without requiring special handling for static vs
      dynamic IRQ definitions in DT vs non-DT paths. This also makes it possible
      for domains with static mappings to adopt whichever tree model best fits
      their needs, rather than simply restricting them to linear revmaps.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      [grant.likely: Reorganized irq_domain_associate{,_many} to have all logic in one place]
      [grant.likely: Add error checking for unallocated irq_descs at associate time]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Rob Herring <rob.herring@calxeda.com>
      98aa468e
    • G
      irqdomain: Always update revmap when setting up a virq · 2a71a1a9
      Grant Likely 提交于
      At irq_setup_virq() time all of the data needed to update the reverse
      map is available, but the current code ignores it and relies upon the
      slow path to insert revmap records.  This patch adds revmap updating
      to the setup path so the slow path will no longer be necessary.
      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>
      2a71a1a9
    • G
      irqdomain: Split disassociating code into separate function · 913af207
      Grant Likely 提交于
      This patch moves the irq disassociation code out into a separate
      function in preparation to extend irq_setup_virq to handle multiple
      irqs and rename it for use by interrupt controller drivers.  The new
      function will be used by irq_setup_virq() in its error path.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Rob Herring <rob.herring@calxeda.com>
      913af207
    • D
      irq_domain: correct a minor wrong comment for linear revmap · 22076c77
      Dong Aisheng 提交于
      The revmap type should be linear for irq_domain_add_linear function.
      Signed-off-by: NDong Aisheng <dong.aisheng@linaro.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      22076c77
    • M
      irq_domain: Standardise legacy/linear domain selection · 781d0f46
      Mark Brown 提交于
      A large proportion of interrupt controllers that support legacy mappings
      do so because non-DT systems need to use fixed IRQ numbers when registering
      devices via buses but can otherwise use a linear mapping. The interrupt
      controller itself typically is not affected by the mapping used and best
      practice is to use a linear mapping where possible so drivers frequently
      select at runtime depending on if a legacy range has been allocated to
      them.
      
      Standardise this behaviour by providing irq_domain_register_simple() which
      will allocate a linear mapping unless a positive first_irq is provided in
      which case it will fall back to a legacy mapping. This helps make best
      practice for irq_domain adoption clearer.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      781d0f46
  16. 06 7月, 2012 1 次提交
  17. 18 6月, 2012 1 次提交
  18. 16 6月, 2012 3 次提交
    • G
      irqdomain: Remove unnecessary test for IRQ_DOMAIN_MAP_LEGACY · 73255704
      Grant Likely 提交于
      Where irq_domain_associate() is called in irq_create_mapping, there is
      no need to test for IRQ_DOMAIN_MAP_LEGACY because it is already tested
      for earlier in the routine.
      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>
      73255704
    • P
      irqdomain: Simple NUMA awareness. · 5ca4db61
      Paul Mundt 提交于
      While common irqdesc allocation is node aware, the irqdomain code is not.
      
      Presently we observe a number of regressions/inconsistencies on
      NUMA-capable platforms:
      
      - Platforms using irqdomains with legacy mappings, where the
        irq_descs are allocated node-local and the irqdomain data
        structure is not.
      
      - Drivers implementing irqdomains will lose node locality
        regardless of the underlying struct device's node id.
      
      This plugs in NUMA node id proliferation across the various allocation
      callsites by way of_node_to_nid() node lookup. While of_node_to_nid()
      does the right thing for OF-capable platforms it doesn't presently handle
      the non-DT case. This is trivially dealt with by simply wraping in to
      numa_node_id() unconditionally.
      Signed-off-by: NPaul 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>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      5ca4db61
    • G
      devicetree: add helper inline for retrieving a node's full name · efd68e72
      Grant Likely 提交于
      The pattern (np ? np->full_name : "<none>") is rather common in the
      kernel, but can also make for quite long lines.  This patch adds a new
      inline function, of_node_full_name() so that the test for a valid node
      pointer doesn't need to be open coded at all call sites.
      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>
      efd68e72
  19. 20 5月, 2012 2 次提交