ntb.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [patch V2 00/31] genirq/msi, PCI/MSI: Spring cleaning - Part 3
@ 2021-12-06 22:51 Thomas Gleixner
  2021-12-06 22:51 ` [patch V2 01/31] genirq/msi: Move descriptor list to struct msi_device_data Thomas Gleixner
                   ` (31 more replies)
  0 siblings, 32 replies; 50+ messages in thread
From: Thomas Gleixner @ 2021-12-06 22:51 UTC (permalink / raw)
  To: LKML
  Cc: Bjorn Helgaas, Marc Zygnier, Alex Williamson, Kevin Tian,
	Jason Gunthorpe, Megha Dey, Ashok Raj, linux-pci,
	Cedric Le Goater, xen-devel, Juergen Gross, Greg Kroah-Hartman,
	Niklas Schnelle, linux-s390, Heiko Carstens,
	Christian Borntraeger, Logan Gunthorpe, Jon Mason, Dave Jiang,
	Allen Hubbe, linux-ntb

This is the third part of [PCI]MSI refactoring which aims to provide the
ability of expanding MSI-X vectors after enabling MSI-X.

The first two parts of this work can be found here:

    https://lore.kernel.org/r/20211206210147.872865823@linutronix.de
    https://lore.kernel.org/r/20211206210307.625116253@linutronix.de

This third part has the following important changes:

   1) Add locking to protect the MSI descriptor storage

      Right now the MSI descriptor storage (linked list) is not protected
      by anything under the assumption that the list is installed before
      use and destroyed after use. As this is about to change there has to
      be protection

   2) A new set of iterators which allow filtering on the state of the
      descriptors namely whether a descriptor is associated to a Linux
      interrupt or not.

      This cleans up a lot of use cases which have to do this filtering
      manually.

   3) A new set of MSI descriptor allocation functions which make the usage
      sites simpler and confine the storage handling to the core code.

      Trivial MSI descriptors (non PCI) are now allocated by the core code
      automatically when the underlying irq domain requests that.

   4) Rework of sysfs handling to prepare for dynamic extension of MSI-X

      The current mechanism which creates the directory and the attributes
      for all MSI descriptors in one go is obviously not suitable for
      dynamic extension. The rework splits the directory creation out and
      lets the MSI interrupt allocation create the per descriptor
      attributes.

   5) Conversion of the MSI descriptor storage to xarray

      The linked list based storage is suboptimal even without dynamic
      expansion as it requires full list walks to get to a specific
      descriptor. With dynamic expansion this gets even more
      convoluted. Xarray is way more suitable and simplifies the
      final goal of dynamic expansion of the MSI-X space.

This third series is based on:

     git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v2-part-2

and also available from git:

     git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v2-part-3

V1 of this series can be found here:

    https://lore.kernel.org/r/20211126224100.303046749@linutronix.de

Changes versus V1:

  - Remove the allocation counter patch as it is not required

  - Fix the powerpc fallout - Cedric

  - Fix the CONFIG typo - Niklas

  - Picked up Reviewed/Tested/Acked-by tags as appropriate

As a consequence of the discussion vs. the general direction of these
patches, part 4 is not going to be updated in it's current form.

The assumption that MSI[X] and IMS are mutually exclusive and that IMS is
basically an extension for finer grained splitup of the PCI device does not
hold.

There is a plan to refactor the code further in order to provide the
desired functionality of MSI[X]/IMS which will also gain the dynamic
extension of MSI-X vectors:

      https://lore.kernel.org/r/87o85v3znb.ffs@tglx

Thanks,

	tglx
---
 .clang-format                          |    1 
 arch/powerpc/platforms/4xx/hsta_msi.c  |    7 
 arch/powerpc/platforms/cell/axon_msi.c |    7 
 arch/powerpc/platforms/pasemi/msi.c    |    9 
 arch/powerpc/sysdev/fsl_msi.c          |    8 
 arch/powerpc/sysdev/mpic_u3msi.c       |    9 
 arch/s390/pci/pci_irq.c                |    6 
 arch/x86/pci/xen.c                     |   14 
 drivers/base/core.c                    |    3 
 drivers/base/platform-msi.c            |  110 -----
 drivers/bus/fsl-mc/fsl-mc-msi.c        |   61 --
 drivers/ntb/msi.c                      |   19 
 drivers/pci/controller/pci-hyperv.c    |   15 
 drivers/pci/msi/irqdomain.c            |   11 
 drivers/pci/msi/legacy.c               |   20 
 drivers/pci/msi/msi.c                  |  258 ++++++------
 drivers/pci/xen-pcifront.c             |    2 
 drivers/soc/ti/ti_sci_inta_msi.c       |   77 +--
 include/linux/device.h                 |    4 
 include/linux/msi.h                    |  107 +++--
 include/linux/soc/ti/ti_sci_inta_msi.h |    1 
 kernel/irq/msi.c                       |  700 ++++++++++++++++++++++-----------
 22 files changed, 794 insertions(+), 655 deletions(-)

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2022-01-19  8:45 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 22:51 [patch V2 00/31] genirq/msi, PCI/MSI: Spring cleaning - Part 3 Thomas Gleixner
2021-12-06 22:51 ` [patch V2 01/31] genirq/msi: Move descriptor list to struct msi_device_data Thomas Gleixner
2021-12-06 22:51 ` [patch V2 02/31] genirq/msi: Add mutex for MSI list protection Thomas Gleixner
2021-12-09  0:47   ` Jason Gunthorpe
2021-12-09 20:07     ` Thomas Gleixner
2021-12-06 22:51 ` [patch V2 03/31] genirq/msi: Provide msi_domain_alloc/free_irqs_descs_locked() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 04/31] genirq/msi: Provide a set of advanced MSI accessors and iterators Thomas Gleixner
2021-12-06 22:51 ` [patch V2 05/31] genirq/msi: Provide msi_alloc_msi_desc() and a simple allocator Thomas Gleixner
2021-12-06 22:51 ` [patch V2 06/31] genirq/msi: Provide domain flags to allocate/free MSI descriptors automatically Thomas Gleixner
2021-12-06 22:51 ` [patch V2 07/31] PCI/MSI: Protect MSI operations Thomas Gleixner
2021-12-07 21:06   ` Bjorn Helgaas
2021-12-06 22:51 ` [patch V2 08/31] PCI/MSI: Use msi_add_msi_desc() Thomas Gleixner
2021-12-07 21:07   ` Bjorn Helgaas
2021-12-06 22:51 ` [patch V2 09/31] PCI/MSI: Let core code free MSI descriptors Thomas Gleixner
2021-12-07 21:07   ` Bjorn Helgaas
2021-12-06 22:51 ` [patch V2 10/31] PCI/MSI: Use msi_on_each_desc() Thomas Gleixner
2021-12-07 21:07   ` Bjorn Helgaas
2021-12-06 22:51 ` [patch V2 11/31] x86/pci/xen: Use msi_for_each_desc() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 12/31] xen/pcifront: Rework MSI handling Thomas Gleixner
2021-12-06 22:51 ` [patch V2 13/31] s390/pci: Rework MSI descriptor walk Thomas Gleixner
2021-12-06 22:51 ` [patch V2 14/31] powerpc/4xx/hsta: Rework MSI handling Thomas Gleixner
2021-12-06 22:51 ` [patch V2 15/31] powerpc/cell/axon_msi: Convert to msi_on_each_desc() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 16/31] powerpc/pasemi/msi: Convert to msi_on_each_dec() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 17/31] powerpc/fsl_msi: Use msi_for_each_desc() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 18/31] powerpc/mpic_u3msi: Use msi_for_each-desc() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 19/31] PCI: hv: Rework MSI handling Thomas Gleixner
2021-12-07 21:08   ` Bjorn Helgaas
2021-12-06 22:51 ` [patch V2 20/31] NTB/msi: Convert to msi_on_each_desc() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 21/31] soc: ti: ti_sci_inta_msi: Rework MSI descriptor allocation Thomas Gleixner
2021-12-15 20:50   ` Thomas Gleixner
2021-12-06 22:51 ` [patch V2 22/31] soc: ti: ti_sci_inta_msi: Remove ti_sci_inta_msi_domain_free_irqs() Thomas Gleixner
2021-12-06 22:51 ` [patch V2 23/31] bus: fsl-mc-msi: Simplify MSI descriptor handling Thomas Gleixner
2021-12-06 22:51 ` [patch V2 24/31] platform-msi: Let core code handle MSI descriptors Thomas Gleixner
2021-12-06 22:51 ` [patch V2 25/31] platform-msi: Simplify platform device MSI code Thomas Gleixner
2021-12-06 22:51 ` [patch V2 26/31] genirq/msi: Make interrupt allocation less convoluted Thomas Gleixner
2021-12-06 22:51 ` [patch V2 27/31] genirq/msi: Convert to new functions Thomas Gleixner
2021-12-06 22:51 ` [patch V2 28/31] genirq/msi: Mop up old interfaces Thomas Gleixner
2021-12-06 22:51 ` [patch V2 29/31] genirq/msi: Add abuse prevention comment to msi header Thomas Gleixner
2021-12-07  8:21   ` Greg Kroah-Hartman
2021-12-07 12:46     ` Thomas Gleixner
2021-12-06 22:51 ` [patch V2 30/31] genirq/msi: Simplify sysfs handling Thomas Gleixner
2022-01-10 18:12   ` [patch] genirq/msi: Populate sysfs entry only once Thomas Gleixner
2022-01-10 18:15     ` Borislav Petkov
2022-01-11  8:57     ` Greg Kroah-Hartman
2022-01-11  9:02     ` Cédric Le Goater
2022-01-12  0:05     ` Kunihiko Hayashi
2022-01-18 23:59       ` Thomas Gleixner
2022-01-19  8:45         ` Kunihiko Hayashi
2021-12-06 22:51 ` [patch V2 31/31] genirq/msi: Convert storage to xarray Thomas Gleixner
2021-12-09  1:01 ` [patch V2 00/31] genirq/msi, PCI/MSI: Spring cleaning - Part 3 Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).