* [bug report] drm/amd/powerplay: add control gfxoff enabling in late init
@ 2018-05-17 14:13 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-05-17 14:13 UTC (permalink / raw)
To: ray.huang-5C7GfCeVMHo; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Hello Huang Rui,
The patch 9667849bbb8d: "drm/amd/powerplay: add control gfxoff
enabling in late init" from Mar 13, 2018, leads to the following
static checker warning:
drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c:194 pp_late_init()
error: we previously assumed 'hwmgr' could be null (see line 185)
drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c
179 static int pp_late_init(void *handle)
180 {
181 struct amdgpu_device *adev = handle;
182 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
183 int ret;
184
185 if (hwmgr && hwmgr->pm_en) {
^^^^^
Check
186 mutex_lock(&hwmgr->smu_lock);
187 hwmgr_handle_task(hwmgr,
188 AMD_PP_TASK_COMPLETE_INIT, NULL);
189 mutex_unlock(&hwmgr->smu_lock);
190 }
191 if (adev->pm.smu_prv_buffer_size != 0)
192 pp_reserve_vram_for_smu(adev);
193
194 if (hwmgr->hwmgr_func->gfx_off_control &&
^^^^^^^^^^^^^^^^^^
Patch adds unchecked dereference.
195 (hwmgr->feature_mask & PP_GFXOFF_MASK)) {
196 ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true);
197 if (ret)
198 pr_err("gfx off enabling failed!\n");
199 }
200
201 return 0;
202 }
regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-05-17 14:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17 14:13 [bug report] drm/amd/powerplay: add control gfxoff enabling in late init Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.