]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amdgpu: Prevent hardware access in dpc state
authorLijo Lazar <lijo.lazar@amd.com>
Thu, 24 Jul 2025 07:35:12 +0000 (13:05 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Aug 2025 18:22:03 +0000 (14:22 -0400)
Don't allow hardware access while in dpc state.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Ce Sun <cesun102@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h

index fe087328f6fd5bf5775a196964deded00818f3c7..962184d1e96e3320a57968dfa561df34da89c037 100644 (file)
@@ -6256,11 +6256,7 @@ static int amdgpu_device_asic_reset(struct amdgpu_device *adev,
 
 retry: /* Rest of adevs pre asic reset from XGMI hive. */
        list_for_each_entry(tmp_adev, device_list, reset_list) {
-               if (amdgpu_reset_in_dpc(adev))
-                       tmp_adev->no_hw_access = true;
                r = amdgpu_device_pre_asic_reset(tmp_adev, reset_context);
-               if (amdgpu_reset_in_dpc(adev))
-                       tmp_adev->no_hw_access = false;
                /*TODO Should we stop ?*/
                if (r) {
                        dev_err(tmp_adev->dev, "GPU pre asic reset failed with err, %d for drm dev, %s ",
index 3a806953338fdbe3a8c30d730f75313643f308c0..2f92b3be40f5682f1a24c8a0b3f80723f8043e0b 100644 (file)
@@ -164,6 +164,7 @@ static inline void amdgpu_reset_set_dpc_status(struct amdgpu_device *adev,
                                               bool status)
 {
        adev->pcie_reset_ctx.occurs_dpc = status;
+       adev->no_hw_access = status;
 }
 
 static inline bool amdgpu_reset_in_dpc(struct amdgpu_device *adev)