Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock protections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 24, 2020 at 4:04 AM Evan Quan <evan.quan@xxxxxxx> wrote:
>
> As it is confirmed to have no race condition during hw setup.
>

For patches 1,2 please provide details as to why we know it is safe to
drop these.  For patches 3,4:
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>


> Change-Id: I096d7ab0855ff59b0ecb56fd9d6d9946b3605fc8
> Signed-off-by: Evan Quan <evan.quan@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c      | 4 ----
>  drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 --
>  2 files changed, 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index 09dc5303762b..b7cad8ef6153 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -361,20 +361,16 @@ static int smu_get_driver_allowed_feature_mask(struct smu_context *smu)
>         int ret = 0;
>         uint32_t allowed_feature_mask[SMU_FEATURE_MAX/32];
>
> -       mutex_lock(&feature->mutex);
>         bitmap_zero(feature->allowed, SMU_FEATURE_MAX);
> -       mutex_unlock(&feature->mutex);
>
>         ret = smu_get_allowed_feature_mask(smu, allowed_feature_mask,
>                                              SMU_FEATURE_MAX/32);
>         if (ret)
>                 return ret;
>
> -       mutex_lock(&feature->mutex);
>         bitmap_or(feature->allowed, feature->allowed,
>                       (unsigned long *)allowed_feature_mask,
>                       feature->feature_num);
> -       mutex_unlock(&feature->mutex);
>
>         return ret;
>  }
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
> index 548db1edd352..28a19ffd22a1 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
> @@ -721,7 +721,6 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)
>         int ret = 0;
>         uint32_t feature_mask[2];
>
> -       mutex_lock(&feature->mutex);
>         if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64)
>                 goto failed;
>
> @@ -738,7 +737,6 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)
>                 goto failed;
>
>  failed:
> -       mutex_unlock(&feature->mutex);
>         return ret;
>  }
>
> --
> 2.28.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux