Re: [PATCH RFC 17/17] iommu: Mark dev_iommu_priv_set() with a lockdep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023/11/4 0:45, Jason Gunthorpe wrote:
A perfect driver would only call dev_iommu_priv_set() from its probe
callback. We've made it functionally correct to call it from the of_xlate
by adding a lock around that call.

lockdep assert that iommu_probe_device_lock is held to discourage misuse.

Exclude PPC kernels with CONFIG_FSL_PAMU turned on because FSL_PAMU uses a
global static for its priv and abuses priv for its domain.

Remove the pointless stores of NULL, all these are on paths where the core
code will free dev->iommu after the op returns.

Signed-off-by: Jason Gunthorpe<jgg@xxxxxxxxxx>
---
  drivers/iommu/amd/iommu.c                   | 2 --
  drivers/iommu/apple-dart.c                  | 1 -
  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 -
  drivers/iommu/arm/arm-smmu/arm-smmu.c       | 1 -
  drivers/iommu/intel/iommu.c                 | 2 --
  drivers/iommu/iommu.c                       | 9 +++++++++
  drivers/iommu/omap-iommu.c                  | 1 -
  include/linux/iommu.h                       | 5 +----
  8 files changed, 10 insertions(+), 12 deletions(-)

Reviewed-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>

Best regards,
baolu



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux