Skip to content

Commit 189116d

Browse files
hegdevasantjoergroedel
authored andcommitted
Revert "iommu: Fix false ownership failure on AMD systems with PASID activated"
This reverts commit 2380f1e. Previous patch removed AMD iommu_v2 module. Hence its safe to revert this workaround. Suggested-by: Jason Gunthorpe <[email protected]> Cc: Robin Murphy <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Joerg Roedel <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Jerry Snitselaar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 45d08d8 commit 189116d

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

drivers/iommu/iommu.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3113,24 +3113,6 @@ static ssize_t iommu_group_store_type(struct iommu_group *group,
31133113
return ret ?: count;
31143114
}
31153115

3116-
static bool iommu_is_default_domain(struct iommu_group *group)
3117-
{
3118-
if (group->domain == group->default_domain)
3119-
return true;
3120-
3121-
/*
3122-
* If the default domain was set to identity and it is still an identity
3123-
* domain then we consider this a pass. This happens because of
3124-
* amd_iommu_init_device() replacing the default idenytity domain with an
3125-
* identity domain that has a different configuration for AMDGPU.
3126-
*/
3127-
if (group->default_domain &&
3128-
group->default_domain->type == IOMMU_DOMAIN_IDENTITY &&
3129-
group->domain && group->domain->type == IOMMU_DOMAIN_IDENTITY)
3130-
return true;
3131-
return false;
3132-
}
3133-
31343116
/**
31353117
* iommu_device_use_default_domain() - Device driver wants to handle device
31363118
* DMA through the kernel DMA API.
@@ -3149,7 +3131,7 @@ int iommu_device_use_default_domain(struct device *dev)
31493131

31503132
mutex_lock(&group->mutex);
31513133
if (group->owner_cnt) {
3152-
if (group->owner || !iommu_is_default_domain(group) ||
3134+
if (group->domain != group->default_domain || group->owner ||
31533135
!xa_empty(&group->pasid_array)) {
31543136
ret = -EBUSY;
31553137
goto unlock_out;

0 commit comments

Comments
 (0)