1. 20 2月, 2014 2 次提交
    • T
      genirq: Provide irq_wake_thread() · a92444c6
      Thomas Gleixner 提交于
      In course of the sdhci/sdio discussion with Russell about killing the
      sdio kthread hackery we discovered the need to be able to wake an
      interrupt thread from software.
      
      The rationale for this is, that sdio hardware can lack proper
      interrupt support for certain features. So the driver needs to poll
      the status registers, but at the same time it needs to be woken up by
      an hardware interrupt.
      
      To be able to get rid of the home brewn kthread construct of sdio we
      need a way to wake an irq thread independent of an actual hardware
      interrupt.
      
      Provide an irq_wake_thread() function which wakes up the thread which
      is associated to a given dev_id. This allows sdio to invoke the irq
      thread from the hardware irq handler via the IRQ_WAKE_THREAD return
      value and provides a possibility to wake it via a timer for the
      polling scenarios. That allows to simplify the sdio logic
      significantly.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Chris Ball <chris@printf.net>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20140215003823.772565780@linutronix.de
      a92444c6
    • T
      genirq: Provide synchronize_hardirq() · 18258f72
      Thomas Gleixner 提交于
      synchronize_irq() waits for hard irq and threaded handlers to complete
      before returning. For some special cases we only need to make sure
      that the hard interrupt part of the irq line is not in progress when
      we disabled the - possibly shared - interrupt at the device level.
      
      A proper use case for this was provided by Russell. The sdhci driver
      requires some irq triggered functions to be run in thread context. The
      current implementation of the thread context is a sdio private kthread
      construct, which has quite some shortcomings. These can be avoided
      when the thread is directly associated to the device interrupt via the
      generic threaded irq infrastructure.
      
      Though there is a corner case related to run time power management
      where one side disables the device interrupts at the device level and
      needs to make sure, that an already running hard interrupt handler has
      completed before proceeding further. Though that hard interrupt
      handler might wake the associated thread, which in turn can request
      the runtime PM to reenable the device. Using synchronize_irq() leads
      to an immediate deadlock of the irq thread waiting for the PM lock and
      the synchronize_irq() waiting for the irq thread to complete.
      
      Due to the fact that it is sufficient for this case to ensure that no
      hard irq handler is executing a new function which avoids the check
      for the thread is required.
      
      Add a function, which just monitors the hard irq parts and ignores the
      threaded handlers.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NRussell King <linux@arm.linux.org.uk>
      Cc: Chris Ball <chris@printf.net>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20140215003823.653236081@linutronix.de
      18258f72
  2. 11 2月, 2014 1 次提交
  3. 09 2月, 2014 1 次提交
  4. 05 2月, 2014 1 次提交
  5. 26 11月, 2013 1 次提交
  6. 13 11月, 2013 1 次提交
    • T
      genirq: Prevent spurious detection for unconditionally polled interrupts · b39898cd
      Thomas Gleixner 提交于
      On a 68k platform a couple of interrupts are demultiplexed and
      "polled" from a top level interrupt. Unfortunately there is no way to
      determine which of the sub interrupts raised the top level interrupt,
      so all of the demultiplexed interrupt handlers need to be
      invoked. Given a high enough frequency this can trigger the spurious
      interrupt detection mechanism, if one of the demultiplex interrupts
      returns IRQ_NONE continuously. But this is a false positive as the
      polling causes this behaviour and not buggy hardware/software.
      
      Introduce IRQ_POLLED which can be set at interrupt chip setup time via
      irq_set_status_flags(). The flag excludes the interrupt from the
      spurious detector and from all core polling activities.
      Reported-and-tested-by: NMichael Schmitz <schmitzmic@gmail.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: linux-m68k@vger.kernel.org
      Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1311061149250.23353@ionos.tec.linutronix.de
      b39898cd
  7. 28 10月, 2013 1 次提交
  8. 24 10月, 2013 1 次提交
  9. 18 10月, 2013 1 次提交
  10. 13 9月, 2013 1 次提交
  11. 05 7月, 2013 1 次提交
  12. 28 6月, 2013 3 次提交
  13. 25 6月, 2013 1 次提交
  14. 24 6月, 2013 6 次提交
    • J
      genirq: Irqchip: document gcflags arg of irq_alloc_domain_generic_chips · 6fff8314
      James Hogan 提交于
      Commit 088f40b7 ("genirq: Generic chip:
      Add linear irq domain support") missed kerneldoc for the gcflags
      argument of irq_alloc_domain_generic_chips(). Add it now.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Link: http://lkml.kernel.org/r/1371564513-4327-1-git-send-email-james.hogan@imgtec.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      6fff8314
    • 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: Include hwirq number in /proc/interrupts · c12d2f42
      Grant Likely 提交于
      Add the hardware interrupt number to the output of /proc/interrupts.
      It is often important to have access to the hardware interrupt number because
      it identifies exactly how an interrupt signal is wired up to the interrupt
      controller.  This is especially important when using irq_domains since irq
      numbers get dynamically allocated in that case, and have no relation to the
      actual hardware number.
      
      Note: This output is currently conditional on whether or not the irq_domain
      pointer is set; however hwirq could still be used without irq_domain.  It
      may be worthwhile to always output the hwirq number regardless of the
      domain pointer.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NOlof Johansson <olof@lixom.net>
      Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      c12d2f42
    • 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
  15. 18 6月, 2013 2 次提交
  16. 11 6月, 2013 1 次提交
  17. 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
  18. 09 6月, 2013 3 次提交
  19. 29 5月, 2013 5 次提交