Skip to contentSkip to conversation

drm/amdgpu: fix a mistake when removing mem_info_preempt_used sysfs

PATCH In review Jesse.Zhang 2 participants 2 messages Nov 11, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix a mistake when removing mem_info_preempt_used sysfs

From: "[email protected]" <[email protected]>

Skip removing mem_info_preempt_used sysfs when unplugging the device.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
index 33a714ddfbbc..9a0346ed6ea4 100644
@@ -138,7 +138,7 @@ void amdgpu_preempt_mgr_fini(struct amdgpu_device *adev)
 	if (ret)
 		return;
 
-	if (!drm_dev_enter(adev_to_drm(adev), &idx)) {
+	if (drm_dev_enter(adev_to_drm(adev), &idx)) {
 		device_remove_file(adev->dev, &dev_attr_mem_info_preempt_used);
 		drm_dev_exit(idx);
 	}
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

[Public]

This patch is,

Quoted 38 lines

-----Original Message-----
From: Jesse.Zhang <[email protected]>
Sent: Monday, November 11, 2024 5:04 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Prosyak, Vitaly <[email protected]>; Huang, Tim <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH] drm/amdgpu: fix a mistake when removing mem_info_preempt_used sysfs

From: "[email protected]" <[email protected]>

Skip removing mem_info_preempt_used sysfs when unplugging the device.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c +1 -1
index 33a714ddfbbc..9a0346ed6ea4 100644
@@ -138,7 +138,7 @@ void amdgpu_preempt_mgr_fini(struct
 amdgpu_device *adev)
      if (ret)
              return;
 
-     if (!drm_dev_enter(adev_to_drm(adev), &idx)) {
+     if (drm_dev_enter(adev_to_drm(adev), &idx)) {
              device_remove_file(adev->dev,
 &dev_attr_mem_info_preempt_used);
              drm_dev_exit(idx);
      }

--
2.25.1