]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/amdgpu:fix wb_clear
authorMonk Liu <Monk.Liu@amd.com>
Tue, 17 Oct 2017 11:18:56 +0000 (19:18 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 20 Oct 2017 17:28:55 +0000 (13:28 -0400)
Properly shift the index when clearing so we clear
the right bit

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index e29731c4ada704d7eb783990bcad8e8d8f77ad7d..efcacb827de73cab22755eb6c13ec05b76cd6bd8 100644 (file)
@@ -546,7 +546,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;
@@ -564,7 +564,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);
 }
 
 /**