drm/amdgpu: fix pplib finish bug
1,should use late_fini to kfree all resource otherwise the released pointer maybe accessed in IRQ ip fini routine. 2,hwmgr should not be kfree by pem_fini which is invoked by hw fini path. Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
482587e314
commit
a6dcfd9cc5
|
@ -1325,6 +1325,11 @@ static int amdgpu_fini(struct amdgpu_device *adev)
|
||||||
adev->ip_block_status[i].valid = false;
|
adev->ip_block_status[i].valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
|
||||||
|
if (adev->ip_blocks[i].funcs->late_fini)
|
||||||
|
adev->ip_blocks[i].funcs->late_fini((void *)adev);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,13 +183,6 @@ static int amdgpu_pp_sw_fini(void *handle)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#ifdef CONFIG_DRM_AMD_POWERPLAY
|
|
||||||
if (adev->pp_enabled) {
|
|
||||||
amdgpu_pm_sysfs_fini(adev);
|
|
||||||
amd_powerplay_fini(adev->powerplay.pp_handle);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,9 +58,6 @@ static void pem_fini(struct pp_eventmgr *eventmgr)
|
||||||
pem_unregister_interrupts(eventmgr);
|
pem_unregister_interrupts(eventmgr);
|
||||||
|
|
||||||
pem_handle_event(eventmgr, AMD_PP_EVENT_UNINITIALIZE, &event_data);
|
pem_handle_event(eventmgr, AMD_PP_EVENT_UNINITIALIZE, &event_data);
|
||||||
|
|
||||||
if (eventmgr != NULL)
|
|
||||||
kfree(eventmgr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int eventmgr_init(struct pp_instance *handle)
|
int eventmgr_init(struct pp_instance *handle)
|
||||||
|
|
Loading…
Reference in New Issue