From: Jason Gunthorpe Date: Thu, 7 Dec 2023 18:03:11 +0000 (-0400) Subject: iommu: Mark dev_iommu_get() with lockdep X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=64945d1b0ed169aeffa59020941e4ac45ebc315a;p=users%2Fjedix%2Flinux-maple.git iommu: Mark dev_iommu_get() with lockdep Allocation of dev->iommu must be done under the iommu_probe_device_lock. Mark this with lockdep to discourage future mistakes. Reviewed-by: Jerry Snitselaar Tested-by: Hector Martin Reviewed-by: Lu Baolu Reviewed-by: Moritz Fischer Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v2-16e4def25ebb+820-iommu_fwspec_p1_jgg@nvidia.com Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index d0a28667479a..df58025c001b 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -334,6 +334,8 @@ static struct dev_iommu *dev_iommu_get(struct device *dev) { struct dev_iommu *param = dev->iommu; + lockdep_assert_held(&iommu_probe_device_lock); + if (param) return param;