linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] Consolidate the probe_device path
@ 2023-04-19 16:11 Jason Gunthorpe
  2023-04-19 16:11 ` [PATCH 01/11] iommu: Have __iommu_probe_device() check for already probed devices Jason Gunthorpe
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: Jason Gunthorpe @ 2023-04-19 16:11 UTC (permalink / raw)
  To: Lu Baolu, Christophe Leroy, David Woodhouse, iommu, Joerg Roedel,
	Len Brown, linux-acpi, linuxppc-dev, Michael Ellerman,
	Nicholas Piggin, Rafael J. Wysocki, Robin Murphy, Will Deacon
  Cc: Kevin Tian, Nicolin Chen

Now that the domain allocation path is less duplicated we can tackle the
probe_device path. Details of this are spread across several functions,
broadly move most of the code into __iommu_probe_device() and organize it
more strictly in terms of paired do/undo functions.

Make the locking simpler by obtaining the group->mutex fewer times and
avoiding adding a half-initialized device to an initialized
group. Previously we would lock/unlock the group three times on these
paths.

This locking change is the primary point of the series, creating the
paired do/undo functions is a path to being able to organize the setup
code under a single lock and still have a logical, not duplicated, error
unwind.

This follows the prior series:

https://lore.kernel.org/r/0-v4-79d0c229580a+650-iommu_err_unwind_jgg@nvidia.com

Jason Gunthorpe (11):
  iommu: Have __iommu_probe_device() check for already probed devices
  iommu: Use iommu_group_ref_get/put() for dev->iommu_group
  iommu: Inline iommu_group_get_for_dev() into __iommu_probe_device()
  iommu: Simplify the __iommu_group_remove_device() flow
  iommu: Add iommu_init/deinit_driver() paired functions
  iommu: Move the iommu driver sysfs setup into
    iommu_init/deinit_driver()
  iommu: Do not export iommu_device_link/unlink()
  iommu: Always destroy the iommu_group during iommu_release_device()
  iommu/power: Remove iommu_del_device()
  iommu: Split iommu_group_add_device()
  iommu: Avoid locking/unlocking for iommu_probe_device()

 arch/powerpc/include/asm/iommu.h       |   5 -
 arch/powerpc/kernel/iommu.c            |  17 -
 arch/powerpc/platforms/powernv/pci.c   |  25 --
 arch/powerpc/platforms/pseries/iommu.c |  25 --
 drivers/acpi/scan.c                    |   2 +-
 drivers/iommu/intel/iommu.c            |   7 -
 drivers/iommu/iommu-sysfs.c            |   8 -
 drivers/iommu/iommu.c                  | 411 +++++++++++++------------
 drivers/iommu/of_iommu.c               |   2 +-
 9 files changed, 212 insertions(+), 290 deletions(-)


base-commit: 172314c88ed17bd838404d837bfb256d9bfd4e3d
-- 
2.40.0


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

end of thread, other threads:[~2023-04-26 14:37 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-19 16:11 [PATCH 00/11] Consolidate the probe_device path Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 01/11] iommu: Have __iommu_probe_device() check for already probed devices Jason Gunthorpe
2023-04-26  9:12   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 02/11] iommu: Use iommu_group_ref_get/put() for dev->iommu_group Jason Gunthorpe
2023-04-26  9:12   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 03/11] iommu: Inline iommu_group_get_for_dev() into __iommu_probe_device() Jason Gunthorpe
2023-04-26  9:21   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 04/11] iommu: Simplify the __iommu_group_remove_device() flow Jason Gunthorpe
2023-04-26  9:21   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 05/11] iommu: Add iommu_init/deinit_driver() paired functions Jason Gunthorpe
2023-04-26  9:41   ` Tian, Kevin
2023-04-26 14:36     ` Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 06/11] iommu: Move the iommu driver sysfs setup into iommu_init/deinit_driver() Jason Gunthorpe
2023-04-26  9:41   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 07/11] iommu: Do not export iommu_device_link/unlink() Jason Gunthorpe
2023-04-26  9:42   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 08/11] iommu: Always destroy the iommu_group during iommu_release_device() Jason Gunthorpe
2023-04-20  4:23   ` Baolu Lu
2023-04-26 13:47     ` Jason Gunthorpe
2023-04-26  9:42   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 09/11] iommu/power: Remove iommu_del_device() Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 10/11] iommu: Split iommu_group_add_device() Jason Gunthorpe
2023-04-20  4:25   ` Baolu Lu
2023-04-20 13:09     ` Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 11/11] iommu: Avoid locking/unlocking for iommu_probe_device() 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).