drm/amd/pm: Add missing mutex for pp_get_power_profile_mode
Prevent possible issues from set and get being called simultaneously. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
9a40d0448f
commit
067558177b
|
@ -875,6 +875,7 @@ pp_dpm_get_vce_clock_state(void *handle, unsigned idx)
|
||||||
static int pp_get_power_profile_mode(void *handle, char *buf)
|
static int pp_get_power_profile_mode(void *handle, char *buf)
|
||||||
{
|
{
|
||||||
struct pp_hwmgr *hwmgr = handle;
|
struct pp_hwmgr *hwmgr = handle;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!hwmgr || !hwmgr->pm_en || !buf)
|
if (!hwmgr || !hwmgr->pm_en || !buf)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -884,7 +885,10 @@ static int pp_get_power_profile_mode(void *handle, char *buf)
|
||||||
return snprintf(buf, PAGE_SIZE, "\n");
|
return snprintf(buf, PAGE_SIZE, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return hwmgr->hwmgr_func->get_power_profile_mode(hwmgr, buf);
|
mutex_lock(&hwmgr->smu_lock);
|
||||||
|
ret = hwmgr->hwmgr_func->get_power_profile_mode(hwmgr, buf);
|
||||||
|
mutex_unlock(&hwmgr->smu_lock);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pp_set_power_profile_mode(void *handle, long *input, uint32_t size)
|
static int pp_set_power_profile_mode(void *handle, long *input, uint32_t size)
|
||||||
|
|
Loading…
Reference in New Issue