1. 19 Jul, 2012 1 commit
  2. 31 Oct, 2011 1 commit
    • Paul Gortmaker's avatar
      irq: don't put module.h into irq.h for tracking irqgen modules. · ec53cf23
      Paul Gortmaker authored
      Recent commit "irq: Track the  owner of irq descriptor" in
      commit ID b6873807 placed module.h into linux/irq.h
      but we are trying to limit module.h inclusion to just C files
      that really need it, due to its size and number of children
      includes.  This targets just reversing that include.
      Add in the basic "struct module" since that is all we really need
      to ensure things compile.  In theory, b6873807 should have added the
      module.h include to the irqdesc.h header as well, but the implicit
      module.h everywhere presence masked this from showing up.  So give
      it the "struct module" as well.
      As for the C files, irqdesc.c is only using THIS_MODULE, so it
      does not need module.h - give it export.h instead.  The C file
      irq/manage.c is now (as of b6873807) using try_module_get and
      module_put and so it needs module.h (which it already has).
      Also convert the irq_alloc_descs variants to macros, since all
      they really do is is call the __irq_alloc_descs primitive.
      This avoids including export.h and no debug info is lost.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
  3. 03 Oct, 2011 1 commit
    • Marc Zyngier's avatar
      genirq: Add support for per-cpu dev_id interrupts · 31d9d9b6
      Marc Zyngier authored
      The ARM GIC interrupt controller offers per CPU interrupts (PPIs),
      which are usually used to connect local timers to each core. Each CPU
      has its own private interface to the GIC, and only sees the PPIs that
      are directly connect to it.
      While these timers are separate devices and have a separate interrupt
      line to a core, they all use the same IRQ number.
      For these devices, request_irq() is not the right API as it assumes
      that an IRQ number is visible by a number of CPUs (through the
      affinity setting), but makes it very awkward to express that an IRQ
      number can be handled by all CPUs, and yet be a different interrupt
      line on each CPU, requiring a different dev_id cookie to be passed
      back to the handler.
      The *_percpu_irq() functions is designed to overcome these
      limitations, by providing a per-cpu dev_id vector:
      int request_percpu_irq(unsigned int irq, irq_handler_t handler,
      		   const char *devname, void __percpu *percpu_dev_id);
      void free_percpu_irq(unsigned int, void __percpu *);
      int setup_percpu_irq(unsigned int irq, struct irqaction *new);
      void remove_percpu_irq(unsigned int irq, struct irqaction *act);
      void enable_percpu_irq(unsigned int irq);
      void disable_percpu_irq(unsigned int irq);
      The API has a number of limitations:
      - no interrupt sharing
      - no threading
      - common handler across all the CPUs
      Once the interrupt is requested using setup_percpu_irq() or
      request_percpu_irq(), it must be enabled by each core that wishes its
      local interrupt to be delivered.
      Based on an initial patch by Thomas Gleixner.
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1316793788-14500-2-git-send-email-marc.zyngier@arm.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
  4. 28 Jul, 2011 1 commit
  5. 18 May, 2011 1 commit
    • Thomas Gleixner's avatar
      genirq: Uninline and sanity check generic_handle_irq() · fe12bc2c
      Thomas Gleixner authored
      generic_handle_irq() is missing a NULL pointer check for the result of
      irq_to_desc. This was a not a big problem, but we want to expose it to
      drivers, so we better have sanity checks in place. Add a return value
      as well, which indicates that the irq number was valid and the handler
      was invoked.
      Based on the pure code move from Jonathan Cameron.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Jonathan Cameron <jic23@cam.ac.uk>
  6. 23 Apr, 2011 2 commits
  7. 29 Mar, 2011 1 commit
  8. 23 Mar, 2011 3 commits
  9. 11 Mar, 2011 1 commit
  10. 25 Feb, 2011 1 commit
    • Thomas Gleixner's avatar
      genirq: Prepare the handling of shared oneshot interrupts · b5faba21
      Thomas Gleixner authored
      For level type interrupts we need to track how many threads are on
      flight to avoid useless interrupt storms when not all thread handlers
      have finished yet. Keep track of the woken threads and only unmask
      when there are no more threads in flight.
      Yes, I'm lazy and using a bitfield. But not only because I'm lazy, the
      main reason is that it's way simpler than using a refcount. A refcount
      based solution would need to keep track of various things like
      crashing the irq thread, spurious interrupts coming in,
      disables/enables, free_irq() and some more. The bitfield keeps the
      tracking simple and makes things just work. It's also nicely confined
      to the thread code pathes and does not require additional checks all
      over the place.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <20110223234956.388095876@linutronix.de>
  11. 19 Feb, 2011 5 commits
    • Thomas Gleixner's avatar
      genirq: Add preflow handler support · 78129576
      Thomas Gleixner authored
      sparc64 needs to call a preflow handler on certain interrupts befor
      calling the action chain. Integrate it into handle_fasteoi_irq. Must
      be enabled via CONFIG_IRQ_FASTEOI_PREFLOW. No impact when disabled.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: David S. Miller <davem@davemloft.net>
    • Thomas Gleixner's avatar
      genirq: Remove desc->status when GENERIC_HARDIRQS_NO_COMPAT=y · a6967caf
      Thomas Gleixner authored
      If everything uses the right accessors, then enabling
      GENERIC_HARDIRQS_NO_COMPAT should just work. If not it will tell you.
      Don't be lazy and use the trick which I use in the core code!
      git grep status_use_accessors
      will unearth it in a split second. Offenders are tracked down and not
      slapped with stinking trouts. This time we use frozen shark for a
      better educational value.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    • Thomas Gleixner's avatar
      genirq: Add state field to irq_data · 91c49917
      Thomas Gleixner authored
      Some chip implementations need to access certain status flags. With
      sparse irqs that requires a lookup of the irq descriptor. Add a state
      field which contains such flags.
      Name it in a way which will make coders happy to access it with the
      proper accessor functions. And it's easy to grep for.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    • Thomas Gleixner's avatar
      genirq: Add internal state field to irq_desc · dbec07ba
      Thomas Gleixner authored
      That field will contain internal state information which is not going
      to be exposed to anything outside the core code - except via accessor
      functions. I'm tired of everyone fiddling in irq_desc.status.
      core_internal_state__do_not_mess_with_it is clear enough, annoying to
      type and easy to grep for. Offenders will be tracked down and slapped
      with stinking trouts.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    • Thomas Gleixner's avatar
      genirq: Namespace cleanup · a0cd9ca2
      Thomas Gleixner authored
      The irq namespace has become quite convoluted. My bad.  Clean it up
      and deprecate the old functions. All new functions follow the scheme:
      irq number based:
          irq_set/get/xxx/_xxx(unsigned int irq, ...)
      irq_data based:
      	 irq_data_set/get/xxx/_xxx(struct irq_data *d, ....)
      irq_desc based:
      	 irq_desc_get_xxx(struct irq_desc *desc)
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
  12. 22 Jan, 2011 1 commit
    • Ben Hutchings's avatar
      genirq: Add IRQ affinity notifiers · cd7eab44
      Ben Hutchings authored
      When initiating I/O on a multiqueue and multi-IRQ device, we may want
      to select a queue for which the response will be handled on the same
      or a nearby CPU.  This requires a reverse-map of IRQ affinity.  Add a
      notification mechanism to support this.
      This is based closely on work by Thomas Gleixner <tglx@linutronix.de>.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      Cc: linux-net-drivers@solarflare.com
      Cc: Tom Herbert <therbert@google.com>
      Cc: David Miller <davem@davemloft.net>
      LKML-Reference: <1295470904.11126.84.camel@bwh-desktop>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
  13. 21 Jan, 2011 1 commit
  14. 14 Jan, 2011 1 commit
    • Eric Dumazet's avatar
      irq: use per_cpu kstat_irqs · 6c9ae009
      Eric Dumazet authored
      Use modern per_cpu API to increment {soft|hard}irq counters, and use
      per_cpu allocation for (struct irq_desc)->kstats_irq instead of an array.
      This gives better SMP/NUMA locality and saves few instructions per irq.
      With small nr_cpuids values (8 for example), kstats_irq was a small array
      (less than L1_CACHE_BYTES), potentially source of false sharing.
      In the !CONFIG_SPARSE_IRQ case, remove the huge, NUMA/cache unfriendly
      kstat_irqs_all[NR_IRQS][NR_CPUS] array.
      Note: we still populate kstats_irq for all possible irqs in
      early_irq_init().  We probably could use on-demand allocations.  (Code
      included in alloc_descs()).  Problem is not all IRQS are used with a prior
      alloc_descs() call.
      kstat_irqs_this_cpu() is not used anymore, remove it.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Reviewed-by: default avatarChristoph Lameter <cl@linux.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  15. 12 Oct, 2010 3 commits