drm/amdgpu: allow more APUs to do mode2 reset when go to S4
authorTim Huang <tim.huang@amd.com>
Thu, 30 Mar 2023 02:33:02 +0000 (10:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2023 15:23:58 +0000 (11:23 -0400)
Skip mode2 reset only for IMU enabled APUs when do S4.

This patch is to fix the regression issue
https://gitlab.freedesktop.org/drm/amd/-/issues/2483
It is generated by commit b589626674de ("drm/amdgpu: skip ASIC reset
for APUs when go to S4").

Fixes: b589626674de ("drm/amdgpu: skip ASIC reset for APUs when go to S4")
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2483
Tested-by: Yuan Perry <Perry.Yuan@amd.com>
Signed-off-by: Tim Huang <tim.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.1.x
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

index 60b1857f469ebb4effb70e06d194ebfea16305e9..aeeec211861c434bae58aae748586e4a608360d5 100644 (file)
@@ -981,7 +981,12 @@ static bool amdgpu_atcs_pci_probe_handle(struct pci_dev *pdev)
  */
 bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev)
 {
-       if (adev->flags & AMD_IS_APU)
+       if ((adev->flags & AMD_IS_APU) &&
+           adev->gfx.imu.funcs) /* Not need to do mode2 reset for IMU enabled APUs */
+               return false;
+
+       if ((adev->flags & AMD_IS_APU) &&
+           amdgpu_acpi_is_s3_active(adev))
                return false;
 
        if (amdgpu_sriov_vf(adev))