* [PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported()
@ 2019-05-15 9:51 Dan Carpenter
2019-05-15 9:53 ` Huang, Ray
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-05-15 9:51 UTC (permalink / raw)
To: Alex Deucher, Kevin Wang
Cc: Chengming Gui, David Airlie, kernel-janitors, linux-kernel,
amd-gfx, Huang Rui, dri-devel, Likun Gao, Christian König
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 52d919a8b70a..85ac29af5363 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported()
2019-05-15 9:51 [PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported() Dan Carpenter
@ 2019-05-15 9:53 ` Huang, Ray
0 siblings, 0 replies; 2+ messages in thread
From: Huang, Ray @ 2019-05-15 9:53 UTC (permalink / raw)
To: Dan Carpenter, Deucher, Alexander, Wang, Kevin(Yang)
Cc: Koenig, Christian, Zhou, David(ChunMing), David Airlie,
Daniel Vetter, Gao, Likun, Gui, Jack,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Sent: Wednesday, May 15, 2019 5:52 PM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>; Wang, Kevin(Yang)
> <Kevin1.Wang@amd.com>
> Cc: Koenig, Christian <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> <David1.Zhou@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter
> <daniel@ffwll.ch>; Huang, Ray <Ray.Huang@amd.com>; Gao, Likun
> <Likun.Gao@amd.com>; Gui, Jack <Jack.Gui@amd.com>; amd-
> gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
> Subject: [PATCH] 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
Thanks!
Reviewed-by: Huang Rui <ray.huang@amd.com>
Will apply it.
---
> drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> index 52d919a8b70a..85ac29af5363 100644
> --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> @@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-15 9:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-15 9:51 [PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported() Dan Carpenter
2019-05-15 9:53 ` Huang, Ray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox