drm/amdgpu: correct the amdgpu runtime dereference usage count

[ Upstream commit c6df7f313794c3ad41a49b9a7c95da369db607f3 ]

Fix the amdgpu runpm dereference usage count.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Prike Liang
2023-11-08 14:38:29 +08:00
committed by Greg Kroah-Hartman
parent b5862e5ca5
commit d4fb20dcc1

View File

@@ -299,13 +299,11 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
adev->have_disp_power_ref = true; adev->have_disp_power_ref = true;
return ret; return ret;
} }
/* if we have no active crtcs, then drop the power ref /* if we have no active crtcs, then go to
we got before */ * drop the power ref we got before
if (!active && adev->have_disp_power_ref) { */
pm_runtime_put_autosuspend(dev->dev); if (!active && adev->have_disp_power_ref)
adev->have_disp_power_ref = false; adev->have_disp_power_ref = false;
}
out: out:
/* drop the power reference we got coming in here */ /* drop the power reference we got coming in here */
pm_runtime_put_autosuspend(dev->dev); pm_runtime_put_autosuspend(dev->dev);