drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset
Subsystems (3)
PATCH 1/1 drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset
On Vega20 and other pre-production GPUs, powerplay is not enabled yet. Check for NULL pointers before calling pp_funcs function pointers.
Also affects Kaveri.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +5 -2
@@ -503,8 +503,11 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle) {struct amdgpu_device *adev = (struct amdgpu_device *)kgd; -amdgpu_dpm_switch_power_profile (adev, -PP_SMC_POWER_PROFILE_COMPUTE , !idle); +if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->switch_power_profile) +amdgpu_dpm_switch_power_profile (adev, +PP_SMC_POWER_PROFILE_COMPUTE , + !idle); }bool amdgpu_amdkfd_is_kfd_vmid (struct amdgpu_device *adev,u32 vmid)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1542318992-12464-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Kuehling, Felix <[email protected]>
Sent: Thursday, November 15, 2018 4:56:51 PM
To: [email protected]
Cc: Kuehling, Felix; Joerg Roedel
Subject: [PATCH] drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset
On Vega20 and other pre-production GPUs, powerplay is not enabled yet. Check for NULL pointers before calling pp_funcs function pointers.
Also affects Kaveri.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +5 -2
@@ -503,8 +503,11 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle) {struct amdgpu_device *adev = (struct amdgpu_device *)kgd; -amdgpu_dpm_switch_power_profile (adev, -PP_SMC_POWER_PROFILE_COMPUTE , !idle); +if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->switch_power_profile) +amdgpu_dpm_switch_power_profile (adev, +PP_SMC_POWER_PROFILE_COMPUTE , + !idle); }bool amdgpu_amdkfd_is_kfd_vmid (struct amdgpu_device *adev,u32 vmid)
--
2.7.4
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB180900E62C3F2EB8C61C1FAFF7DC0-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
I pushed the change to amd-staging-drm-next. I'd also like to get it into drm-fixes. Should I cherry-pick it to your drm-fixes-4.20 branch on fd.o?
Thanks,
Felix
Quoted 37 lines · Alexander
Reviewed-by Alex Deucher <[email protected]>------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Kuehling, Felix <[email protected]>
*Sent:* Thursday, November 15, 2018 4:56:51 PM
*To:* [email protected]
*Cc:* Kuehling, Felix; Joerg Roedel
*Subject:* [PATCH] drm/amdgpu: Fix oops whenpp_funcs->switch_power_profileis unset
On Vega20 and other pre-production GPUs, powerplay is not enabled yet. Check for NULL pointers before callingpp_funcsfunction pointers.Also affects Kaveri.
CC Joerg Roedel <[email protected]>Signed-off-by Felix Kuehling <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +0
-0@@ -503,8 +503,11 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle) { struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
- amdgpu_dpm_switch_power_profile(adev,
-PP_SMC_POWER_PROFILE_COMPUTE, !idle);
+ if (adev->powerplay.pp_funcs&&
Quoted 15 lines
+
adev->powerplay.pp_funcs->switch_power_profile) + amdgpu_dpm_switch_power_profile(adev,
+PP_SMC_POWER_PROFILE_COMPUTE,
+ !idle);
}
boolamdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): f1108e8c-d330-bff3-b04b-4e79aaeabb9a-5C7GfCeVMHo@public.gmane.org
I'll grab it for my -fixes pull this week.
Alex
________________________________
From: Kuehling, Felix
Sent: Monday, November 19, 2018 3:02:27 PM
To: Deucher, Alexander; [email protected]
Cc: Joerg Roedel
Subject: Re: [PATCH] drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset
I pushed the change to amd-staging-drm-next. I'd also like to get it into drm-fixes. Should I cherry-pick it to your drm-fixes-4.20 branch on fd.o?
Thanks,
Felix
Quoted 44 lines · Alexander
Reviewed-by Alex Deucher <[email protected]>------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Kuehling, Felix <[email protected]>
*Sent:* Thursday, November 15, 2018 4:56:51 PM
*To:* [email protected]
*Cc:* Kuehling, Felix; Joerg Roedel
*Subject:* [PATCH] drm/amdgpu: Fix oops whenpp_funcs->switch_power_profileis unsetOn Vega20 and other pre-production GPUs, powerplay is not enabled yet. Check for NULL pointers before calling
pp_funcsfunction pointers.Also affects Kaveri.
CC Joerg Roedel <[email protected]>Signed-off-by Felix Kuehling <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +5
-2@@ -503,8 +503,11 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle) {struct amdgpu_device *adev = (struct amdgpu_device *)kgd; -amdgpu_dpm_switch_power_profile (adev, -PP_SMC_POWER_PROFILE_COMPUTE , !idle); +if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->switch_power_profile) +amdgpu_dpm_switch_power_profile (adev, +PP_SMC_POWER_PROFILE_COMPUTE , + !idle);}
Quoted 8 lines
bool
amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)
--
2.7.4_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Joerg Roedel
Tested-byQuoted 10 lines · Felix
On Vega20 and other pre-production GPUs, powerplay is not enabled yet. Check for NULL pointers before calling
pp_funcsfunction pointers.Also affects Kaveri.
CC Joerg Roedel <[email protected]>Signed-off-by Felix Kuehling <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Tested on my Kaveri box and the issue is fixed, thanks!
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
Acked-byAm 15.11.18 um 22:56 schrieb Kuehling, Felix:
Quoted 7 lines
On Vega20 and other pre-production GPUs, powerplay is not enabled yet. Check for NULL pointers before calling
pp_funcsfunction pointers.Also affects Kaveri.
CC Joerg Roedel <[email protected]>Signed-off-by Felix Kuehling <[email protected]>
Quoted 12 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +0
-0@@ -503,8 +503,11 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle) {struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle) · line 513
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +5
-2-amdgpu_dpm_switch_power_profile (adev, -PP_SMC_POWER_PROFILE_COMPUTE , !idle); +if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->switch_power_profile) +amdgpu_dpm_switch_power_profile (adev, +PP_SMC_POWER_PROFILE_COMPUTE , + !idle); }bool amdgpu_amdkfd_is_kfd_vmid (struct amdgpu_device *adev,u32 vmid)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx