1. 02 5月, 2016 1 次提交
  2. 25 2月, 2016 6 次提交
  3. 24 2月, 2016 1 次提交
  4. 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
  5. 01 10月, 2015 3 次提交
  6. 16 9月, 2015 6 次提交
  7. 15 9月, 2015 1 次提交
  8. 20 8月, 2015 1 次提交
  9. 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
  10. 17 7月, 2015 1 次提交
  11. 12 7月, 2015 1 次提交
  12. 25 6月, 2015 1 次提交
  13. 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
  14. 12 6月, 2015 3 次提交
  15. 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
  16. 18 5月, 2015 1 次提交
    • S
      genirq: Add irq_chip_(enable/disable)_parent · 3cfeffc2
      Stefan Agner 提交于
      Add helper irq_chip_enable_parent and irq_chip_disable_parent. The
      helper implement the default behavior in case irq_enable or irq_disable
      is not implemented for the parent interrupt chip, which is calling the
      irq_mask or irq_unmask respectively.
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Cc: marc.zyngier@arm.com
      Cc: linux@arm.linux.org.uk
      Cc: u.kleine-koenig@pengutronix.de
      Cc: olof@lixom.net
      Cc: arnd@arndb.de
      Cc: daniel.lezcano@linaro.org
      Cc: mark.rutland@arm.com
      Cc: pawel.moll@arm.com
      Cc: robh+dt@kernel.org
      Cc: ijc+devicetree@hellion.org.uk
      Cc: galak@codeaurora.org
      Cc: mcoquelin.stm32@gmail.com
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: shawn.guo@linaro.org
      Cc: kernel@pengutronix.de
      Cc: jason@lakedaemon.net
      Link: http://lkml.kernel.org/r/1431769465-26867-3-git-send-email-stefan@agner.chSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      3cfeffc2
  17. 09 4月, 2015 1 次提交
    • M
      genirq: Allow the irqchip state of an IRQ to be save/restored · 1b7047ed
      Marc Zyngier 提交于
      There is a number of cases where a kernel subsystem may want to
      introspect the state of an interrupt at the irqchip level:
      
      - When a peripheral is shared between virtual machines,
        its interrupt state becomes part of the guest's state,
        and must be switched accordingly. KVM on arm/arm64 requires
        this for its guest-visible timer
      - Some GPIO controllers seem to require peeking into the
        interrupt controller they are connected to to report
        their internal state
      
      This seem to be a pattern that is common enough for the core code
      to try and support this without too many horrible hacks. Introduce
      a pair of accessors (irq_get_irqchip_state/irq_set_irqchip_state)
      to retrieve the bits that can be of interest to another subsystem:
      pending, active, and masked.
      
      - irq_get_irqchip_state returns the state of the interrupt according
        to a parameter set to IRQCHIP_STATE_PENDING, IRQCHIP_STATE_ACTIVE,
        IRQCHIP_STATE_MASKED or IRQCHIP_STATE_LINE_LEVEL.
      - irq_set_irqchip_state similarly sets the state of the interrupt.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
      Tested-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Phong Vo <pvo@apm.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Tin Huynh <tnhuynh@apm.com>
      Cc: Y Vo <yvo@apm.com>
      Cc: Toan Le <toanle@apm.com>
      Cc: Bjorn Andersson <bjorn@kryo.se>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Link: http://lkml.kernel.org/r/1426676484-21812-2-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      1b7047ed
  18. 15 3月, 2015 1 次提交
  19. 08 12月, 2014 1 次提交
  20. 23 11月, 2014 7 次提交
    • J
      genirq: Introduce callback irq_chip.irq_write_msi_msg · 9dde55b7
      Jiang Liu 提交于
      Introduce callback irq_chip.irq_write_msi_msg, so we can share common
      code among MSI alike interrupt controllers, such as HPET and DMAR.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      9dde55b7
    • T
      genirq: Split out flow handler typedefs into seperate header file · 75ffc007
      Thomas Gleixner 提交于
      Required to avoid circular include dependencies.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      75ffc007
    • J
      genirq: Add IRQ_SET_MASK_OK_DONE to support stacked irqchip · 2cb62547
      Jiang Liu 提交于
      Add IRQ_SET_MASK_OK_DONE in addition to IRQ_SET_MASK_OK and
      IRQ_SET_MASK_OK_NOCOPY to support stacked irqchip. IRQ_SET_MASK_OK_DONE
      is the same as IRQ_SET_MASK_OK to irq core. To stacked irqchip, it means
      that ascendant irqchips have done all the work and no more handling
      needed in descendant irqchips.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      2cb62547
    • J
      genirq: Introduce irq_chip.irq_compose_msi_msg() to support stacked irqchip · 515085ef
      Jiang Liu 提交于
      Add callback irq_compose_msi_msg to struct irq_chip, which will be used
      to support stacked irqchip.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      515085ef
    • Y
      genirq: Add more helper functions to support stacked irq_chip · 56e8abab
      Yingjoe Chen 提交于
      Add more helper function for stacked irq_chip to just call parent's
      function.
      Signed-off-by: NYingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Gran Likely <grant.likely@linaro.org>
      Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
      Cc: <linux-arm-kernel@lists.infradead.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: <srv_heupstream@mediatek.com>
      Cc: <yingjoe.chen@gmail.com>
      Cc: <hc.yen@mediatek.com>
      Cc: <eddie.huang@mediatek.com>
      Cc: <nathan.chung@mediatek.com>
      Cc: <yh.chen@mediatek.com>
      Cc: Sascha Hauer <kernel@pengutronix.de>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Link: http://lkml.kernel.org/r/1415893029-2971-3-git-send-email-yingjoe.chen@mediatek.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      56e8abab
    • J
      genirq: Introduce helper functions to support stacked irq_chip · 85f08c17
      Jiang Liu 提交于
      Now we already support hierarchy irq_data, so introduce several helpers
      to support stacked irq_chips.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      85f08c17
    • J
      irqdomain: Introduce new interfaces to support hierarchy irqdomains · f8264e34
      Jiang Liu 提交于
      We plan to use hierarchy irqdomain to suppport CPU vector assignment,
      interrupt remapping controller, IO-APIC controller, MSI interrupt
      and hypertransport interrupt etc on x86 platforms. So extend irqdomain
      interfaces to support hierarchy irqdomain.
      
      There are already many clients of current irqdomain interfaces.
      To minimize the changes, we choose to introduce new version 2 interfaces
      to support hierarchy instead of extending existing irqdomain interfaces.
      
      According to Thomas's suggestion, the most important design decision is
      to build hierarchy struct irq_data to support hierarchy irqdomain, so
      hierarchy irqdomain related data could be saved in struct irq_data.
      With support of hierarchy irq_data, we could also support stacked
      irq_chips. This is most useful in case of set_affinity().
      
      The new hierarchy irqdomain introduces following interfaces:
      1) irq_domain_alloc_irqs()/irq_domain_free_irqs(): allocate/release IRQ
         and related resources.
      2) __irq_domain_alloc_irqs(): a special version to support legacy IRQs.
      3) irq_domain_activate_irq()/irq_domain_deactivate_irq(): program
         interrupt controllers to activate/deactivate interrupt.
      
      There are also several help functions to ease irqdomain implemenations:
      1) irq_domain_get_irq_data(): get irq_data associated with a specific
         irqdomain.
      2) irq_domain_set_hwirq_and_chip(): save irqdomain specific data into
         irq_data.
      3) irq_domain_alloc_irqs_parent()/irq_domain_free_irqs_parent(): invoke
         parent irqdomain's alloc/free callbacks.
      
      We also changed irq_startup()/irq_shutdown() to invoke
      irq_domain_activate_irq()/irq_domain_deactivate_irq() to program
      interrupt controller when start/stop interrupts.
      
      [ tglx: Folded parts of the later patch series in ]
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f8264e34