1. 01 11月, 2012 1 次提交
    • T
      genirq: Provide means to retrigger parent · 293a7a0a
      Thomas Gleixner 提交于
      Attempts to retrigger nested threaded IRQs currently fail because they
      have no primary handler. In order to support retrigger of nested
      IRQs, the parent IRQ needs to be retriggered.
      
      To fix, when an IRQ needs to be resent, if the interrupt has a parent
      IRQ and runs in the context of the parent IRQ, then resend the parent.
      
      Also, handle_nested_irq() needs to clear the replay flag like the
      other handlers, otherwise check_irq_resend() will set it and it will
      never be cleared.  Without clearing, it results in the first resend
      working fine, but check_irq_resend() returning early on subsequent
      resends because the replay flag is still set.
      
      Problem discovered on ARM/OMAP platforms where a nested IRQ that's
      also a wakeup IRQ happens late in suspend and needed to be retriggered
      during the resume process.
      
      [khilman@ti.com: changelog edits, clear IRQS_REPLAY in handle_nested_irq()]
      Reported-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1350425269-11489-1-git-send-email-khilman@deeprootsystems.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      293a7a0a
  2. 21 8月, 2012 1 次提交
  3. 25 5月, 2012 1 次提交
    • N
      genirq: Add IRQS_PENDING for nested and simple irq · 23812b9d
      Ning Jiang 提交于
      Every interrupt which is an active wakeup source needs the ability to
      abort suspend if there is a pending irq. Right now only edge and level
      irqs can do that.
      
                  |
             +---------+
             |   INTC  |
             +---------+
                     | GPIO_IRQ
                  +------------+
                  |  gpio-exp  |
                  +------------+
                    |        |
               GPIO0_IRQ  GPIO1_IRQ
      
      In the above diagram, gpio expander has irq number GPIO_IRQ, it is
      connected with two sub GPIO pins, GPIO0 and GPIO1.
      
      During suspend, we set IRQF_NO_SUSPEND for GPIO_IRQ so that gpio
      expander driver can handle the sub irq GPIO0_IRQ and GPIO1_IRQ, and
      these two irqs themselves can further be handled by simple or nested
      irq in some drivers(typically gpio and mfd driver). If they are used
      as wakeup sources during suspend, we want them to be able to abort
      suspend too.
      
      Setting IRQS_PENDING flag in handle_nested_irq() and handle_simple_irq()
      when the irq is disabled allows check_wakeup_irqs() to identify such
      irqs as source for aborting suspend.
      Signed-off-by: NNing Jiang <ning.n.jiang@gmail.com>
      Cc: rjw@sisk.pl
      Link: http://lkml.kernel.org/r/CAH3Oq6T905%2B3fkF43NAMMFvJvq7dsk_so6T2vQ8ZJrA5xiU3YA@mail.gmail.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      23812b9d
  4. 15 5月, 2012 1 次提交
    • J
      genirq: export handle_edge_irq() and irq_to_desc() · 3911ff30
      Jiri Kosina 提交于
      Export handle_edge_irq() and irq_to_desc() to modules to allow them to
      do things such as
      
      	__irq_set_handler_locked(...., handle_edge_irq);
      
      This fixes
      
      	ERROR: "handle_edge_irq" [drivers/gpio/gpio-pch.ko] undefined!
      	ERROR: "irq_to_desc" [drivers/gpio/gpio-pch.ko] undefined!
      
      when gpio-pch is being built as a module.
      
      This was introduced by commit df9541a6 ("gpio: pch9: Use proper flow
      type handlers") that added
      
      	__irq_set_handler_locked(d->irq, handle_edge_irq);
      
      but handle_edge_irq() was not exported for modules (and inlined
      __irq_set_handler_locked() requires irq_to_desc() exported as well)
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3911ff30
  5. 05 5月, 2012 1 次提交
    • T
      genirq: Allow check_wakeup_irqs to notice level-triggered interrupts · d4dc0f90
      Thomas Gleixner 提交于
      Level triggered interrupts do not cause IRQS_PENDING to be set when
      they fire while "disabled" as the 'pending' state is always present in
      the level - they automatically refire where re-enabled.
      
      However the IRQS_PENDING flag is also used to abort a suspend cycle -
      if any 'is_wakeup_set' interrupt is PENDING, check_wakeup_irqs() will
      cause suspend to abort. Without IRQS_PENDING, suspend won't abort.
      
      Consequently, level-triggered interrupts that fire during the 'noirq'
      phase of suspend do not currently abort suspend.
      
      So set IRQS_PENDING even for level triggered interrupts, and make sure
      to clear the flag in check_irq_resend.
      
      [ Changelog by courtesy of Neil ]
      Tested-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      d4dc0f90
  6. 06 3月, 2012 1 次提交
    • R
      genirq: Fix long-term regression in genirq irq_set_irq_type() handling · a09b659c
      Russell King 提交于
      In 2008, commit 0c5d1eb7 ("genirq: record trigger type") modified the
      way set_irq_type() handles the 'no trigger' condition.  However, this has
      an adverse effect on PCMCIA support on Intel StrongARM and probably PXA
      platforms.
      
      PCMCIA has several status signals on the socket which can trigger
      interrupts; some of these status signals depend on the card's mode
      (whether it is configured in memory or IO mode).  For example, cards have
      a 'Ready/IRQ' signal: in memory mode, this provides an indication to
      PCMCIA that the card has finished its power up initialization.  In IO
      mode, it provides the device interrupt signal.  Other status signals
      switch between on-board battery status and loud speaker output.
      
      In classical PCMCIA implementations, where you have a specific socket
      controller, the controller provides a method to mask interrupts from the
      socket, and importantly ignore any state transitions on the pins which
      correspond with interrupts once masked.  This masking prevents unwanted
      events caused by the removal and application of socket power being
      forwarded.
      
      However, on platforms where there is no socket controller, the PCMCIA
      status and interrupt signals are routed to standard edge-triggered GPIOs. 
      These GPIOs can be configured to interrupt on rising edge, falling edge,
      or never.  This is where the problems start.
      
      Edge triggered interrupts are required to record events while disabled via
      the usual methods of {free,request,disable,enable}_irq() to prevent
      problems with dropped interrupts (eg, the 8390 driver uses disable_irq()
      to defer the delivery of interrupts).  As a result, these interfaces can
      not be used to implement the desired behaviour.
      
      The side effect of this is that if the 'Ready/IRQ' GPIO is disabled via
      disable_irq() on suspend, and enabled via enable_irq() after resume, we
      will record the state transitions caused by powering events as valid
      interrupts, and foward them to the card driver, which may attempt to
      access a card which is not powered up.
      
      This leads delays resume while drivers spin in their interrupt handlers,
      and complaints from drivers before they realize what's happened.
      
      Moreover, in the case of the 'Ready/IRQ' signal, this is requested and
      freed by the card driver itself; the PCMCIA core has no idea whether the
      interrupt is requested, and, therefore, whether a call to disable_irq()
      would be valid.  (We tried this around 2.4.17 / 2.5.1 kernel era, and
      ended up throwing it out because of this problem.)
      
      Therefore, it was decided back in around 2002 to disable the edge
      triggering instead, resulting in all state transitions on the GPIO being
      ignored.  That's what we actually need the hardware to do.
      
      The commit above changes this behaviour; it explicitly prevents the 'no
      trigger' state being selected.
      
      The reason that request_irq() does not accept the 'no trigger' state is
      for compatibility with existing drivers which do not provide their desired
      triggering configuration.  The set_irq_type() function is 'new' and not
      used by non-trigger aware drivers.
      
      Therefore, revert this change, and restore previously working platforms
      back to their former state.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Cc: linux@arm.linux.org.uk
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: stable@vger.kernel.org
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      a09b659c
  7. 15 2月, 2012 2 次提交
    • T
      genirq: Handle pending irqs in irq_startup() · b4bc724e
      Thomas Gleixner 提交于
      An interrupt might be pending when irq_startup() is called, but the
      startup code does not invoke the resend logic. In some cases this
      prevents the device from issuing another interrupt which renders the
      device non functional.
      
      Call the resend function in irq_startup() to keep things going.
      Reported-and-tested-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      b4bc724e
    • T
      genirq: Unmask oneshot irqs when thread was not woken · ac563761
      Thomas Gleixner 提交于
      When the primary handler of an interrupt which is marked IRQ_ONESHOT
      returns IRQ_HANDLED or IRQ_NONE, then the interrupt thread is not
      woken and the unmask logic of the interrupt line is never
      invoked. This keeps the interrupt masked forever.
      
      This was not noticed as most IRQ_ONESHOT users wake the thread
      unconditionally (usually because they cannot access the underlying
      device from hard interrupt context). Though this behaviour was nowhere
      documented and not necessarily intentional. Some drivers can avoid the
      thread wakeup in certain cases and run into the situation where the
      interrupt line s kept masked.
      
      Handle it gracefully.
      Reported-and-tested-by: NLothar Wassmann <lw@karo-electronics.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      ac563761
  8. 03 2月, 2012 1 次提交
  9. 03 10月, 2011 1 次提交
    • M
      genirq: Add support for per-cpu dev_id interrupts · 31d9d9b6
      Marc Zyngier 提交于
      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: NMarc 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: NThomas Gleixner <tglx@linutronix.de>
      31d9d9b6
  10. 12 9月, 2011 1 次提交
  11. 18 5月, 2011 1 次提交
  12. 23 4月, 2011 1 次提交
  13. 31 3月, 2011 1 次提交
  14. 30 3月, 2011 2 次提交
  15. 29 3月, 2011 2 次提交
  16. 28 3月, 2011 2 次提交
  17. 27 3月, 2011 4 次提交
  18. 02 3月, 2011 1 次提交
  19. 22 2月, 2011 1 次提交
  20. 19 2月, 2011 14 次提交