1. 21 6月, 2017 2 次提交
  2. 04 6月, 2017 1 次提交
    • T
      genirq: Handle NOAUTOEN interrupt setup proper · 201d7f47
      Thomas Gleixner 提交于
      If an interrupt is marked NOAUTOEN then request_irq() installs the action,
      but does not enable the interrupt via startup_irq().  The interrupt is
      enabled via enable_irq() later from the driver. enable_irq() calls
      irq_enable().
      
      That means that for interrupts which have a irq_startup() callback this
      callback is never invoked. Neither is irq_domain_activate_irq() invoked for
      such interrupts.
      
      If an interrupt depends on irq_startup() or irq_domain_activate_irq() then
      the enable via irq_enable() is not enough.
      
      Add a status flag IRQD_IRQ_STARTED_UP and use this to select the proper
      mechanism in enable_irq(). Use the flag also to avoid pointless calls into
      the low level functions.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: dianders@chromium.org
      Cc: jeffy <jeffy.chen@rock-chips.com>
      Cc: Brian Norris <briannorris@chromium.org>
      Cc: tfiga@chromium.org
      Link: http://lkml.kernel.org/r/20170531100212.130986205@linutronix.de
      201d7f47
  3. 10 2月, 2017 1 次提交
  4. 30 1月, 2017 1 次提交
  5. 13 9月, 2016 1 次提交
  6. 03 9月, 2016 1 次提交
    • S
      genirq/generic_chip: Verify irqs_per_chip <= 32 · f88eecfe
      Sebastian Frias 提交于
      Most (if not all) code here implicitly assumes that the maximum number of
      IRQs per chip will be 32, and thus uses 'u32' or 'unsigned long' for many
      tasks (for example "struct irq_data" declares its 'mask' field as 'u32',
      and "struct irq_chip_generic" declares its 'installed' field as 'unsigned
      long')
      
      However, there is no check to verify that irqs_per_chip is <= 32.  Hence,
      calling irq_alloc_domain_generic_chips() with a bigger value will result in
      unexpected results.
      
      Provide a wrapper with a MAYBE_BUILD_BUG_ON(nrirqs >= 32) to catch such
      cases.
      
      [ tglx: Reduced changelog to the essential information ]
      Signed-off-by: NSebastian Frias <sf84@laposte.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Mason <slash.tmp@free.fr>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/57B31D94.5040701@laposte.netSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f88eecfe
  7. 04 7月, 2016 2 次提交
  8. 18 6月, 2016 1 次提交
    • K
      genirq: Add untracked irq handler · edd14cfe
      Keith Busch 提交于
      This adds a software irq handler for controllers that multiplex
      interrupts from multiple devices, but don't know which device generated
      the interrupt. For these devices, the irq handler that demuxes must
      check every action for every software irq using the same h/w irq in order
      to find out which device generated the interrupt. This will inevitably
      trigger spurious interrupt detection if we are noting the irq.
      
      The new irq handler does not track the handling for spurious interrupt
      detection. An irq that uses this also won't get stats tracked since it
      didn't generate the interrupt, nor added to randomness since they are
      not random.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: linux-pci@vger.kernel.org
      Cc: Jon Derrick <jonathan.derrick@intel.com>
      Link: http://lkml.kernel.org/r/1466200821-29159-1-git-send-email-keith.busch@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      edd14cfe
  9. 13 6月, 2016 1 次提交
  10. 02 5月, 2016 1 次提交
  11. 25 2月, 2016 6 次提交
  12. 24 2月, 2016 1 次提交
  13. 11 10月, 2015 1 次提交
    • T
      genirq: Add flag to force mask in disable_irq[_nosync]() · e9849777
      Thomas Gleixner 提交于
      If an irq chip does not implement the irq_disable callback, then we
      use a lazy approach for disabling the interrupt. That means that the
      interrupt is marked disabled, but the interrupt line is not
      immediately masked in the interrupt chip. It only becomes masked if
      the interrupt is raised while it's marked disabled. We use this to avoid
      possibly expensive mask/unmask operations for common case operations.
      
      Unfortunately there are devices which do not allow the interrupt to be
      disabled easily at the device level. They are forced to use
      disable_irq_nosync(). This can result in taking each interrupt twice.
      
      Instead of enforcing the non lazy mode on all interrupts of a irq
      chip, provide a settings flag, which can be set by the driver for that
      particular interrupt line.
      Reported-and-tested-by: NDuc Dang <dhdang@apm.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1510092348370.6097@nanos
      e9849777
  14. 01 10月, 2015 3 次提交
  15. 16 9月, 2015 6 次提交
  16. 15 9月, 2015 1 次提交
  17. 20 8月, 2015 1 次提交
  18. 27 7月, 2015 1 次提交
    • B
      genirq: Add chip_[suspend|resume] PM support to irq_chip · be9b22b6
      Brian Norris 提交于
      Some (admittedly odd) irqchips perform functions that are not directly
      related to any of their child IRQ lines, and therefore need to perform
      some tasks during suspend/resume regardless of whether there are
      any "installed" interrupts for the irqchip. However, the current
      generic-chip framework does not call the chip's irq_{suspend,resume}
      when there are no interrupts installed (this makes sense, because there
      are no irq_data objects for such a call to be made).
      
      More specifically, irq-bcm7120-l2 configures both a forwarding mask
      (which affects other top-level GIC IRQs) and a second-level interrupt
      mask (for managing its own child interrupts). The former must be
      saved/restored on suspend/resume, even when there's nothing to do for
      the latter.
      
      This patch adds a new set of suspend/resume hooks to irq_chip_generic,
      to help represent *chip* suspend/resume, rather than IRQ suspend/resume.
      These callbacks will always be called for an IRQ chip (regardless of the
      installed interrupts) and are based on the per-chip irq_chip_generic
      struct, rather than the per-IRQ irq_data struct.
      
      The original problem report is described in extra detail here:
      http://lkml.kernel.org/g/20150619224123.GL4917@ld-irv-0074Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Tested-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Cc: Gregory Fong <gregory.0xf0@gmail.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: linux-mips@linux-mips.org
      Cc: Kevin Cernekee <cernekee@chromium.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/1437607300-40858-1-git-send-email-computersforpeace@gmail.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      be9b22b6
  19. 17 7月, 2015 1 次提交
  20. 12 7月, 2015 1 次提交
  21. 25 6月, 2015 1 次提交
  22. 18 6月, 2015 1 次提交
    • R
      irq: Add irq_set_chained_handler_and_data() · 3b0f95be
      Russell King 提交于
      Driver authors seem to get the ordering of irq_set_chained_handler()
      and irq_set_handler_data() wrong - ordering the former before the
      latter.  This opens a race window where, if there is an interrupt
      pending, the handler will be called between these two calls,
      potentially resulting in an oops.
      
      Provide a single interface to set both of these together, especially
      as that's commonly what is required.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/E1Z4yzs-0002Rw-4B@rmk-PC.arm.linux.org.ukSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      3b0f95be
  23. 12 6月, 2015 3 次提交
  24. 19 5月, 2015 1 次提交
    • J
      genirq: Introduce irq_set_vcpu_affinity() to target an interrupt to a VCPU · 0a4377de
      Jiang Liu 提交于
      With Posted-Interrupts support in Intel CPU and IOMMU, an external
      interrupt from assigned-devices could be directly delivered to a
      virtual CPU in a virtual machine. Instead of hacking KVM and Intel
      IOMMU drivers, we propose a platform independent interface to target
      an interrupt to a specific virtual CPU in a virtual machine, or set
      virtual CPU affinity for an interrupt.
      
      By adopting this new interface and the hierarchy irqdomain, we could
      easily support posted-interrupts on Intel platforms, and also provide
      flexible enough interfaces for other platforms to support similar
      features.
      
      Here is the usage scenario for this interface:
      Guest update MSI/MSI-X interrupt configuration
              -->QEMU and KVM handle this
              -->KVM call this interface (passing posted interrupts descriptor
                 and guest vector)
              -->irq core will transfer the control to IOMMU
              -->IOMMU will do the real work of updating IRTE (IRTE has new
                 format for VT-d Posted-Interrupts)
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Signed-off-by: NFeng Wu <feng.wu@intel.com>
      Link: http://lkml.kernel.org/r/1432026437-16560-2-git-send-email-feng.wu@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      0a4377de