Skip to contentSkip to conversation

drm/amd/powerplay: fix locking in smu_feature_set_supported()

PATCH In review Dan Carpenter 2 participants 2 messages May 15, 2019

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

PATCH 1/1 drm/amd/powerplay: fix locking in smu_feature_set_supported()

There is a typo so the code unlocks twice instead of taking the lock and then releasing it.

Fixes f14a323db5b0 ("drm/amd/powerplay: implement update enabled feature state to smc for smu11")
---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +1 -1
index 52d919a8b70a..85ac29af5363 100644
@@ -310,7 +310,7 @@ int smu_feature_set_supported(struct smu_context *smu, int feature_id,
 
 	WARN_ON(feature_id > feature->feature_num);
 
-	mutex_unlock(&feature->mutex);
+	mutex_lock(&feature->mutex);
 	if (enable)
 		test_and_set_bit(feature_id, feature->supported);
 	else
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines

-----Original Message-----
From: Dan Carpenter <[email protected]>
Sent: Wednesday, May 15, 2019 5:52 PM
To: Deucher, Alexander <[email protected]>; Wang, Kevin(Yang) <[email protected]>
Cc: Koenig, Christian <[email protected]>; Zhou, David(ChunMing) <[email protected]>; David Airlie <[email protected]>; Daniel Vetter <[email protected]>; Huang, Ray <[email protected]>; Gao, Likun <[email protected]>; Gui, Jack <[email protected]>; amd- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported()

Quoted 7 lines

There is a typo so the code unlocks twice instead of taking the lock and then releasing it.

Fixes f14a323db5b0 ("drm/amd/powerplay: implement update enabled

feature state to smc for smu11")

Thanks!

Will apply it.

---

Quoted 20 lines
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +1 -1
index 52d919a8b70a..85ac29af5363 100644
@@ -310,7 +310,7 @@ int smu_feature_set_supported(struct smu_context
 *smu, int feature_id,
 
        WARN_ON(feature_id > feature->feature_num);
 
-       mutex_unlock(&feature->mutex);
+       mutex_lock(&feature->mutex);
        if (enable)
                test_and_set_bit(feature_id, feature->supported);

else
--
2.20.1