From: jsg Date: Thu, 14 Dec 2023 05:19:03 +0000 (+0000) Subject: drm/amdgpu: correct the amdgpu runtime dereference usage count X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=75aeac0ba143028fc78488fe837b2ee797550622;p=openbsd drm/amdgpu: correct the amdgpu runtime dereference usage count From Prike Liang 458affed061935948d31f5d731bbcfbff3158762 in linux-6.1.y/6.1.68 c6df7f313794c3ad41a49b9a7c95da369db607f3 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c index 7e98b12cfda..231cb391c77 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c @@ -304,14 +304,11 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set, adev->have_disp_power_ref = true; return ret; } - /* if we have no active crtcs, then drop the power ref - * we got before + /* if we have no active crtcs, then go to + * 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; - } - out: /* drop the power reference we got coming in here */ pm_runtime_put_autosuspend(dev->dev);