Skip to content

Refine generic/PCI MSI irqodmian interfaces

Jiang Liu linux-arm-kernel linux-pci lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest9 patches 4 repliesIn review
  2. v29 patches 7 repliesSuperseded
  3. v16 patches 29 repliesSuperseded

Changes in v3 from the cover letter

1) Refine msi_domain_ops.set_desc() and msi_domain_ops.handle_error() interfaces.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9PCI, MSI: Fix errors caused by commit e5f1a59c4e12drivers/pci/msi.c include/linux/msi.h+1 -30 replies
2/9irqdomain: Use consistent prototype for irq_domain_free_irqs_*include/linux/irqdomain.h kernel/irq/irqdomain.c+9 -80 replies
3/9irqdomain: Implement a method to automatically call parent domain's alloc/freeinclude/linux/irqdomain.h kernel/irq/irqdomain.c+72 -180 replies
4/9irqdomain: Introduce helper function irq_domain_add_hierarchy()include/linux/irqdomain.h kernel/irq/irqdomain.c+23 -00 replies
5/9PCI, MSI: Introduce helpers to hide struct msi_desc implementation detailsinclude/linux/msi.h+19 -00 replies
6/9genirq: Introduce msi_domain_{alloc|free}_irqs()include/linux/msi.h kernel/irq/msi.c+102 -02 replies
7/9genirq: Provide default callbacks for msi_domain_opsinclude/linux/msi.h kernel/irq/msi.c+132 -130 replies
8/9PCI, MSI: Refine irqdomain interfaces to simplify its usagedrivers/pci/msi.c include/linux/msi.h+100 -340 replies
9/9PCI, MSI: Provide mechanism to alloc/free MSI/MSIX interrupt from irqdomaindrivers/pci/msi.c include/linux/msi.h+59 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [Patch V3 0/9] Refine generic/PCI MSI irqodmian interfaces

This patch set is based on tip/irq/irqdomain and tries to refine interfaces to support irqdomain for generic MSI and PCI MSI.

Patch 1 is just minor fixes for tip/irq/irqdomain.

Patch 2-4 introduce mechanisms to help reduce irqdomain users' code size. When converting XEN to use hierarchy irqdomain, I found the code size increases about 100 lines. So we still need helpers to reduce code size.

Patch 5 introduces some helpers to hide struct msi_desc implementation details, so later we could move msi_list from struct pci_dev into struct device to enable generic MSI support.

Patch 6 introduces msi_domain_{alloc|free}_irqs() which generalize pci_msi_domain_alloc_irqs() to support generic MSI.

Patch 7 introduces default data structures and callback implementations to support msi_domain_alloc_irqs(), so reduce burden on generic MSI users.

Patch 8 converts PCI MSI to use generic MSI interfaces, and also implement default callbacks for PCI MSI.

Patch 9 introduces a mechanism to replace arch_setup_msi_irq()/ arch_setup_msi_irqs()/arch_teardown_msi_irq()/arch_teardown_msi_irqs().

With this patch set applied, the generic MSI and PCI MSI interfaces are much easier to use. For extreme case, you only need to define a "struct msi_domain_info" and don't need to implement any callbacks, just using the default callbacks is OK:)

This patch set is also a preparation for:
1) Kill all weak functions in drivers/pci/msi.c
2) Implement support for non-PCI-compliant MSI device

It has been tested on x86 platforms, comments are welcomed!

V2->V3:
1) Refine msi_domain_ops.set_desc() and msi_domain_ops.handle_error() interfaces.
V1->V2:
1) Fix bugs reported by Marc
2) Rename MSI_FLAG_USE_DEF_OPS as MSI_FLAG_USE_DEF_DOM_OPS
3) Add support of MSI_FLAG_USE_DEF_CHIP_OPS
4) Include linxu/irqhandler.h to use irq_flow_handler_t instead of "void *"
5) Change iterfaces to pass in "nvect" to msi_domain_ops.msi_prepare()
6) Add new interfaces/flags to help reduce irqdomain users' code size Jiang Liu (8):
PCI, MSI: Fix errors caused by commit e5f1a59c4e12
irqdomain: Implement a method to automatically call parent domain's
alloc/free
irqdomain: Introduce helper function irq_domain_add_hierarchy() PCI, MSI: Introduce helpers to hide struct msi_desc implementation
details
genirq: Introduce msi_domain_{alloc|free}_irqs()
genirq: Provide default callbacks for msi_domain_ops
PCI, MSI: Refine irqdomain interfaces to simplify its usage PCI, MSI: Provide mechanism to alloc/free MSI/MSIX interrupt from
irqdomain

Yingjoe Chen (1):
irqdomain: Use consistent prototype for irq_domain_free_irqs_*

 drivers/pci/msi.c         |  183 ++++++++++++++++++++++++++++++++++++---------
 include/linux/irqdomain.h |   33 ++++----
 include/linux/msi.h       |   99 +++++++++++++++++++++---
 kernel/irq/irqdomain.c    |   93 +++++++++++++++++++++--
 kernel/irq/msi.c          |  175 +++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 510 insertions(+), 73 deletions(-)
Signature · 1 line
1.7.10.4