Revert "drm/amdkfd: fix boot failure when iommu is disabled in Picasso."
Subsystems (3)
PATCH 1/2 Revert "drm/amdkfd: fix boot failure when iommu is disabled in Picasso."
To revert wrong merge during rebase.
This reverts commit afd18180c07026f94a80ff024acef5f4159084a4.
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +0 -3
@@ -1031,9 +1031,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,svm_migrate_init (kfd->adev); -if (kgd2kfd_resume_iommu (kfd)) - goto device_iommu_error; -if (kfd_resume (kfd)) goto kfd_resume_error;
Signature · 1 line
2.25.1
PATCH 2/2 drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
From: Yifan Zhang <[email protected]>
When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -2398,10 +2398,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)if (!adev->gmc.xgmi.pending_reset)amdgpu_amdkfd_device_init (adev); - r =amdgpu_amdkfd_resume_iommu (adev); -if (r) - goto init_failed; -amdgpu_fru_get_product_info (adev); init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3 -0
@@ -1031,6 +1031,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,svm_migrate_init (kfd->adev); +if (kgd2kfd_resume_iommu (kfd)) + goto device_iommu_error; +if (kfd_resume (kfd)) goto kfd_resume_error;
Signature · 1 line
2.25.1
Re: [PATCH 2/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
Quoted 34 lines · James Zhu
From: Yifan Zhang <[email protected]>
When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.
Reported-by youling <[email protected]>Tested-by youling <[email protected]>Signed-off-by Yifan Zhang <[email protected]>Reviewed-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-4@@ -2398,10 +2398,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)if (!adev->gmc.xgmi.pending_reset)amdgpu_amdkfd_device_init (adev); - r =amdgpu_amdkfd_resume_iommu (adev); -if (r) - goto init_failed; -amdgpu_fru_get_product_info (adev); init_failed:drivers/gpu/drm/amd/amdkfd/kfd_device.c +0
-0
drivers/gpu/drm/amd/amdkfd/kfd_device.c bool kgd2kfd_device_init(struct kfd_dev *kfd, · line 1036
Quoted 6 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3
-0@@ -1031,6 +1031,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,svm_migrate_init (kfd->adev); +if (kgd2kfd_resume_iommu (kfd)) + goto device_iommu_error; +
This also brings a duplicate iommu resume in the reset path -
https://elixir.bootlin.com/linux/v5.15/source/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c#L4612
Thanks,
Lijo
Quoted 4 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +0
-0if (kfd_resume (kfd)) goto kfd_resume_error;
Re: [PATCH 2/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
Quoted 35 lines · Lijo
Quoted 32 lines · James Zhu
From: Yifan Zhang <[email protected]>
When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.
Reported-by youling <[email protected]>Tested-by youling <[email protected]>Signed-off-by Yifan Zhang <[email protected]>Reviewed-by James Zhu <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 4 ---- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 +++2 files changed, 3 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-3@@ -2398,10 +2398,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) if (!adev->gmc.xgmi.pending_reset) amdgpu_amdkfd_device_init(adev); - r = amdgpu_amdkfd_resume_iommu(adev); - if (r) - goto init_failed; - amdgpu_fru_get_product_info(adev);
init_failed:drivers/gpu/drm/amd/amdkfd/kfd_device.c +0
-0
Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c bool kgd2kfd_device_init(struct kfd_dev *kfd, · line 1034
Quoted 5 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +2
-0@@ -1031,6 +1031,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, svm_migrate_init(kfd->adev); + if(kgd2kfd_resume_iommu(kfd)) + goto device_iommu_error; +This also brings a duplicate iommu resume in the reset path -
https://elixir.bootlin.com/linux/v5.15/source/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c#L4612
[JZ] Hi Lijo, please help clarify this duplicate case.
Thanks!
James
Quoted 6 lines
Thanks,
LijoQuoted 3 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +0
-0if (kfd_resume(kfd)) goto kfd_resume_error;
Re: [PATCH 2/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
[Public]
It's a conditional case for some kind of early reset. Haven't checked details, on a quick glance it appeared to call iommu init again.
https://elixir.bootlin.com/linux/v5.15/source/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c#L5160
Thanks,
Lijo
Quoted 3 lines · James Zhu
To revert wrong merge during rebase.
This reverts commitafd18180c07026f94a80ff024acef5f4159084a4.
Missing your signed-off-by. Might be better to just merge these two patches into one unless they are individually applicable to different kernels (e.g., 5.15 vs drm-next). Also these will probably fix the following:
Alex
Quoted 21 lines
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device.c +0
-4@@ -1031,9 +1031,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,svm_migrate_init (kfd->adev); -if (kgd2kfd_resume_iommu (kfd)) - goto device_iommu_error; -if (kfd_resume (kfd)) goto kfd_resume_error; --2.25.1
[AMD Official Use Only]
Hi Alex
Sure, Let me check it can be merged into one patch.
Thanks & Best Regards!
James Zhu
________________________________
From: Alex Deucher <[email protected]>
Sent: Tuesday, November 2, 2021 4:34 PM
To: Zhu, James <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Zhu, James <[email protected]>; Ken Moffat <[email protected]>
Subject: Re: [PATCH 1/2] Revert "drm/amdkfd: fix boot failure when iommu is disabled in Picasso."
Quoted 3 lines · James Zhu
To revert wrong merge during rebase.
This reverts commitafd18180c07026f94a80ff024acef5f4159084a4.
Missing your signed-off-by. Might be better to just merge these two patches into one unless they are individually applicable to different kernels (e.g., 5.15 vs drm-next). Also these will probably fix the following:
Alex
Quoted 21 lines
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device.c +0
-4@@ -1031,9 +1031,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,svm_migrate_init (kfd->adev); -if (kgd2kfd_resume_iommu (kfd)) - goto device_iommu_error; -if (kfd_resume (kfd)) goto kfd_resume_error; --2.25.1
Quoted 5 lines · James
[AMD Official Use Only]
Hi Alex
Quoted 8 lines
Sure, Let me check it can be merged into one patch.
Thanks & Best Regards!
James Zhu
Hi James,
I'm trying to apply these to 5.15.0 (using the dry-run option of traditional patch, kernel source is from the tarball).
the first one fails:
Reversed (or previously applied) patch detected! Assume -R? [n]
it will revert:
Hunk #1 succeeded at 924 with fuzz 2 (offset -107 lines).
In anything connected to the kernel, fuzz on a patch worries me. Should I apply this with patch -p1 -R ?
For the second patch:
checking file drivers/gpu/drm/amd/amdgpu/amdgpu_device.c Hunk #1 succeeded at 2432 (offset 34 lines). checking file drivers/gpu/drm/amd/amdkfd/kfd_device.c Hunk #1 succeeded at 924 with fuzz 2 (offset -107 lines).
Again, note the fuzz in kfd_device.c.
Using 'git apply --check' instead of 'patch' both patches report the same failure for kfd_device.c:
error: patch failed: drivers/gpu/drm/amd/amdkfd/kfd_device.c:1031
error: drivers/gpu/drm/amd/amdkfd/kfd_device.c: patch does not apply
ĸen
Signature · 3 lines
Vetinari smiled. "Can you keep a secret, Mister Lipwig?" "Oh, yes, sir. I've kept lots." "Capital. And the point is, so can I. You do not need to know.”