From fe2ee22fedcbb163751d8ec3f292c4e0ff66c063 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 14 Dec 2021 13:22:32 +0000 Subject: [PATCH] drm/amdkfd: separate kfd_iommu_resume from kfd_resume From James Zhu 5d191b0976b72af5f79cf217b9b7c2f20b522a2a in linux 5.10.y/5.10.85 fefc01f042f44ede373ee66773b8238dd8fdcb55 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd.h | 6 ++++++ sys/dev/pci/drm/amd/amdkfd/kfd_device.c | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd.h b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd.h index 5adcc45cd05..9f52e7b77ed 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd.h +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_amdkfd.h @@ -305,6 +305,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, const struct kgd2kfd_shared_resources *gpu_resources); void kgd2kfd_device_exit(struct kfd_dev *kfd); void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm); +int kgd2kfd_resume_iommu(struct kfd_dev *kfd); int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm); int kgd2kfd_pre_reset(struct kfd_dev *kfd); int kgd2kfd_post_reset(struct kfd_dev *kfd); @@ -343,6 +344,11 @@ static inline void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm) { } +static int __maybe_unused kgd2kfd_resume_iommu(struct kfd_dev *kfd) +{ + return 0; +} + static inline int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm) { return 0; diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_device.c b/sys/dev/pci/drm/amd/amdkfd/kfd_device.c index 5751bddc9ca..1204dae8579 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_device.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_device.c @@ -896,17 +896,21 @@ int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm) return ret; } -static int kfd_resume(struct kfd_dev *kfd) +int kgd2kfd_resume_iommu(struct kfd_dev *kfd) { int err = 0; err = kfd_iommu_resume(kfd); - if (err) { + if (err) dev_err(kfd_device, "Failed to resume IOMMU for device %x:%x\n", kfd->pdev->vendor, kfd->pdev->device); - return err; - } + return err; +} + +static int kfd_resume(struct kfd_dev *kfd) +{ + int err = 0; err = kfd->dqm->ops.start(kfd->dqm); if (err) { -- 2.20.1