1. 25 7月, 2012 1 次提交
    • 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
  2. 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
  3. 06 7月, 2012 1 次提交
  4. 18 6月, 2012 1 次提交
  5. 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
  6. 20 5月, 2012 5 次提交
  7. 13 4月, 2012 1 次提交
  8. 12 4月, 2012 1 次提交
    • G
      irq_domain: Move irq_virq_count into NOMAP revmap · 6fa6c8e2
      Grant Likely 提交于
      This patch replaces the old global setting of irq_virq_count that is only
      used by the NOMAP mapping and instead uses a revmap_data property so that
      the maximum NOMAP allocation can be set per NOMAP irq_domain.
      
      There is exactly one user of irq_virq_count in-tree right now: PS3.
      Also, irq_virq_count is only useful for the NOMAP mapping.  So,
      instead of having a single global irq_virq_count values, this change
      drops it entirely and added a max_irq argument to irq_domain_add_nomap().
      That makes it a property of an individual nomap irq domain instead of
      a global system settting.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      6fa6c8e2
  9. 11 4月, 2012 2 次提交
    • G
      irqdomain: Fix debugfs formatting · 15e06bf6
      Grant Likely 提交于
      This patch fixes the irq_domain_mapping debugfs output to pad pointer
      values with leading zeros so that pointer values are displayed
      correctly.  Otherwise you get output similar to "0x 5e0000000000000".
      Also, when the irq_domain is set to 'null'
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      15e06bf6
    • D
      irq/irq_domain: Quit ignoring error returns from irq_alloc_desc_from(). · 5b7526e3
      David Daney 提交于
      In commit 4bbdd45a (irq_domain/powerpc: eliminate irq_map; use
      irq_alloc_desc() instead) code was added that ignores error returns
      from irq_alloc_desc_from() by (silently) casting the return value to
      unsigned.  The negitive value error return now suddenly looks like a
      valid irq number.
      
      Commits cc79ca69 (irq_domain: Move irq_domain code from powerpc to
      kernel/irq) and 1bc04f2c (irq_domain: Add support for base irq and
      hwirq in legacy mappings) move this code to its current location in
      irqdomain.c
      
      The result of all of this is a null pointer dereference OOPS if one of
      the error cases is hit.
      
      The fix: Don't cast away the negativeness of the return value and then
      check for errors.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      [grant.likely: dropped addition of new 'irq' variable]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      5b7526e3
  10. 30 3月, 2012 1 次提交
  11. 25 2月, 2012 1 次提交
    • G
      irq_domain/mips: Allow irq_domain on MIPS · abd2363f
      Grant Likely 提交于
      This patch makes IRQ_DOMAIN usable on MIPS.  It uses an ugly workaround
      to preserve current behaviour so that MIPS has time to add irq_domain
      registration to the irq controller drivers.  The workaround will be
      removed in Linux v3.6
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      abd2363f
  12. 16 2月, 2012 9 次提交
    • G
      irq_domain: constify irq_domain_ops · a18dc81b
      Grant Likely 提交于
      Make irq_domain_ops pointer a constant to make it safer for multiple
      instances to share the same ops pointer and change the irq_domain code
      so that it does not modify the ops.
      
      v4: Fix mismatched type reference in powerpc code
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      a18dc81b
    • G
      irq_domain: Create common xlate functions that device drivers can use · 16b2e6e2
      Grant Likely 提交于
      Rather than having each interrupt controller driver creating its own barely
      unique .xlate function for irq_domain, create a library of translators which
      any driver can use directly.
      
      v5: - Remove irq_domain_xlate_pci().  It was incorrect.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      16b2e6e2
    • G
      irq_domain: Remove irq_domain_add_simple() · 6b783f7c
      Grant Likely 提交于
      irq_domain_add_simple() was a stop-gap measure until complete irq_domain
      support was complete.  This patch removes the irq_domain_add_simple()
      interface.
      
      This patch also drops the explicit irq_domain initialization performed
      by the mach-versatile code because the versatile interrupt controller
      already has irq_domain support built into it.  This was a bug that was
      hanging around quietly for a while, but with the full irq_domain which
      actually verifies that irq_domain ranges are available it would cause
      the registration to fail and the system wouldn't boot.
      
      v4: Fixed number of irqs in mx5 gpio code
      v2: Updated to pass in host_data pointer on irq_domain allocation.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Tested-by: NOlof Johansson <olof@lixom.net>
      6b783f7c
    • G
      irq_domain: Remove 'new' irq_domain in favour of the ppc one · 75294957
      Grant Likely 提交于
      This patch removes the simplistic implementation of irq_domains and enables
      the powerpc infrastructure for all irq_domain users.  The powerpc
      infrastructure includes support for complex mappings between Linux and
      hardware irq numbers, and can manage allocation of irq_descs.
      
      This patch also converts the few users of irq_domain_add()/irq_domain_del()
      to call irq_domain_add_legacy() instead.
      
      v3: Fix bug that set up too many irqs in translation range.
      v2: Fix removal of irq_alloc_descs() call in gic driver
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      75294957
    • G
      irq_domain: Add support for base irq and hwirq in legacy mappings · 1bc04f2c
      Grant Likely 提交于
      Add support for a legacy mapping where irq = (hwirq - first_hwirq + first_irq)
      so that a controller driver can allocate a fixed range of irq_descs and use
      a simple calculation to translate back and forth between linux and hw irq
      numbers.  This is needed to use an irq_domain with many of the ARM interrupt
      controller drivers that manage their own irq_desc allocations.  Ultimately
      the goal is to migrate those drivers to use the linear revmap, but doing it
      this way allows each driver to be converted separately which makes the
      migration path easier.
      
      This patch generalizes the IRQ_DOMAIN_MAP_LEGACY method to use
      (first_irq-first_hwirq) as the offset between hwirq and linux irq number,
      and adds checks to make sure that the hwirq number does not exceed range
      assigned to the controller.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      1bc04f2c
    • G
      irq_domain: Replace irq_alloc_host() with revmap-specific initializers · a8db8cf0
      Grant Likely 提交于
      Each revmap type has different arguments for setting up the revmap.
      This patch splits up the generator functions so that each revmap type
      can do its own setup and the user doesn't need to keep track of how
      each revmap type handles the arguments.
      
      This patch also adds a host_data argument to the generators.  There are
      cases where the host_data pointer will be needed before the function returns.
      ie. the legacy map calls the .map callback for each irq before returning.
      
      v2: - Add void *host_data argument to irq_domain_add_*() functions
          - fixed failure to compile
          - Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      a8db8cf0
    • G
      irq_domain: Remove references to old irq_host names · 68700650
      Grant Likely 提交于
      No functional changes.  Replaces non-exported references to 'host' with domain.
      Does not change any symbol names referenced by other .c files.
      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>
      Tested-by: NOlof Johansson <olof@lixom.net>
      68700650
    • G
      irq_domain: remove NO_IRQ from irq domain code · 03848373
      Grant Likely 提交于
      zero always means no irq when using irq domains.  Get rid of the NO_IRQ
      references.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      03848373
    • G
      irq_domain: Move irq_domain code from powerpc to kernel/irq · cc79ca69
      Grant Likely 提交于
      This patch only moves the code.  It doesn't make any changes, and the
      code is still only compiled for powerpc.  Follow-on patches will generalize
      the code for other architectures.
      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>
      Tested-by: NOlof Johansson <olof@lixom.net>
      cc79ca69
  13. 15 2月, 2012 2 次提交
  14. 28 12月, 2011 1 次提交
  15. 24 12月, 2011 1 次提交
  16. 31 10月, 2011 1 次提交
  17. 20 9月, 2011 1 次提交
  18. 28 7月, 2011 1 次提交