Skip to content

Commit fefc01f

Browse files
jameszhu-amdalexdeucher
authored andcommitted
drm/amdkfd: separate kfd_iommu_resume from kfd_resume
Separate kfd_iommu_resume from kfd_resume for fine-tuning of amdgpu device init/resume/reset/recovery sequence. v2: squash in fix for !CONFIG_HSA_AMD Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211277 Signed-off-by: James Zhu <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 71ae309 commit fefc01f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
327327
const struct kgd2kfd_shared_resources *gpu_resources);
328328
void kgd2kfd_device_exit(struct kfd_dev *kfd);
329329
void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm);
330+
int kgd2kfd_resume_iommu(struct kfd_dev *kfd);
330331
int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm);
331332
int kgd2kfd_pre_reset(struct kfd_dev *kfd);
332333
int kgd2kfd_post_reset(struct kfd_dev *kfd);
@@ -365,6 +366,11 @@ static inline void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm)
365366
{
366367
}
367368

369+
static int __maybe_unused kgd2kfd_resume_iommu(struct kfd_dev *kfd)
370+
{
371+
return 0;
372+
}
373+
368374
static inline int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
369375
{
370376
return 0;

drivers/gpu/drm/amd/amdkfd/kfd_device.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,17 +1069,21 @@ int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
10691069
return ret;
10701070
}
10711071

1072-
static int kfd_resume(struct kfd_dev *kfd)
1072+
int kgd2kfd_resume_iommu(struct kfd_dev *kfd)
10731073
{
10741074
int err = 0;
10751075

10761076
err = kfd_iommu_resume(kfd);
1077-
if (err) {
1077+
if (err)
10781078
dev_err(kfd_device,
10791079
"Failed to resume IOMMU for device %x:%x\n",
10801080
kfd->pdev->vendor, kfd->pdev->device);
1081-
return err;
1082-
}
1081+
return err;
1082+
}
1083+
1084+
static int kfd_resume(struct kfd_dev *kfd)
1085+
{
1086+
int err = 0;
10831087

10841088
err = kfd->dqm->ops.start(kfd->dqm);
10851089
if (err) {

0 commit comments

Comments
 (0)