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

Huang, Ray Ray.Huang at amd.com
Wed May 15 09:53:33 UTC 2019


> -----Original Message-----
> From: Dan Carpenter <dan.carpenter at oracle.com>
> Sent: Wednesday, May 15, 2019 5:52 PM
> To: Deucher, Alexander <Alexander.Deucher at amd.com>; Wang, Kevin(Yang)
> <Kevin1.Wang at amd.com>
> Cc: Koenig, Christian <Christian.Koenig at amd.com>; Zhou, David(ChunMing)
> <David1.Zhou at amd.com>; David Airlie <airlied at linux.ie>; Daniel Vetter
> <daniel at ffwll.ch>; Huang, Ray <Ray.Huang at amd.com>; Gao, Likun
> <Likun.Gao at amd.com>; Gui, Jack <Jack.Gui at amd.com>; amd-
> gfx at lists.freedesktop.org; dri-devel at lists.freedesktop.org; linux-
> kernel at vger.kernel.org; kernel-janitors at 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 at oracle.com>
> 

Thanks!
Reviewed-by: Huang Rui <ray.huang at 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



More information about the amd-gfx mailing list