drm/amdkfd: separate kfd_iommu_resume from kfd_resume
authorjsg <jsg@openbsd.org>
Tue, 14 Dec 2021 13:22:32 +0000 (13:22 +0000)
committerjsg <jsg@openbsd.org>
Tue, 14 Dec 2021 13:22:32 +0000 (13:22 +0000)
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
sys/dev/pci/drm/amd/amdkfd/kfd_device.c

index 5adcc45..9f52e7b 100644 (file)
@@ -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;
index 5751bdd..1204dae 100644 (file)
@@ -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) {