mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
drm/amdkfd: Fix ATS capablity was not reported correctly on some APUs
Because CRAT_CU_FLAGS_IOMMU_PRESENT was not set in some BIOS crat, we need to workaround this. For future compatibility, we also overwrite the bit in capability according to the value of needs_iommu_device. Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Yong Zhao <Yong.Zhao@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -62,9 +62,20 @@ int kfd_iommu_device_init(struct kfd_dev *kfd)
|
||||
struct amd_iommu_device_info iommu_info;
|
||||
unsigned int pasid_limit;
|
||||
int err;
|
||||
struct kfd_topology_device *top_dev;
|
||||
|
||||
if (!kfd->device_info->needs_iommu_device)
|
||||
top_dev = kfd_topology_device_by_id(kfd->id);
|
||||
|
||||
/*
|
||||
* Overwrite ATS capability according to needs_iommu_device to fix
|
||||
* potential missing corresponding bit in CRAT of BIOS.
|
||||
*/
|
||||
if (!kfd->device_info->needs_iommu_device) {
|
||||
top_dev->node_props.capability &= ~HSA_CAP_ATS_PRESENT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
top_dev->node_props.capability |= HSA_CAP_ATS_PRESENT;
|
||||
|
||||
iommu_info.flags = 0;
|
||||
err = amd_iommu_device_info(kfd->pdev, &iommu_info);
|
||||
|
||||
Reference in New Issue
Block a user