]> www.infradead.org Git - users/hch/misc.git/commit
iommu: Keep dev->iommu state consistent
authorRobin Murphy <robin.murphy@arm.com>
Fri, 28 Feb 2025 15:46:32 +0000 (15:46 +0000)
committerJoerg Roedel <jroedel@suse.de>
Tue, 11 Mar 2025 13:05:42 +0000 (14:05 +0100)
commit3832862eb9c4dfa0e80b2522bfaedbc8a43de97d
tree1b5c5e0577c58fd387c44b4d1a514cb614637a26
parentfd598f71b66975c042f40ae7cd4310d6e699e149
iommu: Keep dev->iommu state consistent

At the moment, if of_iommu_configure() allocates dev->iommu itself via
iommu_fwspec_init(), then suffers a DT parsing failure, it cleans up the
fwspec but leaves the empty dev_iommu hanging around. So far this is
benign (if a tiny bit wasteful), but we'd like to be able to reason
about dev->iommu having a consistent and unambiguous lifecycle. Thus
make sure that the of_iommu cleanup undoes precisely whatever it did.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/d219663a3f23001f23d520a883ac622d70b4e642.1740753261.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu-priv.h
drivers/iommu/iommu.c
drivers/iommu/of_iommu.c