iommu/vt-d: Allocate pasid table in device probe path
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 22 Nov 2022 00:29:43 +0000 (08:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:51:19 +0000 (08:51 +0100)
commit3787b3168b6c5f74e5e411f72e19322186fa2e4b
treea9fc44a390324de354f00fb7f47d8044fe73b420
parent681aeeda413d6a379710d750916c582d67dd6635
iommu/vt-d: Allocate pasid table in device probe path

[ Upstream commit ec62b4424174f41bdcedd08d12d7bed80088453d ]

Whether or not a domain is attached to the device, the pasid table should
always be valid as long as it has been probed. This moves the pasid table
allocation from the domain attaching device path to device probe path and
frees it in the device release path.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20221118132451.114406-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Stable-dep-of: da37dddcf4ca ("iommu/vt-d: Disable PCI ATS in legacy passthrough mode")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel/iommu.c