[PATCH] drm/amdgpu:fix wb_clear

Alex Deucher alexdeucher at gmail.com
Wed Oct 18 23:18:56 UTC 2017


On Wed, Oct 18, 2017 at 4:52 AM, Monk Liu <Monk.Liu at amd.com> wrote:
> Change-Id: I6d50cc769ee29bf13524c83105d5004b0a2d85e3
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>

Please include a better patch description.  Something like:
Properly shift the index when clearing so we clear the right bit.

With that fixed:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index ee3846c..23f946b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -551,7 +551,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
>
>         if (offset < adev->wb.num_wb) {
>                 __set_bit(offset, adev->wb.used);
> -               *wb = offset * 8; /* convert to dw offset */
> +               *wb = offset << 3; /* convert to dw offset */
>                 return 0;
>         } else {
>                 return -EINVAL;
> @@ -569,7 +569,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
>  void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb)
>  {
>         if (wb < adev->wb.num_wb)
> -               __clear_bit(wb, adev->wb.used);
> +               __clear_bit(wb >> 3, adev->wb.used);
>  }
>
>  /**
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list