1. 30 7月, 2015 2 次提交
    • M
      PCI/MSI: Drop domain field from msi_controller · f075915a
      Marc Zyngier 提交于
      The only three users of that field are not using the msi_controller
      structure anymore, so drop it altogether.
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: <linux-arm-kernel@lists.infradead.org>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Ma Jun <majun258@huawei.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Duc Dang <dhdang@apm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/1438091186-10244-20-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f075915a
    • M
      drivers/base: Add MSI domain support for non-PCI devices · c09fcc4b
      Marc Zyngier 提交于
      With the msi_list and the msi_domain properties now being at the
      generic device level, it is starting to be relatively easy to offer
      a generic way of providing non-PCI MSIs.
      
      The two major hurdles with this idea are:
      
      - Lack of global ID that identifies a device: this is worked around by
        having a global ID allocator for each device that gets enrolled in
        the platform MSI subsystem
      
      - Lack of standard way to write the message in the generating device.
        This is solved by mandating driver code to provide a write_msg
        callback, so that everyone can have their own square wheel
      
      Apart from that, the API is fairly straightforward:
      
      - platform_msi_create_irq_domain creates an MSI domain that gets
        tagged with DOMAIN_BUS_PLATFORM_MSI
      
      - platform_msi_domain_alloc_irqs allocate MSIs for a given device,
        populating the msi_list
      
      - platform_msi_domain_free_irqs does what is written on the tin
      
      [ tglx: Created a seperate struct platform_msi_desc and added
        	kerneldoc entries ]
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: <linux-arm-kernel@lists.infradead.org>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Ma Jun <majun258@huawei.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Duc Dang <dhdang@apm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/1438091186-10244-10-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      c09fcc4b
  2. 23 7月, 2015 5 次提交
  3. 24 11月, 2014 1 次提交
  4. 23 11月, 2014 9 次提交
  5. 12 11月, 2014 3 次提交
  6. 07 11月, 2014 1 次提交
    • Y
      PCI/MSI: Add pci_msi_ignore_mask to prevent writes to MSI/MSI-X Mask Bits · 38737d82
      Yijing Wang 提交于
      MSI-X vector Mask Bits are in MSI-X Tables in PCI memory space.  Xen PV
      guests can't write to those tables.  MSI vector Mask Bits are in PCI
      configuration space.  Xen PV guests can write to config space, but those
      writes are ignored.
      
      Commit 0e4ccb15 ("PCI: Add x86_msi.msi_mask_irq() and
      msix_mask_irq()") added a way to override default_mask_msi_irqs() and
      default_mask_msix_irqs() so they can be no-ops in Xen guests, but this is
      more complicated than necessary.
      
      Add "pci_msi_ignore_mask" in the core PCI MSI code.  If set,
      default_mask_msi_irqs() and default_mask_msix_irqs() return without doing
      anything.  This is less flexible, but much simpler.
      
      [bhelgaas: changelog]
      Signed-off-by: NYijing Wang <wangyijing@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
      CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      CC: xen-devel@lists.xenproject.org
      38737d82
  7. 02 10月, 2014 3 次提交
  8. 04 7月, 2014 1 次提交
  9. 13 12月, 2013 1 次提交
  10. 15 11月, 2013 1 次提交
  11. 07 11月, 2013 1 次提交
    • K
      PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq() · 0e4ccb15
      Konrad Rzeszutek Wilk 提交于
      Certain platforms do not allow writes in the MSI-X BARs to setup or tear
      down vector values.  To combat against the generic code trying to write to
      that and either silently being ignored or crashing due to the pagetables
      being marked R/O this patch introduces a platform override.
      
      Note that we keep two separate, non-weak, functions default_mask_msi_irqs()
      and default_mask_msix_irqs() for the behavior of the arch_mask_msi_irqs()
      and arch_mask_msix_irqs(), as the default behavior is needed by x86 PCI
      code.
      
      For Xen, which does not allow the guest to write to MSI-X tables - as the
      hypervisor is solely responsible for setting the vector values - we
      implement two nops.
      
      This fixes a Xen guest crash when passing a PCI device with MSI-X to the
      guest.  See the bugzilla for more details.
      
      [bhelgaas: add bugzilla info]
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=64581Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
      CC: Zhenzhong Duan <zhenzhong.duan@oracle.com>
      0e4ccb15
  12. 12 8月, 2013 3 次提交
  13. 29 5月, 2013 1 次提交
    • A
      PCI: Allocate only as many MSI vectors as requested by driver · 65f6ae66
      Alexander Gordeev 提交于
      Because of the encoding of the "Multiple Message Capable" and "Multiple
      Message Enable" fields, a device can only advertise that it's capable of a
      power-of-two number of vectors, and the OS can only enable a power-of-two
      number.
      
      For example, a device that's limited internally to using 18 vectors would
      have to advertise that it's capable of 32.  The 14 extra vectors consume
      vector numbers and IRQ descriptors even though the device can't actually
      use them.
      
      This fix introduces a 'msi_desc::nvec_used' field to address this issue.
      When non-zero, it is the actual number of MSIs the device will send, as
      requested by the device driver.  This value should be used by architectures
      to set up and tear down only as many interrupt resources as the device will
      actually use.
      
      Note, although the existing 'msi_desc::multiple' field might seem
      redundant, in fact it is not.  The number of MSIs advertised need not be
      the smallest power-of-two larger than the number of MSIs the device will
      send.  Thus, it is not always possible to derive the former from the
      latter, so we need to keep them both to handle this case.
      
      [bhelgaas: changelog, rename to "nvec_used"]
      Signed-off-by: NAlexander Gordeev <agordeev@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      65f6ae66
  14. 23 4月, 2013 1 次提交
  15. 07 1月, 2012 1 次提交
  16. 06 12月, 2011 1 次提交
  17. 12 10月, 2010 2 次提交
  18. 31 7月, 2010 1 次提交
  19. 21 3月, 2009 2 次提交
    • M
      PCI MSI: Add support for multiple MSI · 1c8d7b0a
      Matthew Wilcox 提交于
      Add the new API pci_enable_msi_block() to allow drivers to
      request multiple MSI and reimplement pci_enable_msi in terms of
      pci_enable_msi_block.  Ensure that the architecture back ends don't
      have to know about multiple MSI.
      Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      1c8d7b0a
    • M
      PCI MSI: Refactor interrupt masking code · f2440d9a
      Matthew Wilcox 提交于
      Since most of the callers already know whether they have an MSI or
      an MSI-X capability, split msi_set_mask_bits() into msi_mask_irq()
      and msix_mask_irq().  The only callers which don't (mask_msi_irq()
      and unmask_msi_irq()) can share code in msi_set_mask_bit().  This then
      becomes the only caller of msix_flush_writes(), so we can inline it.
      The flushing read can be to any address that belongs to the device,
      so we can eliminate the calculation too.
      
      We can also get rid of maskbits_mask from struct msi_desc and simply
      recalculate it on the rare occasion that we need it.  The single-bit
      'masked' element is replaced by a copy of the 32-bit 'masked' register,
      so this patch does not affect the size of msi_desc.
      Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f2440d9a